繁体   English   中英

错误CS0246:找不到类型或命名空间名称“AssemblyFileVersion”

[英]Error CS0246: The type or namespace name 'AssemblyFileVersion' could not be found

在此输入图像描述 Properties \\ AssemblyInfo.cs(41,12):错误CS0246:找不到类型或命名空间名称'AssemblyFileVersion'。

我在使用TFS构建代理时遇到此错误,但在使用工作室中的.csproj构建时没有遇到此问题。

有什么我想念的吗? 我的assemblyinfo文件如下所示:

// --------------------------------------------------------------------------------------------------------------------

using System.Reflection;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following 
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("MyLibrary")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("My Compamy")]
[assembly: AssemblyProduct("MyLibrary")]
[assembly: AssemblyCopyright("Copyright © x 2013")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible 
// to COM components.  If you need to access a type in this assembly from 
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("09634b91-c3b1-45da-88a8-dfa7cd7950f5")]

// Version information for an assembly consists of the following four values:
//      Major Version
//      Minor Version 
//      Build Number
//      Revision
// You can specify all the values or you can default the Revision and Build Numbers 
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.13231.2")]

请尝试这样 :将所有这些库放在您的构建计算机上。 使用NuGet管理包并将其配置为下拉缺少的库。 您可能想要手动添加它们。

我最终解决了这个问题。 我在TFS中有一个NuGet版本控制包,它正在检查AssemblyInfo类并重新添加AssemblyFileVersion属性。 我关闭了此功能,因为.NET CF不支持该属性。

暂无
暂无

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM