Note that there are some explanatory texts on larger screens.

plurals
  1. POCS0246 and CS0433 errors when building .NET 4.0 website on Server 2012
    text
    copied!<p>I am building a .Net 4.0 web project on Server 2012 with .Net 4.5 installed. I am using Psake under TeamCity and am getting CS0246 saying NotMapped could not be found, along with CS0433 saying it has found two DLLs for DataAnnotations.</p> <p>The class looks like this:</p> <pre><code>using System.ComponentModel.DataAnnotations.Schema; public abstract class Order { [NotMapped] public decimal TaxPercentage { get; set; } } </code></pre> <p>The full errors are:</p> <pre><code>Ordering\Order.cs(105,8): error CS0246: The type or namespace name 'NotMapped' could not be found (are you missing a using directive or an assembly reference?) [C:\TeamCity\buildAgent\work\71c853cb9b4c108\Code\Models\Model.csproj] Ordering\Order.cs(105,8): error CS0433: The type 'System.ComponentModel.DataAnnotations.Schema.NotMappedAttribute' exists in both 'c:\TeamCity\buildAgent\work\71c853cb9b4c108\Code\packages\EntityFramework.5.0.0\lib\net40\EntityFramework.dll' and 'c:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.ComponentModel.DataAnnotations\v4.0_4.0.0.0__31bf3856ad364e35\System.ComponentModel.DataAnnotations.dll' [C:\TeamCity\buildAgent\work\71c853cb9b4c108\Code\Models\Model.csproj] </code></pre> <p>The build works fine under Windows 8 using just Psake and not TeamCity. Any ideas how to resolve this?</p> <p>Update: I've made a smaller test <a href="https://bitbucket.org/seankearon/ef-build-test" rel="nofollow">project</a> and this builds fine on 2012. Looks like there's something weird with my main project.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload