re: Newbie stuck on step 4 of installation (version 3 c#)

Topics: Help
Jan 15, 2010 at 12:43 AM

Hi,

I am new to C# but would like to learn it but I am stuck trying to install the application. I have altered the web.config file with the name of the db I created in SQL Server 2005 and I have overriden the function within SessionBuilder.cs having ensured that line 42 in uncommented in the global.asax file. The code in SessionBuilder.cs is as follows:

 

using System.Configuration;
using ClubStarterKit.Data.NHibernate;
using StructureMap;
using IBootstrapper = ClubStarterKit.Core.IBootstrapper;

namespace ClubStarterKit.Web.Infrastructure.Application
{
     
    
    public class SessionBuilder : SessionBuilderBase
    {
        public override FluentNHibernate.Cfg.Db.IPersistenceConfigurer DataConfiguration
        {
            get
            {
                return FluentNHibernate.Cfg.Db.MsSqlConfiguration.MsSql2005
                                                                   .ConnectionString(ConnectionString);
            }
        }
    
        
        protected override string ConnectionString
        {
            get
            {
                return ConfigurationManager.ConnectionStrings["myDB"].ConnectionString;
            }
        }
    }

    public class SessionBuilderBootstrapper : IBootstrapper
    {
        public void Bootstrap()
        {
            ObjectFactory.Configure(x => x.ForRequestedType<SessionBuilderBase>()
                                          .TheDefaultIsConcreteType<SessionBuilder>());
        }
    }
}

Jan 15, 2010 at 3:37 PM

The error I am getting is:

Dialect does not support DbType.DateTimeOffset

Coordinator
Jan 20, 2010 at 12:41 AM

Me culpa on that one. You'll have to do a ReplaceAll on the entities to use DateTime instead of DateTimeOffset.... there might be some build errosr, which you could easily fix yourself, or I can help you fix. But that should take care of the error.

 

Zack Owens

Jan 20, 2010 at 10:56 PM

Hi Zack,

I've got 6 errors that I am hoping you can help me with....

Error    1    'System.DateTime' does not contain a definition for 'UtcDateTime' and no extension method 'UtcDateTime' accepting a first argument of type 'System.DateTime' could be found (are you missing a using directive or an assembly reference?)    C:\Users\Administrator\Downloads\clubstarterkit v3 jt\ClubStarterKit.Infrastructure\UI\Calendar\CalendarDay.cs    56    25    ClubStarterKit.Infrastructure

Error    2    The best overloaded method match for 'System.DateTime.DateTime(long)' has some invalid arguments    c:\users\administrator\downloads\clubstarterkit v3 jt\clubstarterkit.infrastructure\ui\calendar\calendarmonth.cs    59    24    ClubStarterKit.Infrastructure

Error    3    Argument 1: cannot convert from 'System.DateTime' to 'long'    c:\users\administrator\downloads\clubstarterkit v3 jt\clubstarterkit.infrastructure\ui\calendar\calendarmonth.cs    59    37    ClubStarterKit.Infrastructure

Error    4    Metadata file 'C:\Users\Administrator\Downloads\clubstarterkit v3 jt\ClubStarterKit.Infrastructure\bin\Debug\ClubStarterKit.Infrastructure.dll' could not be found    ClubStarterKit.Web

Error    5    Metadata file 'C:\Users\Administrator\Downloads\clubstarterkit v3 jt\ClubStarterKit.Web\bin\ClubStarterKit.Web.dll' could not be found    ClubStarterKit.Tests

Error    6    Metadata file 'C:\Users\Administrator\Downloads\clubstarterkit v3 jt\ClubStarterKit.Infrastructure\bin\Debug\ClubStarterKit.Infrastructure.dll' could not be found    ClubStarterKit.Tests

 

Do you know if anyone has already created a SQL 2005 version of CSK Version 3 rar file? Thanks for your help.

JT

Coordinator
Jan 21, 2010 at 2:36 AM

Ignore 4,5 and 6... those will be resolved when everything compiles.

 

Change line 56 of Infrastructure\UI\Calendar\CalendarDay.cs to return Date.UtcNow.ToShortDateString();

Change line 59 of Infrastructure\UI\Calendar\CalendarMonth.cs to var init = new DateTime(year, month, 1).ToFirstDayOfWeek();

 

Those should make it compile... but no guarantees. SQL 2005 isn't going to be supported more than likely... this is because we have a lot of international users and DateTimeOffset is something that is in the right direction for supporting those people.