1
Vote

Multiple errors when running initial build

description

I tried the OpenAuth fix in web.config and that did not resolve that issue either, but here is a list of all the build errors I'm getting below. Also the NuGet installation working without issue. Thanks in advance for any help.

Error 1 The name 'DatabaseGeneratedOption' does not exist in the current context C:\ProjectsJames\SilkDev\MileageStats\MileageStats.Data.SqlCe\MileageStatsDbContext.cs 57 45 MileageStats.Data.SqlCe
Error 2 The name 'DatabaseGeneratedOption' does not exist in the current context C:\ProjectsJames\SilkDev\MileageStats\MileageStats.Data.SqlCe\MileageStatsDbContext.cs 67 17 MileageStats.Data.SqlCe
Error 3 The name 'DatabaseGeneratedOption' does not exist in the current context C:\ProjectsJames\SilkDev\MileageStats\MileageStats.Data.SqlCe\MileageStatsDbContext.cs 76 45 MileageStats.Data.SqlCe
Error 4 The name 'DatabaseGeneratedOption' does not exist in the current context C:\ProjectsJames\SilkDev\MileageStats\MileageStats.Data.SqlCe\MileageStatsDbContext.cs 88 45 MileageStats.Data.SqlCe
Error 5 The name 'DatabaseGeneratedOption' does not exist in the current context C:\ProjectsJames\SilkDev\MileageStats\MileageStats.Data.SqlCe\MileageStatsDbContext.cs 104 45 MileageStats.Data.SqlCe
Error 6 The name 'DatabaseGeneratedOption' does not exist in the current context C:\ProjectsJames\SilkDev\MileageStats\MileageStats.Data.SqlCe\MileageStatsDbContext.cs 114 45 MileageStats.Data.SqlCe
Error 7 The name 'DatabaseGeneratedOption' does not exist in the current context C:\ProjectsJames\SilkDev\MileageStats\MileageStats.Data.SqlCe\MileageStatsDbContext.cs 129 45 MileageStats.Data.SqlCe
Error 8 Metadata file 'C:\ProjectsJames\SilkDev\MileageStats\MileageStats.Data.SqlCe\bin\Debug\MileageStats.Data.SqlCe.dll' could not be found MileageStats.Data.SqlCe.Tests
Error 9 Metadata file 'C:\ProjectsJames\SilkDev\MileageStats\MileageStats.Data.SqlCe\bin\Debug\MileageStats.Data.SqlCe.dll' could not be found MileageStats.Web
Error 10 Metadata file 'C:\ProjectsJames\SilkDev\MileageStats\MileageStats.Web\bin\MileageStats.Web.dll' could not be found MileageStats.Web.Tests
Error 11 Metadata file 'C:\ProjectsJames\SilkDev\MileageStats\MileageStats.Web\bin\MileageStats.Web.dll' could not be found MileageStats.Services.Tests
Error 12 Metadata file 'C:\ProjectsJames\SilkDev\MileageStats\MileageStats.Data.SqlCe\bin\Debug\MileageStats.Data.SqlCe.dll' could not be found MileageStats.Services.Tests
Warning 13 Could not resolve this reference. Could not locate the assembly "DotNetOpenAuth". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. MileageStats.Web
Warning 14 Could not resolve this reference. Could not locate the assembly "DotNetOpenAuth". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. MileageStats.Web.Tests
Warning 15 The referenced component 'DotNetOpenAuth' could not be found.
Warning 16 The referenced component 'DotNetOpenAuth' could not be found.

comments

aadami wrote Dec 6, 2012 at 11:30 AM

Hi,

It would be helpful to know which version of Visual Studio are you using to run the sample. As this could help in order to reproduce the error you are mentioning.

Regards,

Agustin Adami
http://blogs.southworks.net/aadami

aadami wrote Dec 7, 2012 at 12:40 PM

So far I could reproduce the aforementioned errors when building MileageStats in Visual Studio 2012. In order to avoid them I have to make the following changes:

-Removed the reference to DotNetOpenAuth assembly (as it's from an older version than the one installed by Nuget) from the MileageStats.Web and MileageStats.Web.Tests projects

-Added the following statement to the MileageStatsDbContext.cs file in the MileageStats.Data.SqlCe project to avoid the The name 'DatabaseGeneratedOption' does not exist in the current context error :

using System.ComponentModel.DataAnnotations.Schema;

As it seems that there have been changes in this namespace if you installed Entity Framework version 5.x.

Also, as you mentioned you will also have to remove the surplus section in the Web.Config in MileageStats.Web:
<!-- <section name="dotNetOpenAuth" type="DotNetOpenAuth.Configuration.DotNetOpenAuthSection" requirePermission="false" allowLocation="true" />--> After doing these changes I could build and run the sample without problems.

Regards,

Agustin Adami
http://blogs.southworks.net/aadami

SkildLobster wrote Dec 15, 2012 at 2:56 PM

I tried to run this under Visual Studio 2010 Ultimate. I will try the measures you mentioned above and reply back. Thanks!

TheBetpet wrote Jul 9, 2013 at 10:50 AM

Ok, I know it's a little old but I've just been going through the same issues building with VS2012. The removal of the surplus section was one I encountered. The main issue mentioned is a missing NuGet package. Open the Console via

Tools -> Library Package Manager -> Package Manager Console

Then enter the following command:

Install-Package DotNetOpenAuth

This should install the missing requirements. When you recompile, you'll get less errors but will have to apply some of the references to other projects. The easiest method is to navigate to

Tools -> Library Package Manager -> Manage NuGet Packages for Solution...

Then find the newly installed Package (DotNetOpenAuth) and click the Manage button. You should then have a tree structure where you can check the projects you wish to add the references to. The errors will indicate which projects will require them.