• first create the database by executing the db.sql script (open it in sql management studio, hit f5, you are going to get some errors like: "can not drop the database prodinner" or "only user processes can be killed" it's ok, the script kills all connections to prodinner, drops the db, creates it, and inserts some data )
  • start the solution (ProDinner.sln)
  • edit the connection string from WebUI\web.config (if it's needed, probably you will need to change the Data Source, now it's .\sqlexpress, also username and password, now they are UID=sa;pwd=1), you can also edit the connection string in Tests\app.config if you want to run the unit tests

now the project should be working, but it could happen that when you try to upload an image you will get "a generic GDI+ error occurred", this can happen if you incorrectly set the value to storagePath in web.config or because IIS needs write permissions for the pictures folder, here' how to do this:
  • go to properties of \WebUI\pictures folder and in security tab add full control rights for the IIS_IUSRS (on Win7 and 2008 server it's properties-> security tab -> Edit button -> Add button -> Advanced button -> Find Now button -> select IIS_IUSRS from the search results -> OK button -> OK button -> Full Control checkbox -> OK -> OK )

Last edited Jan 30, 2012 at 10:18 AM by o, version 2

Comments

mphamilton Feb 10, 2013 at 2:05 PM 
None of the samples for MVC that I have downloaded (4 of them) on 2 different development systems have ever built, and usually some portion of them doesn't load into VS 2010(with the mysterious MVC 4 installed, although I can't see that it actually ads anything in the way of creatable objects into VS2010). I can't be sure at this point that MVC is actually a real technology or a web based hoax. I think I will stick with plain old ASP.net and actually get some work done.

ismarDude Jan 24, 2013 at 3:21 AM 
Regarding my comment from earlier today
I have managed to get rid of the error by installing MVC4.
I should have paid more attention to which MVC version the latest download targets :-)

ismarDude Jan 24, 2013 at 2:49 AM 
Just followed your installation procedure and the solution builds fine.
However, when trying to run I get the following exception

Could not load file or assembly 'System.Web.Helpers' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference

It appears to be some sort of version-related issue as the included System.Web.Helpers dll has version 1 and the asp.net is trying to load version two.

Here is the complete stack trace of the error

[FileLoadException: Could not load file or assembly 'System.Web.Helpers' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]

[FileLoadException: Could not load file or assembly 'System.Web.Helpers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]
System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0
System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +39
System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks) +132
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +144
System.Reflection.Assembly.Load(String assemblyString) +28
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +46

[ConfigurationErrorsException: Could not load file or assembly 'System.Web.Helpers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +618
System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +209
System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +130
System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +178
System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies() +94
System.Web.Compilation.BuildManager.CallPreStartInitMethods() +332
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +677

[HttpException (0x80004005): Could not load file or assembly 'System.Web.Helpers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9090988
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +97
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +258

Not sure how this can be rectified ?

qqboe Mar 15, 2012 at 3:47 AM 
I'm from china ,pop up not support the area. auto:en-us is invaild. i set the browser the language area to en-us ,but It's doesn't work!

joecruz Oct 13, 2011 at 8:15 PM 
you need to install mvc3. here is the link: http://www.asp.net/mvc/mvc3

bhaskar_joardar Aug 29, 2011 at 9:05 PM 
I am using visual Studio 2010 with Version 10.0.30319.1 . Will you please tell me why WebUI project is not being loaded. Most probably it is not getting the <MvcBuildViews>false</MvcBuildViews> tag in the WebUI.csproj file. Can anyone tell me what to do?