简体   繁体   English

MSBuild错误CS0012

[英]MSBuild Error CS0012

I am having a msbuild error with dotNet framework 4.0. 我在dotNet framework 4.0中遇到msbuild错误。 I can build locally in VS2012 without any errors but when I push the code to the build server it fails with the following error: 我可以在VS2012中进行本地构建,而不会出现任何错误,但是当我将代码推送到构建服务器时,它将失败,并出现以下错误:

error CS0012: The type 'CS.Framework.Services.IRequest' is defined in an assembly that is not referenced. You must add a reference to assembly 'CS.Framework.Services, Version=1.0.0.0, Culture=neutral, PublicKeyToken=0decfeffa518e9a9'.

Here is the logging from msbuild and you can see the project in question is listed: 这是msbuild的日志记录,您可以看到有问题的项目已列出:

<task name="msbuild">
    <message level="Info"><![CDATA[CS.Framework.Enums -> e:\CCNet\SVNCheckouts\]></message>
    <message level="Info"><![CDATA[CS.Framework.Extensions -> e:\CCNet\SVNCheckouts\]></message>
    <message level="Info"><![CDATA[CS.Entities.Common -> e:\CCNet\SVNCheckouts\]></message>
    <message level="Info"><![CDATA[CS.Framework.Common -> e:\CCNet\SVNCheckouts\]></message>
    <message level="Info"><![CDATA[CS.Framework.Services -> e:\CCNet\SVNCheckouts\]></message>
    <message level="Info"><![CDATA[CS.DataContracts.Services.Core -> e:\CCNet\SVNCheckouts\]]></message>
    <message level="Info"><![CDATA[CS.DataContracts.NetSuiteService -> e:\CCNet\SVNCheckouts\]></message>
    <message level="Info"><![CDATA[CS.ServiceContracts.NetSuiteService -> e:\CCNet\SVNCheckouts\]></message>
    <message level="Info"><![CDATA[CS.DataContracts.Authorization -> e:\CCNet\SVNCheckouts\]></message>
    <message level="Info"><![CDATA[CS.ServiceContracts.Authorization -> e:\CCNet\SVNCheckouts\]]></message>
    <message level="Info"><![CDATA[CS.Entities.Services.Core -> e:\CCNet\SVNCheckouts\]]></message>
    <message level="Info"><![CDATA[CS.Framework.Caching -> e:\CCNet\SVNCheckouts\]]></message>
    <message level="Info"><![CDATA[CS.Framework.Wcf -> e:\CCNet\SVNCheckouts\]]></message>
    <message level="Info"><![CDATA[CS.Framework.Services.Core -> e:\CCNet\SVNCheckouts\]]></message>
    <message level="Info"><![CDATA[CS.Services.NetSuiteService -> e:\CCNet\SVNCheckouts\]]></message>
    <message level="Info"><![CDATA[c:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1360,9): warning MSB3245: Could not resolve this reference. Could not locate the assembly "CS.Framework.Services". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. ]]></message>
    <message level="Info"><![CDATA[ServiceTests.cs(41,13): error CS0012: The type 'CS.Framework.Services.IRequest' is defined in an assembly that is not referenced. You must add a reference to assembly 'CS.Framework.Services, Version=1.0.0.0, Culture=neutral, PublicKeyToken=0decfeffa518e9a9'. ]]></message>
    <duration>1000.0256</duration>
  </task>

The project has a reference to CS.Framework.Services project so not sure why it says its not there. 该项目引用了CS.Framework.Services项目,因此不确定为什么它不存在。

It's right there: 就在这里:

warning MSB3245: Could not resolve this reference. 
Could not locate the assembly "CS.Framework.Services".
Check to make sure the assembly exists on disk.

Locally you have the assembly on disk, but if you get it from SVN, this assembly is not there. 在本地,程序集在磁盘上,但是如果您是从SVN获得的,则此程序集不存在。 You need to make sure your build server has access to this assembly. 您需要确保构建服务器可以访问该程序集。

我最终删除并重新添加了引用,这似乎可以解决问题。

暂无
暂无

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

相关问题 错误CS0012:类型“DbConnection”在未引用的程序集中定义 - Error CS0012: The type 'DbConnection' is defined in an assembly that is not referenced 带有显式调用的 C# 构造函数歧义 - 错误 CS0012 - C# Constructors Ambiguity with explicit call - Error CS0012 错误CS0012:类型'TaskAwaiter <>'在未引用的程序集中定义 - error CS0012: The type 'TaskAwaiter<>' 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 CS0012构建入门Xamarin Android应用程序时出错 - CS0012 Error when building the getting started Xamarin Android app 当我在 Linux 中使用 csc 编译时,Newtonsoft.Json 中的 function JArray.Parse 出现错误 CS0012 - when I compile with csc in Linux,the function JArray.Parse in Newtonsoft.Json with error CS0012 使用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' FluentAssertions 错误 CS0012:您必须添加对程序集 System.Data 的引用 - FluentAssertions error CS0012: You must add a reference to assembly System.Data CS0012 类型“EventLogEntryType”在未引用的程序集中定义 - CS0012 The type 'EventLogEntryType' is defined in an assembly that is not referenced 使用C#代码生成问题-CS0012-IsLongModifier - Build issue with c# code - CS0012 - IsLongModifier
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM