Ошибка CS0246: не удалось найти тип или имя пространства имен AssemblyFileVersion
Свойства \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")]
2 ответа
Решение
Я решил это в конце. У меня был пакет управления версиями NuGet в TFS, который проверял класс AssemblyInfo и повторно добавлял атрибут AssemblyFileVersion. Я отключил эту функцию, так как этот атрибут не поддерживается.NET CF.
Пожалуйста, попробуйте это: поместите все эти библиотеки на свой компьютер. Используйте NuGet для управления пакетами и настройте его для удаления отсутствующих библиотек. Вы можете добавить их вручную.