简体   繁体   English

CS0012 System.enum在未针对.NET 4.5的构建服务器上引用的程序集中定义

[英]CS0012 System.enum is defined in an assembly not referenced on build server targeting .NET 4.5

I have an ASP.NET web application targeting .NET 4.5. 我有一个针对.NET 4.5的ASP.NET Web应用程序。 Locally, the project builds, but on the build server (TeamCity) it fails: 在本地,项目构建,但在构建服务器(TeamCity)上它失败:

...cs(77, 38): error CS0012: The type 'System.Enum' is defined in an assembly that is not referenced. ... cs(77,38):错误CS0012:类型'System.Enum'在未引用的程序集中定义。 You must add a reference to assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. 您必须添加对程序集'System.Runtime,Version = 4.0.0.0,Culture = neutral,PublicKeyToken = b03f5f7f11d50a3a'的引用。

What can be the cause of (and remedy for) this? 这可能是什么原因(和补救措施)?

I had the very same error message (although targeting framework 4.5.1). 我有相同的错误消息(虽然目标框架4.5.1)。 The answer for me was to install the Microsoft .NET Framework 4.5.1 Developer Pack on the build server. 我的答案是在构建服务器上安装Microsoft .NET Framework 4.5.1 Developer Pack

If targeting framework 4.5 and the build server is running Windows Server 2012, be sure to add the .NET Framework 4.5. 如果目标框架4.5和构建服务器运行的是Windows Server 2012,请确保添加.NET Framework 4.5。 Features using Server Manager. 功能使用Server Manager。 If TeamCity is installed on a previous version of Windows, check out the Microsoft .NET Framework installation guide . 如果TeamCity安装在以前版本的Windows上,请查看Microsoft .NET Framework安装指南

问题是Team City设置为在构建步骤中使用“Visual Studio 2013”​​,而我们的项目使用“Visual Studio 2012”。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 .Net Core-CS0012&#39;对象&#39;在未引用的程序集中定义 - .Net Core - CS0012 'Object' is defined in an assembly that is not referenced 错误CS0012:类型“DbConnection”在未引用的程序集中定义 - Error CS0012: The type 'DbConnection' is defined in an assembly that is not referenced CS0012 C#类型“ HttpContext”在未引用的程序集中定义 - CS0012 C# The type 'HttpContext' is defined in an assembly that is not referenced 错误CS0012:类型'TaskAwaiter <>'在未引用的程序集中定义 - error CS0012: The type 'TaskAwaiter<>' is defined in an assembly that is not referenced CS0012 类型“EventLogEntryType”在未引用的程序集中定义 - CS0012 The type 'EventLogEntryType' is defined in an assembly that is not referenced 使用RazorTemplates库时发生错误:&#39;CS0012:类型&#39;System.Attribute&#39;在未引用的程序集中定义&#39; - Error when using RazorTemplates library: 'CS0012: The type 'System.Attribute' is defined in an assembly that is not referenced' 错误CS0012:类型&#39;ConnectionStringSettings&#39;在升级到Visual Studio 2015后未引用的程序集中定义 - error CS0012: The type 'ConnectionStringSettings' is defined in an assembly that is not referenced after upgrading to Visual Studio 2015 FluentAssertions 错误 CS0012:您必须添加对程序集 System.Data 的引用 - FluentAssertions error CS0012: You must add a reference to assembly System.Data 使用C#代码生成问题-CS0012-IsLongModifier - Build issue with c# code - CS0012 - IsLongModifier MSBuild错误CS0012 - MSBuild Error CS0012
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM