My new build for the application that I updated fails. Update for .Net Framework 4.0 to 4.5 and EF to version 6. Error message:
Models \ Mapping \ vw_EmployeesAndJobTitlesMap.cs (47): type name "DatabaseGeneratedOption" not found. This type was redirected to the assembly 'System.ComponentModel.DataAnnotations, Version = 4.0.0.0, Culture = Neutral, PublicKeyToken = 31bf3856ad364e35'. Consider adding a link to this assembly.
In the log I get the following:
Built $ / SCD4 / SCD4.Model / SCD4.Model.csproj.metaproj by default target.
00:00 Built $ / StandardClassLibrary / StandardClassLibrary / StandardClassLibrary / StandardClassLibrary.csproj for default purposes.
00:01 Built-in $ / SCD4 / SCD4.Model / SCD4.Model.csproj for default purposes. C: \ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ Microsoft.Common.targets (847): reference assemblies for the ".NETFramework, Version = v4.5" framework were not found. To solve this problem, install the SDK or Targeting Pack for this version of the framework or reconfigure the application to the version of the framework for which you have an SDK or targeting package. Please note that assemblies will be allowed from the Global Cache (GAC) and will be used instead of control assemblies. Therefore, your assembly may be incorrect designed for the structure that you plan to use. c: \ Builds \ 1 \ SCD4 \ SCD4 - Test \ Sources \ MVC4 \ sCD4 \ packages \ EntityFramework.6.0.2 \ Lib et45 \ EntityFramework.dll: A reference to the type 'System.ComponentModel.DataAnnotations.Schema.DatabaseGeneratedOption' states that it is defined in 'c: \ Windows \ Microsoft.NET \ assembly \ GAC_MSIL \ System.ComponentModel.DataAnnotations \ v4.0_4.0.0.0__31bf3856ad364e35 \ System.ComponentModel.DataAnnotations.dll', but it cannot be found c: \ Builds \ 1 \ SCD4 \ SCD4 - Test \ Sources \ MVC4 \ sCD4 \ packages \ EntityFramework.6.0.2 \ Lib et45 \ EntityFramework.dll: A reference to the type 'System.ComponentModel.DataAnnotations.Schema.DatabaseGeneratedOption' claims to be defined in 'c: \ Windows \ Microsoft.NET \ assembly \ GAC_MSIL \ System.ComponentModel.DataAnnotations \ v4.0_4.0.0.0__31bf3856ad364e35 \ System.ComponentModel.DataAnnotations.dll', but it cannot be found c: \ Builds \ 1 \ SCD4 \ SCD4 - Test \ Sources \ MVC4 \ sCD4 \ n chum \ EntityFramework.6.0.2 \ Lib et45 \ EntityFramework.dll: A reference to the type 'System.ComponentModel.DataAnnotations.Schema.DatabaseGeneratedOption' claims to be defined in 'c: \ Windows \ Microsoft.NET \ assembly \ GAC_MSIL \ System .ComponentModel.DataAnnotations \ v4.0_4.0.0.0__31bf3856ad364e35 \ System.ComponentModel.DataAnnotations.dll ', but it cannot be found c: \ Builds \ 1 \ SCD4 \ SCD4 - Test \ Sources \ MVC4 \ sCD4 \ packages \ EntityFramework .6.0.2 \ Lib et45 \ EntityFramework.dll: A reference to the type 'System.ComponentModel.DataAnnotations.Schema.DatabaseGeneratedOption' states that it is defined in 'c: \ Windows \ Microsoft.NET \ assembly \ GAC_MSIL \ System.ComponentModel. DataAnnotations \ v4.0_4.0.0.0__31bf3856ad364e35 \ System.ComponentModel.DataAnnotations.dll ', but it cannot be found c: \ Builds \ 1 \ SCD4 \ SCD4 - Test \ Sources \ MVC4 \ sCD4 \ packages \ EntityFramework.6.0. 2 \ Lib et45 \ EntityFramewo rk.dll: A reference to the type 'System.ComponentModel.DataAnnotations.Schema.DatabaseGeneratedOption' states that it is defined in 'c: \ Windows \ Microsoft.NET \ assembly \ GAC_MSIL \ System.ComponentModel.DataAnnotations \ v4.0_4.0.0. 0__31bf3856ad364e35 \ System.ComponentModel.DataAnnotations.dll ', but could not be found Models \ Mapping \ vw_EmployeesAndJobTitlesMap.cs (24): type name "DatabaseGeneratedOption" was not found. This type was redirected to the assembly 'System.ComponentModel.DataAnnotations, Version = 4.0.0.0, Culture = Neutral, PublicKeyToken = 31bf3856ad364e35'. Consider adding a link to this assembly.
When I click the link in the log, this particular line seems to be the problem:
using System.ComponentModel.DataAnnotations.Schema;
EF is version 6. Error messages say that c:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.ComponentModel.DataAnnotations\v4.0_4.0.0.0__31bf3856ad364e35\System.ComponentModel.DataAnnotations.dll does not exist, but when I see him, he exists.
My log file is as follows:
The assembly began on 02/20/2014 14:38:54. The project "C: \ Builds \ 2 \ SCD4 \ SCD4 - Test \ Sources \ MVC4 \ SCD4 \ SCD4.sln" on node 1 (default goals). ValidateSolutionConfiguration: Configure the Debug | Any Processor building configuration. The project "C: \ Builds \ 2 \ SCD4 \ SCD4 - Test \ Sources \ MVC4 \ SCD4 \ SCD4.sln" (1) builds "C: \ Builds \ 2 \ SCD4 \ SCD4 - Test \ Sources \ MVC4 \ SCD4 \ SCD4 \ SCD4.csproj.metaproj "(2) on node 1 (default targets). The project "C: \ Builds \ 2 \ SCD4 \ SCD4 - Test \ Sources \ MVC4 \ SCD4 \ SCD4 \ SCD4.csproj.metaproj" (2) builds "C: \ Builds \ 2 \ SCD4 \ SCD4 - Test \ Sources \ MVC4 \ sCD4 \ SCD4.Repository \ SCD4.Repository.csproj.metaproj "(3) on node 1 (default targets). The project "C: \ Builds \ 2 \ SCD4 \ SCD4 - Test \ Sources \ MVC4 \ sCD4 \ SCD4.Repository \ SCD4.Repository.csproj.metaproj" (3) builds "C: \ Builds \ 2 \ SCD4 \ SCD4 - Test \ Sources \ StandardClassLibrary \ StandardClassLibrary \ StandardClassLibrary.csproj "(4) on node 1 (default targets). C: \ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ Microsoft.Common.targets (847.9): warning MSB3644: reference assemblies for the ".NETFramework, Version = v4.5" framework were not found. To solve this problem, install the SDK or Targeting Pack for this version of the framework or reconfigure the application to the version of the framework for which you have an SDK or targeting package. Please note that assemblies will be allowed from the Global Cache (GAC) and will be used instead of control assemblies. Therefore, your assembly may be incorrect designed for the structure that you plan to use. [C: \ Builds \ 2 \ SCD4 \ SCD4 - Test \ Sources \ StandardClassLibrary \ StandardClassLibrary \ StandardClassLibrary.csproj] PrepareForBuild: creating the directory "obj \ Debug \". GenerateTargetFrameworkMonikerAttribute: skip the target "GenerateTargetFrameworkMonikerAttribute" because all output files are relevant with respect to the input files. CoreCompile:
c: \ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ Csc.exe / noconfig / nowarn: 1701,1702 / nostdlib + / errorreport: prompt / warn: 4 / define: DEBUG; TRACE / reference: "C: \ Builds \ 2 \ SCD4 \ SCD4 - Test \ Sources \ MVC4 \ sCD4 \ packages \ EntityFramework.6.0.2 \ Lib \ net40 \ EntityFramework.dll" / reference: "C: \ Builds \ 2 \ SCD4 \ SCD4 - Test \ Sources \ MVC4 \ sCD4 \ packages \ EntityFramework.6.0.2 \ Lib \ net40 \ EntityFramework.SqlServer.dll "/reference:C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.CSharp \ v4.0_4.0.0.0__b03f5f7f11d50a3a \ Microsoft.CSharp.dll /reference:c:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll /reference:C:\Windows\Microsoft.Net\assembly\GAC_MSIL \ System.ComponentModel.DataAnnotations \ v4.0_4.0.0.0__31bf3856ad364e35 \ System.ComponentModel.DataAnnotations.dll / reference: C: \ Windows \ Microsoft.Net \ assembly \ GAC_MSIL \ System.Configuration \ v4.0_4.0.0.0__b03f5f7a1150 System.Configuration.dll /reference:C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll / reference: C: \ Windows \ Microsoft.Net \ assembly \ GAC_MSIL \ System.Data.DataSetExtensions \ v4.0_4.0.0.0__b77a5c561934e089 \ System.D ata.DataSetExtensions.dll /reference:C:\Windows\Microsoft.Net\assembly\GAC_32\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll / reference: C: \ Windows \ Microsoft.Net \ assembly \ GAC_MSIL \ System \ v4.0_4.0.0.0__b77a5c561934e089 \ System.dll /reference:C:\Windows\Microsoft.Net\assembly\GAC_32\System.Web\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.dll / reference: "c: \ Program Files \ Microsoft ASP.NET \ ASP.NET MVC 3 \ Assemblies \ System.Web.Mvc.dll" /reference:C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml \ v4.0_4.0.0.0__b77a5c561934e089 \ System.Xml.dll /reference:C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml.Linq\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.Linq. dll / debug + / debug: full / filealign: 512 / optimize- /out:obj\Debug\StandardClassLibrary.dll/target: library EmailMessage.cs Models FileSystem.cs \ JqueryDataTableParamModel.cs SessionObjects.cs StandardConstants.cs Dynamic.cs UserMembership .cs Properties OperationStatus.cs \ AssemblyInfo.cs RepositoryBase.cs "C: \ Users \ TF SBuildAgent \ AppData \ Local \ Temp.NETFramework, Version = v4.5.AssemblyAttributes.cs "
How to fix it?