错误CS0246:找不到类型或名称空间名称'AssemblyFileVersion' [英] Error CS0246: The type or namespace name 'AssemblyFileVersion' could not be found
问题描述
属性\ AssemblyInfo.cs(41,12):错误CS0246:类型或找不到名称空间名称"AssemblyFileVersion".
Properties\AssemblyInfo.cs(41,12): error CS0246: The type or namespace name 'AssemblyFileVersion' could not be found.
当我使用TFS构建代理时遇到此错误,但是使用Studio中的.csproj进行构建时没有此问题.
I'm getting this error when I use TFS build agent but don't have this problem with building using the .csproj from studio.
我有什么想念的吗?我的assemblyinfo文件如下所示:
Is there anything I am missing? My assemblyinfo file looks like so:
// --------------------------------------------------------------------------------------------------------------------
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")]
推荐答案
我最后解决了这个问题.我在TFS中有一个NuGet版本控制包,它正在检出AssemblyInfo类并重新添加 AssemblyFileVersion 属性.我关闭了此功能,因为.NET CF不支持该属性.
I worked it out in the end. I had a NuGet versioning package in TFS which was checking out the AssemblyInfo class and re-adding the AssemblyFileVersion attribute. I turned this feature off as the attribute is not supported by the .NET CF.
这篇关于错误CS0246:找不到类型或名称空间名称'AssemblyFileVersion'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!