Error cs0579 duplicate system reflection assemblycompanyattribute attribute

Steps to reproduce I am using 1.0.0-preview4-004079 prerelase version of .Net core. My csproj file is following: <Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/d...

@piotrpMSFT I tried suggested solution with adding Exclude to Compile section and getting following crash:

MSBUILD : error MSB1025: An internal failure occurred while running MSBuild.
System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.Build.Shared.FileMatcher.GetFiles(String projectDirectoryUnescaped, String filespecUnescaped, IEnumerable`1 excludeSpecsUnescaped, GetFileSystemEntries getFileSystemEntries, DirectoryExists directoryExists)
   at Microsoft.Build.Internal.EngineFileUtilities.GetFileList(String directoryEscaped, String filespecEscaped, Boolean returnEscaped, IEnumerable`1 excludeSpecsEscaped)
   at Microsoft.Build.Evaluation.LazyItemEvaluator`4.IncludeOperation.SelectItems(Builder listBuilder, ImmutableHashSet`1 globsToIgnore)
   at Microsoft.Build.Evaluation.LazyItemEvaluator`4.LazyItemOperation.Apply(Builder listBuilder, ImmutableHashSet`1 globsToIgnore)
   at Microsoft.Build.Evaluation.LazyItemEvaluator`4.MemoizedOperation.Apply(Builder listBuilder, ImmutableHashSet`1 globsToIgnore)
   at Microsoft.Build.Evaluation.LazyItemEvaluator`4.LazyItemList.ComputeItems(LazyItemList lazyItemList, ImmutableHashSet`1 globsToIgnore)
   at Microsoft.Build.Evaluation.LazyItemEvaluator`4.LazyItemList.GetItems(ImmutableHashSet`1 globsToIgnore)
   at Microsoft.Build.Evaluation.LazyItemEvaluator`4.<>c.<GetAllItems>b__22_0(LazyItemList itemList)
   at System.Linq.Enumerable.<SelectManyIterator>d__157`2.MoveNext()
   at System.Collections.Generic.EnumerableHelpers.ToArray[T](IEnumerable`1 source, Int32& length)
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.OrderedEnumerable`1.ToList()
   at Microsoft.Build.Evaluation.LazyItemEvaluator`4.GetAllItems()
   at Microsoft.Build.Evaluation.Evaluator`4.Evaluate()
   at Microsoft.Build.Execution.ProjectInstance.Initialize(ProjectRootElement xml, IDictionary`2 globalProperties, String explicitToolsVersion, String explicitSubToolsetVersion, Int32 visualStudioVersionFromSolution, BuildParameters buildParameters, ILoggingService loggingService, BuildEventContext buildEventContext)
   at Microsoft.Build.Execution.ProjectInstance..ctor(String projectFile, IDictionary`2 globalProperties, String toolsVersion, BuildParameters buildParameters, ILoggingService loggingService, BuildEventContext buildEventContext)
   at Microsoft.Build.BackEnd.RequestBuilder.LoadProjectIntoConfiguration()
   at Microsoft.Build.BackEnd.RequestBuilder.<BuildProject>d__57.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at Microsoft.Build.BackEnd.RequestBuilder.<BuildAndReport>d__49.MoveNext()

MSBUILD : error MSB1025: An internal failure occurred while running MSBuild.
System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.Build.CommandLine.MSBuildApp.BuildProject(String projectFile, String[] targets, String toolsVersion, Dictionary`2 globalProperties, ILogger[] loggers, LoggerVerbosity verbosity, DistributedLoggerRecord[] distributedLoggerRecords, Int32 cpuCount, Boolean enableNodeReuse, TextWriter preprocessWriter, Boolean debugger, Boolean detailedSummary)
   at Microsoft.Build.CommandLine.MSBuildApp.Execute(String[] commandLine)

Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.Build.CommandLine.MSBuildApp.BuildProject(String projectFile, String[] targets, String toolsVersion, Dictionary`2 globalProperties, ILogger[] loggers, LoggerVerbosity verbosity, DistributedLoggerRecord[] distributedLoggerRecords, Int32 cpuCount, Boolean enableNodeReuse, TextWriter preprocessWriter, Boolean debugger, Boolean detailedSummary)
   at Microsoft.Build.CommandLine.MSBuildApp.Execute(String[] commandLine)
   at Microsoft.Build.CommandLine.MSBuildApp.Main(String[] args)

When you create a project, Visual Studio sets it up to compile & generate a corresponding assembly. Each project generates 1 assembly, and so each has a corresponding assembly configuration to generate its assembly from.

The problem is when you create more than one project that each can generate their own assembly, and then include one of these projects in the other.

In this scenario, Visual Studio gets confused and doesn’t know which config file to go off of to generate the single assembly for the project — it finds the second assembly configuration in the included project and says «HEY, DUPLICATE! You’ve given me two sets of instructions for generating my assembly!»

But sometimes you still want the included project to be able to generate an assembly on it’s own, but not when it is being included in another project.

To obtain this, one solution is to add conditional defines to the including project (found in project Properties). Then change the assembly config in the included project to look for this conditional define. If it is defined (by the including project), then the config can skip over it’s content — this will result in only 1 config found by VS — the one from the including project — problem solved!

Steps Below (screenshots included)

Step 1: Select the including/container Project > Right Click > Properties

Project properties (screenshot)

Step 2: Navigate to Build > General > Conditional compilation symbols

Add your conditional defines as shown:

Conditional compilation symbols (screenshot)

Step 3: Use conditional defines in the included project AssemblyInfo.cs

Using conditional defines (screenshot)

Содержание

  1. CS0579 Duplicate Attribute Error with .NET Core
  2. Problem description
  3. tl;dr Solution
  4. Details
  5. dotnet test result an error CS0579: Duplicate ‘System.Reflection.AssemblyCompanyAttribute’ #4837
  6. Comments
  7. build error from artifact (Duplicate attribute in AssemblyInfo.cs) #93
  8. Comments
  9. Дублировать атрибут AssemblyVersion
  10. 29 ответы

CS0579 Duplicate Attribute Error with .NET Core

I’ll leave the below for posterity, but recently I came across the real reason for the error. In this issue it was pointed out that your .net core solutions have to be structured in a particular way. Specifically, make sure that you do not create projects in the same directory as your main project.

Problem description

I recently started working on my first .NET Core project and quickly ran into a problem. After adding a class library project, the second time I ran dotnet run I received the following errors:

error CS0579: Duplicate ‘System.Reflection.AssemblyCompanyAttribute’ attribute error CS0579: Duplicate ‘System.Reflection.AssemblyConfigurationAttribute’ attribute error CS0579: Duplicate ‘System.Reflection.AssemblyFileVersionAttribute’ attribute error CS0579: Duplicate ‘System.Reflection.AssemblyInformationalVersionAttribute’ attribute error CS0579: Duplicate ‘System.Reflection.AssemblyProductAttribute’ attribute error CS0579: Duplicate ‘System.Reflection.AssemblyTitleAttribute’ attribute error CS0579: Duplicate ‘System.Reflection.AssemblyVersionAttribute’ attribute

tl;dr Solution

My Google-fu revealed the solution buried in a GitHub issue thread. Add the following line to your *.csproj files:

As the name indicates, this will prevent the build process from generating the AssemblyInfo.cs file in project obj directories, thus preventing the duplicate attribute conflict.

Details

Disclaimer: I am far from a .NET expert so there is probably more to this story.

Источник

dotnet test result an error CS0579: Duplicate ‘System.Reflection.AssemblyCompanyAttribute’ #4837

Hi,
When building my project under Azure Devops yaml pipeline, if I launch unit test in my Dockerfile, I get the following :
error CS0579: Duplicate ‘System.Reflection.AssemblyCompanyAttribute’

The project is like organised this way

So my Unit test (xUnit) project is under tests folder of my main project within the same repository.

My Dockerfile used for my CICD is

I both ITF.Microservices.Ordering.csproj and ITF.Microservices.Ordering.UnitTests.csproj I added the following to get rid of Duplicate errors.

Under Azure Devops I use the following pipeline

And the following build_deploy.yml template

The pipeline does build and publish the release correctly, but when I require dotnet test instruction from the Dockerfile, the tests are played and published

But it ended with an error

Full error line here
obj/Release/netcoreapp3.1/.NETCoreApp,Version=v3.1.AssemblyAttributes.cs(4,12): error CS0579: Duplicate ‘global::System.Runtime.Versioning.TargetFrameworkAttribute’ attribute [/src/src/ITF.Microservices.Ordering/ITF.Microservices.Ordering.csproj]

When I remove the dotnet test from the Dockerfile instruction, everything works fine

Some people seem to face the same problem as me
https://stackoverflow.com/a/62021598/4734707

The text was updated successfully, but these errors were encountered:

Источник

build error from artifact (Duplicate attribute in AssemblyInfo.cs) #93

.NET Core Version: (e.g. 3.0 Preview1, or daily build number, use dotnet —info )
3.0.100-preview-009750

Windows version: ( winver )
Version 1809 (OS Build 17763.134)

Does the bug reproduce also in WPF for .NET Framework 4.8?: No

Problem description:

When trying to build a basic WPF project for dotnet core 3.0 I get multiple duplicate attribute errors that appear to be from a temporary file ( objDebugnetcoreapp3.0NetCoreWpf_xnekjbde_wpftmp.AssemblyInfo.cs ) conflicting with the actual AssemblyInfo.cs file

To get this error, after a fresh install of Visual Studio 2019 preview 1 I tried to open and build a wpf dotnet core project modified using Brian Lagunis’s instructions from his blog post here. The project is empty (was generated in Visual Studio 15.9.3)

Actual behavior:
6 duplicate attribute errors fail the build.
CS0579 Duplicate ‘System.Reflection.AssemblyCompanyAttribute’ attribute
CS0579 Duplicate ‘System.Reflection.AssemblyConfigurationAttribute’ attribute
CS0579 Duplicate ‘System.Reflection.AssemblyFileVersionAttribute’ attribute
CS0579 Duplicate ‘System.Reflection.AssemblyProductAttribute’ attribute
CS0579 Duplicate ‘System.Reflection.AssemblyTitleAttribute’ attribute
CS0579 Duplicate ‘System.Reflection.AssemblyVersionAttribute’ attribute

Expected behavior:
No duplicate attribute errors occur unless there are duplicate attributes in my project, in which case the error message should point to the human-made code where the error occurs.

The text was updated successfully, but these errors were encountered:

Источник

Дублировать атрибут AssemblyVersion

У меня есть проект, который генерирует следующую ошибку при компиляции:

ошибка CS0579: повторяющийся атрибут «AssemblyVersion»

я проверил файл AssemblyInfo.cs и похоже, что дублирования там нет.

Я нашел эта статья в MSDN который решает аналогичную проблему и, следуя предложению в этой статье, также устраняет проблему.

Кто-нибудь может сказать мне, что здесь происходит? Это происходит только в случае наличия двух или более проектов с классами, имеющими одинаковые имена? Или что-то еще?

просто предположение, но вы пытались закрыть и снова открыть решение? может это решит? — Stefto

Я использую версию Visual Studio 2017 Community на Mac. У меня было консольное приложение, а затем я добавил ссылку на новый проект библиотеки классов. Эти ошибки начали появляться, когда я сделал сборку. Все, что я сделал, это удалил ссылку на проект библиотеки классов, а затем добавил ее обратно, и ошибки исчезли. — Flea

29 ответы

Начиная с Visual Studio 2017 другое решение, чтобы продолжать использовать AssemblyInfo.cs файл должен отключить автоматическую генерацию информации о сборке следующим образом:

Лично я считаю его очень полезным для проектов, которым необходимо поддерживать как .NET Framework, так и .NET Standard.

Да, это сработало для меня, удаления папок obj и bin было недостаточно. — Ник Йозевски

К сожалению, каждый раз, когда я меняю .csproj файл, используя его страницы свойств (Application, Build, Build Events и т. д.), PropertyGroup с GenerateAssemblyInfo исчезает :-(- Пало Мраз

Переместите его в файл Directory.Build.props — Bryan

Возможны ли какие-либо риски или отрицательный результат при использовании этого решения? — Маркоулсон

Отлично устранил мою проблему! — Дэниел Маклин

Я также сталкивался с этой проблемой в прошлом, поэтому я собираюсь предположить, что ваш процесс сборки предоставляет информацию о сборке отдельно от обеспечения версий. И это вызывает дублирование, так как ваш проект также имеет эту информацию в AssemblyInfo.cs файл. Так что удалите файл, и я думаю, что это должно работать.

Итак, не должен ли процесс сборки перезаписывать существующую версию AssemblyVersion вместо создания новой записи? Я знаю, что наш процесс сборки делает это, но мне любопытно, почему он не перезаписывает существующий. Это плохо реализовано или это ограничение? — Амира

Я думаю, что для сборок .net лучше всего использовать метод внедрения версии. Но это отдельная история. В вашем случае проблема заключается в том, что существуют разные способы предоставления версий сборки через параметры сборки командной строки и через AssemblyInfo.cs, и вы должны убедиться, что используется только один метод, поскольку дублирование атрибутов является ошибкой компиляции .net. — Луки

Удаление файла AssemblyInfo.cs устранило мою проблему. — Сануши Сальгадо

При преобразовании старого проекта в .NET Core большую часть информации, которая была в AssemblyInfo.cs, теперь можно установить в самом проекте. Откройте свойства проекта и выберите вкладку Package, чтобы увидеть новые настройки.

  • удалить конфликтующие элементы из файла AssemblyInfo.cs,
  • полностью удалить файл или
  • отключить GenerateAssemblyInfo (как предлагается в еще один ответ Сергея Семенова)

Я считаю более интуитивным и более «Visual Studio» указать эти атрибуты в проекте ( .csproj ), поскольку они являются метаданными, а не кодом, описывающим реальную логику. Надеюсь в будущем все можно будет уточнить в проекте! (В настоящее время я не могу указать видимость COM, поэтому я оставляю AssemblyInfo.cs .) — Франклин Ю

У меня была такая же ошибка, и она подчеркивала версию сборки Vesrion и файла сборки, поэтому, читая ответ Luqi, я просто добавил их в качестве комментариев, и ошибка была решена.

Я попробовал это, и это ничего не изменило в моем случае 🙁 — Герцен

В моем случае там, где в проекте была подпапка, которая сама была папкой проекта:

  • webapi (папка и проект)
    • тесты (папка)
  • тесты (папка и проект)

Затем мне пришлось удалить подпапку «тесты» из проекта «webapi».

ответ дан 12 дек ’17, 12:12

Я удалил подпроект из решения, но подкаталог и файлы все еще находились там. Их удаление окончательно решило проблему. — tobbenb3

В моем случае некоторые временные файлы *.cs, созданные во время компиляции, были случайно добавлены в проект.

Файлы были из objDebug каталог, поэтому их определенно не следовало добавлять в решение. А *.cs подстановочный знак немного сошел с ума и добавил их неправильно.

Удаление этих файлов решило проблему.

В проекте уже должен быть файл AssemblyInfo.cs:

Чтобы решить: — Удалите любой AssemblyInfo.cs

ответ дан 16 апр.

Я столкнулся с тем же, когда попытался добавить инструмент GitVersion для обновления моей версии в AssemblyInfo.cs. Используйте проект VS2017 и .NET Core. Так что я просто смешал оба мира. Мой AssemblyInfo.cs содержит только информацию о версии, сгенерированную инструментом GitVersion, мой csproj содержит оставшиеся вещи. Обратите внимание, я не использую false Я использую атрибуты, относящиеся только к версии (см. ниже). Подробнее здесь Свойства информации о сборке.

AssemblyInfo.cs

мой.csproj содержит все связанные с другими атрибутами сборки:

ответ дан 28 апр.

Для меня это было то, что AssembyInfo.cs и SolutionInfo.cs имели разные значения. Так что проверьте и эти файлы. Я просто удалил версию с одного из них.

Моя ошибка произошла из-за того, что каким-то образом в папке моих контроллеров была создана папка obj. Просто выполните поиск в своем приложении строки внутри вашего Assemblyinfo.cs. Где-то может быть дубликат.

ответ дан 23 мар ’17, в 16:03

Точно так же у меня был файл .csproj (A) внутри другой папки, принадлежащей другому .csproj (B). — Тейлорсвифтфан

Еще одно решение при обновлении ядра до VS2017 — удалить их в файле propertiesassemblyinfo.cs.

Так как они теперь хранятся в проекте.

ответ дан 19 окт ’17, 08:10

Обычно это происходит со мной, если я скомпилировал проект в Visual Studio 2017, а затем попытался перестроить и запустить его с помощью .NET Core с помощью команды командной строки «dotnet run».

Простое удаление всех папок «bin» и «obj» — как внутри «ClientApp», так и непосредственно в папке проекта — позволило команде .NET Core «dotnet run» успешно восстановить и запустить.

ответ дан 25 дек ’18, 02:12

Недавно я столкнулся с этим без изменений в исходном коде, но после экспериментов с некоторыми новыми ссылками на проекты. Я попал в состояние, когда эта ошибка появлялась даже после отмены всех изменений в ветке.

Очистка ветки разрешила это для меня:

Вы можете удалить бункер и об файл и очистить кеш проекта. Моя проблема была исправлена ​​​​с этого.

Создан 15 июля ’21, 17:07

Я нашел этот ответ на msdn, который объясняет, как пометить файл как содержимое, а затем скопировать в вывод = если новее. См. статью ниже:

Я получил эту ошибку, когда поместил 2 проекта в один и тот же каталог. Если у меня есть каталог с решением, и я помещаю в него отдельный каталог Web и Data, он компилируется правильно.

ответ дан 17 окт ’19, 09:10

У меня была эта проблема, когда мой основной проект находился в той же папке, что и решение, тогда у меня был отдельный проект в том же решении, расположенный в подпапке, и этот отдельный проект использовал основной проект в качестве ссылки. Это привело к тому, что основной проект обнаружил папки bin и obj подпапок, которые создали дубликаты ссылок.

Это мне очень помогло! Один проект ссылался на другой как на зависимость во время сборки, но ошибка в csproj привела к тому, что папки obj были разными, что привело к этой ошибке. — Чад Джессап

Если у вас возникла эта проблема в конвейере сборки в Azure DevOps, попробуйте указать действие сборки как «Содержимое» и «Копировать в выходной каталог», равное «Копировать, если новее» в свойствах файла AssembyInfo.cs.

Моя ошибка заключалась в том, что я также ссылался на другой файл в своем проекте, который также содержал значение атрибута «AssemblyVersion». Я удалил этот атрибут из одного из файлов, и теперь он работает правильно.

Главное — убедиться, что это значение не объявлено более одного раза в любом файле вашего проекта.

ответ дан 16 мар ’17, в 10:03

Отредактируйте файл AssemblyInfo.cs и #if !NETCOREAPP3_0 . #endif

Я считаю, что папка моей библиотеки была повреждена из-за непреднамеренного создания другой библиотеки классов. Я удалил библиотеку и все связанные файлы, но проблема не исчезла. Я нашел обходной путь, удалив ВСЕ папки bin и obj в каталоге. Раньше сборка была в порядке, но была обнаружена подпапка с тем же файлом Assemblyinfo.cs.

ответ дан 17 мар ’20, в 21:03

Эта проблема представляет собой конфликт ссылок, который в основном характерен для VS 2017.

Я решил эту же ошибку, просто закомментировав строки 7–14, а также коды версий сборки внизу страницы на AssemblyInfo.cs.

Он удалил все повторяющиеся ссылки, и проект снова смог собраться.

ответ дан 01 апр.

Я получил ошибку сразу после перехода с .NET Framework на .NET Core. У меня есть 2 проекта библиотеки классов в моем решении Visual Studio. Я понял, что в одном из проектов есть файл с именем AssemblyInfo.cs в то время как другой проект не имеет файла. Файл находится под Properties папка. Я просто удаляю папку «Свойства» и все работает нормально.

ответ дан 25 дек ’20, 03:12

Я боролся с этой проблемой, но мою проблему было решить намного проще.

Я скопировал папку OBJ с именем «OBJ___», чтобы выполнить некоторые тесты компиляции.

Итак, я не знаю почему, эта папка также компилировалась, создавая дублирование атрибутов сборки.

Я просто удалил папку «OBJ___» и смог успешно скомпилировать.

Я только что помог члену команды решить эту проблему, переименовав папку репо и повторно клонировав репо. Это было проблемой только для одного разработчика, так как все остальные в команде могли создавать мастер не сталкиваясь с этой ошибкой, поэтому мы знали, что проблема не в источнике.

Мы попытались удалить папки bin и obj и сделать git clean -xfd но ни один из них не решил проблему. В этом случае начало с чистой копии репо помогло.

Я тоже борюсь с этой проблемой. В моем случае я поместил решение и проект в одно и то же место. Поэтому у меня возникла проблема. После того, как я выбрал папку для решения и поместил проект в это решение, все заработало правильно.

ответ дан 02 окт ’21, 22:10

В моем случае один из моих коллег удалил консольное приложение, используемое для тестирования, которое было помещено в тот же каталог, что и наш API, а затем передано в Git. Когда я позже вытащил из Git, само консольное приложение, конечно, исчезло, но его папки bin и obj все еще были там, в результате чего файл AssemblyInfo.cs присутствовал как в корневом каталоге приложения, так и в подкаталоге для старого консольного приложения. Простое удаление папок bin и obj для старого консольного приложения решило проблему.

Я получил эти ошибки, потому что я пытался временно переименовать папку obj в obj_, а затем он автоматически включается в проект. Потом сборка.cs в ней стала биться с правильной в папке obj сгенерированной позже.

ответ дан 23 дек ’21, 07:12

Для всех, кто сталкивался с этой проблемой, я диагностировал ее для коллеги, которая утверждала, что ничего не меняла, но, как оказалось, случайно скопировала папку с кодом и не поняла этого. Так что было весело разбираться.

Урок: Предположим, что все лгут.

ответ дан 18 окт ’21, 20:10

Не тот ответ, который вы ищете? Просмотрите другие вопросы с метками c# compiler-errors or задайте свой вопрос.

Источник

As part of my research into IdentityServer4 I forked their samples repo, but I ran into the following issue trying to build the solution for the Client Credentials quickstart.

CS0579    Duplicate ‘System.Reflection.AssemblyCompanyAttribute’ attribute

CS0579    Duplicate ‘System.Reflection.AssemblyConfigurationAttribute’ attribute

CS0579    Duplicate ‘System.Reflection.AssemblyProductAttribute’ attribute

Searching the project each of these attributes only exists only in the AssemblyInfo.cs file found under properties. It turns out the file that is causing the issues only exists as a result of the build process and is found in the objDebugnetcoreapp1.1{ProjectName}.AssemblyInfo.cs file.

In this case, the client project is a console application so I created a new console application and the template no longer generates an AssemblyInfo.cs file for .NET Core. It turns out that as part of the move back to csproj most of the information that was in the AssemblyInfo.cs can now be set on the project its self. Open the project properties and select the Package tab to see the new settings.

Resolution

I found this issue on GitHub where there were a couple of options to resolve this issue which I am going to cover here plus a third option I tried not mention in the issue.

Option one is to remove the conflicting items from the AssemblyInfo.cs file. For example, the following would allow the project I am working with to build.

Before:
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Client")]
[assembly: AssemblyTrademark("")]

After:
[assembly: AssemblyTrademark("")]

Option two is to edit the csproj and turn the generation of the attributes causing the issues off.

Before:
<PropertyGroup>
  <TargetFramework>netcoreapp1.1</TargetFramework>
  <OutputType>Exe</OutputType>
</PropertyGroup>

After:
<PropertyGroup>
  <TargetFramework>netcoreapp1.1</TargetFramework>
  <OutputType>Exe</OutputType>
  <GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
  <GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
  <GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
</PropertyGroup>

The third option is to total delete the AssemblyInfo.cs file if your project doesn’t need it. This is the option I chose to go with. For a reason, you might want to keep the file around and just use option one see the “AssemblyInfo.cs is partially dead” section of this post by Muhammad Rehan Saeed. Side note: if you are interested in ASP.NET Core and you aren’t following Rehan you really should be.

Wrapping up

This is an issue that you will really only face when converting an older project to .NET Core. The fix is simple enough once you know what is going on. I opened an issue on the IdentityServer samples if you want to track if this has been fixed yet.

When migrating a project from .Net Framework to .Net Standard, you may run into issues where you get duplicate assembly attributes. An example you might see is something like this:

Severity	Code	Description	Project	File	Line	Suppression State
Error	CS0579	Duplicate 'System.Reflection.AssemblyTitleAttribute' attribute MyProject
D:DevMyProjectobjDebugnetstandard2.0MyProject.AssemblyInfo.cs	20	N/A

I ran into this because I have an AssemblyInfo.cs with an AssemblyTitleAttribute and the .Net Standard project is also generating the AssemblyTitleAttribute. After reading through some GitHub issues, it appears there are two ways around this issue.

First, I could remove the AssemblyInfo.cs that I already had in my project and add the appropriate attributes to the csproj file. Since I am converting a .Net Framework project in place with a new solution and csproj file, this will not work for me. I am left with the second option.

Add settings to the csproj file to indicate that the various attributes should not be generated. Here is an example csproj file with a few of the attributes disabled:

<Project Sdk="Microsoft.NET.Sdk">
    <PropertyGroup>
        <TargetFramework>netstandard2.0</TargetFramework>
        <GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
        <GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>
        <GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
        <GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
    </PropertyGroup>    
</Project>

Once those settings are added to the csproj file, everything compiles and there are no duplicate attribute errors.

UPDATED: 2020-12-23

I’ll leave the below for posterity, but recently I came across the real reason for the error. In this issue it was pointed out that your .net core solutions have to be structured in a particular way. Specifically, make sure that you do not create projects in the same directory as your main project.


Problem description

I recently started working on my first .NET Core project and quickly ran into a problem. After adding a class library project, the second time I ran dotnet run I received the following errors:

error CS0579: Duplicate ‘System.Reflection.AssemblyCompanyAttribute’ attribute
error CS0579: Duplicate ‘System.Reflection.AssemblyConfigurationAttribute’ attribute
error CS0579: Duplicate ‘System.Reflection.AssemblyFileVersionAttribute’ attribute
error CS0579: Duplicate ‘System.Reflection.AssemblyInformationalVersionAttribute’ attribute
error CS0579: Duplicate ‘System.Reflection.AssemblyProductAttribute’ attribute
error CS0579: Duplicate ‘System.Reflection.AssemblyTitleAttribute’ attribute
error CS0579: Duplicate ‘System.Reflection.AssemblyVersionAttribute’ attribute

tl;dr Solution

My Google-fu revealed the solution buried in a GitHub issue thread. Add the following line to your *.csproj files:

<GenerateAssemblyInfo>false</GenerateAssemblyInfo>

As the name indicates, this will prevent the build process from generating the AssemblyInfo.cs file in project obj directories, thus preventing the duplicate attribute conflict.

Details

Disclaimer: I am far from a .NET expert so there is probably more to this story.

The error is a result of the build process generating AssemblyInfo.cs files in each project obj directory. This file exists to provide MSBuild metadata about the resulting assembly that can be attached to the build artifact and utilized by anyone who wants such information. You can see your assembly info in Windows by selecting your build artifact, right click -> properties. The following shows the results with GenerateAssemblyInfo set to false. As you can see, the metadata is set to default values.

It’s not clear why the default .csproj file generated by dotnet new results in this behavior. The closest I came across was a mention of the philosophy to keep the file as terse as possible. Of course, I’m completely in support of this as .csproj tends to be a dense mess in Visual Studio. However, this particular scenario puts the onus on the developer to edit the file to eliminate an error which is almost guaranteed to occur in a project of any complexity. A better design decision would have probably been to default to not generating AssemblyInfo.cs.

Problem

You’re trying to add the AssemblyVersion attribute to your project, like this:

using System.Reflection; [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]

Code language: C# (cs)

And you get the following compiler errors:

Error CS0579 Duplicate ‘AssemblyVersion’ attribute

Error CS0579 Duplicate ‘AssemblyFileVersion’ attribute

But you don’t see these attributes anywhere else in your project.

Solution

The problem is Visual Studio auto-generates the assembly info by default.

To turn this off, put the following in your .csproj file:

<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <TargetFramework>netcoreapp3.1</TargetFramework> </PropertyGroup> <PropertyGroup> <GenerateAssemblyInfo>false</GenerateAssemblyInfo> </PropertyGroup> </Project>

Code language: HTML, XML (xml)

Where is the auto-generated assembly info?

My assembly is called DupeAssemblyVersion and I’m targeting .NET Core 3.1. So the auto-generated assembly info file is here: objDebugnetcoreapp3.1DupeAssemblyVersion.AssemblyInfo.cs.

Here’s what this file looks like:

//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ using System; using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("DupeAssemblyVersion")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")] [assembly: System.Reflection.AssemblyProductAttribute("DupeAssemblyVersion")] [assembly: System.Reflection.AssemblyTitleAttribute("DupeAssemblyVersion")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] // Generated by the MSBuild WriteCodeFragment class.

Code language: C# (cs)

  • Remove From My Forums
  • Question

  • I have created a new GAT project. Removed all the existing projects which are shown by default in the Project.

    I am adding a new project under Templates/Solutions/Projects/MyClassProject

    This folder has a file Properties/AssemblyInfo.cs. When am compiling my solution I ma getting the following compile errors

    Can someone help me understand why is this compiler errors seen? This AssemblyInfo.cs if my GAT project’s file and it seems to be clashing with Templates/Solutions/Projects/MyClassProject/Properties/AssemblyInfo.cs file.

    C:TempForDeleteRndTest_GuidancePackageMyApplicationPackageMyApplicationPackagePropertiesAssemblyInfo.cs(31,12): error CS0579: Duplicate ‘AssemblyVersion’ attribute
    C:TempForDeleteRndTest_GuidancePackageMyApplicationPackageMyApplicationPackagePropertiesAssemblyInfo.cs(20,12): error CS0579: Duplicate ‘ComVisible’ attribute
    C:TempForDeleteRndTest_GuidancePackageMyApplicationPackageMyApplicationPackagePropertiesAssemblyInfo.cs(15,12): error CS0579: Duplicate ‘AssemblyCulture’ attribute
    C:TempForDeleteRndTest_GuidancePackageMyApplicationPackageMyApplicationPackagePropertiesAssemblyInfo.cs(14,12): error CS0579: Duplicate ‘AssemblyTrademark’ attribute
    C:TempForDeleteRndTest_GuidancePackageMyApplicationPackageMyApplicationPackagePropertiesAssemblyInfo.cs(13,12): error CS0579: Duplicate ‘AssemblyCopyright’ attribute
    C:TempForDeleteRndTest_GuidancePackageMyApplicationPackageMyApplicationPackagePropertiesAssemblyInfo.cs(12,12): error CS0579: Duplicate ‘AssemblyProduct’ attribute
    C:TempForDeleteRndTest_GuidancePackageMyApplicationPackageMyApplicationPackagePropertiesAssemblyInfo.cs(11,12): error CS0579: Duplicate ‘AssemblyCompany’ attribute
    C:TempForDeleteRndTest_GuidancePackageMyApplicationPackageMyApplicationPackagePropertiesAssemblyInfo.cs(10,12): error CS0579: Duplicate ‘AssemblyConfiguration’ attribute
    C:TempForDeleteRndTest_GuidancePackageMyApplicationPackageMyApplicationPackagePropertiesAssemblyInfo.cs(9,12): error CS0579: Duplicate ‘AssemblyDescription’ attribute
    C:TempForDeleteRndTest_GuidancePackageMyApplicationPackageMyApplicationPackagePropertiesAssemblyInfo.cs(8,12): error CS0579: Duplicate ‘AssemblyTitle’ attribute

Answers

  • This is because you haven’t marked the .cs files you added as content files. You need to make sure the .cs files you add to the «Templates» folder are properly marked as «Build Action=Content» and «Copy To Output Directory=Copy If Newer» so they don’t get compiled with your solution (and classes don’t clash).

    In GAT, there is a recipe for automating this setting, if you right-click on the «Templates» folder you should see it, I just don’t remember the exact name for it right now, sorry.

    -vga.

  • When you right click on the «Templates» folder of your guidance package project you should get a menu option named «Set Content Files Build Properties», this is the recipe that will automatically set proper build properties for all the content files within that folder. If this option doesn’t appear please make sure that GAT is enabled for the solution you’re working on (go to Tools->Guidance Package Manager->Enable/Disable Packages and make sure Guidance Package Development is checked).

    If you want to do this manually, you need to go to each file located within «Templates» folder, look at its properties (press F4) and set its «Build Action» property to «Content» and its «Copy To Output Directoy» as «Copy if newer».

    HTH,
    -vga.

Forcing the creation of a project over the top of another using 'dotnet new classlib --force'

I have a very small project I started writing back in 2015 for parsing responses from DNS servers, more because I was interested in how to do so than any real need. Because this mostly pre-dates .NET Core/.NET Standard, the project was created as a .NET Framework project. Mere moment after having updated references from Framework v4.5 to v4.7 I pondered to myself just how difficult it’d be to upgrade both the Dns parser project and its associated tests to .NET Core

Turns out, not difficult at all!

Using the dotnet command to force an upgrade

Whilst it’s not technically speaking an upgade, it kinda-sorta is, so I’ll call it that! To update the project file for the main Dns project (which for convenience I’ve tagged netfx prior to tweaking), I dropped to the command line and ran the command:

dotnet new classlib --force

Closely following that by:

dotnet build

To shake out the errors that this had left in the project. It turns out that for a very simple project with no 3rd party / NuGet references, you get very, very close! The output from build was:

Microsoft (R) Build Engine version 15.8.166+gd4e8d81a88 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  Restore completed in 36.73 ms for D:GitHubDnsDnsDns.csproj.
objDebugnetstandard2.0Dns.AssemblyInfo.cs(14,12): error CS0579: Duplicate 'System.Reflection.AssemblyCompanyAttribute' attribute [D:GitHubDnsDnsDns.csproj]
objDebugnetstandard2.0Dns.AssemblyInfo.cs(15,12): error CS0579: Duplicate 'System.Reflection.AssemblyConfigurationAttribute' attribute [D:GitHubDnsDnsDns.csproj]
objDebugnetstandard2.0Dns.AssemblyInfo.cs(16,12): error CS0579: Duplicate 'System.Reflection.AssemblyFileVersionAttribute' attribute [D:GitHubDnsDnsDns.csproj]
objDebugnetstandard2.0Dns.AssemblyInfo.cs(18,12): error CS0579: Duplicate 'System.Reflection.AssemblyProductAttribute' attribute [D:GitHubDnsDnsDns.csproj]
objDebugnetstandard2.0Dns.AssemblyInfo.cs(19,12): error CS0579: Duplicate 'System.Reflection.AssemblyTitleAttribute' attribute [D:GitHubDnsDnsDns.csproj]
objDebugnetstandard2.0Dns.AssemblyInfo.cs(20,12): error CS0579: Duplicate 'System.Reflection.AssemblyVersionAttribute' attribute [D:GitHubDnsDnsDns.csproj]

Build FAILED.

objDebugnetstandard2.0Dns.AssemblyInfo.cs(14,12): error CS0579: Duplicate 'System.Reflection.AssemblyCompanyAttribute' attribute [D:GitHubDnsDnsDns.csproj]
objDebugnetstandard2.0Dns.AssemblyInfo.cs(15,12): error CS0579: Duplicate 'System.Reflection.AssemblyConfigurationAttribute' attribute [D:GitHubDnsDnsDns.csproj]
objDebugnetstandard2.0Dns.AssemblyInfo.cs(16,12): error CS0579: Duplicate 'System.Reflection.AssemblyFileVersionAttribute' attribute [D:GitHubDnsDnsDns.csproj]
objDebugnetstandard2.0Dns.AssemblyInfo.cs(18,12): error CS0579: Duplicate 'System.Reflection.AssemblyProductAttribute' attribute [D:GitHubDnsDnsDns.csproj]
objDebugnetstandard2.0Dns.AssemblyInfo.cs(19,12): error CS0579: Duplicate 'System.Reflection.AssemblyTitleAttribute' attribute [D:GitHubDnsDnsDns.csproj]
objDebugnetstandard2.0Dns.AssemblyInfo.cs(20,12): error CS0579: Duplicate 'System.Reflection.AssemblyVersionAttribute' attribute [D:GitHubDnsDnsDns.csproj]
    0 Warning(s)
    6 Error(s)

Time Elapsed 00:00:02.31

These are caused by the presence of PropertiesAssemblyInfo.cs which is getting pulled in. This originally contained the version number, copyright notice and other such metadata (in the form of assembly attributes) for the .NET Framework project. This data now gets stored in the project file and a temporary file (the one referenced in the errors above) is generated to feed into the compiler so that the attributes get applied to the generated assembly. Back to the command line:

del .PropertiesAssemblyInfo.cs
rd .Properties
dotnet build

And, success:

Microsoft (R) Build Engine version 15.8.166+gd4e8d81a88 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  Restore completed in 38.82 ms for D:GitHubDnsDnsDns.csproj.
  Dns -> D:GitHubDnsDnsbinDebugnetstandard2.0Dns.dll

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:01.77

Well, that was simple, though a project that doesn’t have any dependencies on either (a) other projects, or (b) other libraries isn’t going to. Don’t forget to remove the added Class1.cs that forms part of the Class Library template!

The test project is a bit more complicated as it has both a dependency on the main Dns project and also on NUnit. Trying the same (dotnet new classlib) on the test project produces slightly more mixed results… the same assembly attribute errors but then a whole host of errors relating to NUnit, along with the components of the Dns project. Back to the command line:

D:GitHubDnsDns.Test>dotnet add reference ..Dns
Reference `..DnsDns.csproj` added to the project.

D:GitHubDnsDns.Test>dotnet add package NUnit
  Writing C:UsersrobertwrayAppDataLocalTemptmp580E.tmp
info : Adding PackageReference for package 'NUnit' into project 'D:GitHubDnsDns.TestDns.Test.csproj'.
log  : Restoring packages for D:GitHubDnsDns.TestDns.Test.csproj...
info :   GET https://api.nuget.org/v3-flatcontainer/nunit/index.json
info :   OK https://api.nuget.org/v3-flatcontainer/nunit/index.json 523ms
info : Package 'NUnit' is compatible with all the specified frameworks in project 'D:GitHubDnsDns.TestDns.Test.csproj'.
info : PackageReference for package 'NUnit' version '3.10.1' added to file 'D:GitHubDnsDns.TestDns.Test.csproj'.

By keeping a note of packages referenced (see packages.config) and adding them via the command line, migrating the project file becomes a lot simpler. Lastly I added a package reference to NUnit3TestRunner and Microsoft.Net.Test.Sdk before moving on.

Running the tests

This is where it all went a bit wrong, at least initially. Running a test via Visual Studio spat out:

[18/09/2018 22:44:14 Informational] ------ Run test started ------
[18/09/2018 22:44:14 Informational] NUnit Adapter 3.10.0.21: Test execution started
[18/09/2018 22:44:14 Informational] Running all tests in D:GitHubDnsDns.TestbinDebugnetstandard2.0Dns.Test.dll
[18/09/2018 22:44:15 Warning] Exception NUnit.Engine.NUnitEngineException, Exception thrown executing tests in D:GitHubDnsDns.TestbinDebugnetstandard2.0Dns.Test.dll
[18/09/2018 22:44:15 Warning] An exception occurred in the driver while loading tests.
[18/09/2018 22:44:15 Warning]    at NUnit.Engine.Runners.DirectTestRunner.LoadDriver(IFrameworkDriver driver, String testFile, TestPackage subPackage)
   at NUnit.Engine.Runners.DirectTestRunner.LoadPackage()
... snip ...
   at NUnit.VisualStudio.TestAdapter.NUnit3TestExecutor.RunAssembly(String assemblyPath, TestFilter filter) in D:reposnunitnunit3-vs-adaptersrcNUnitTestAdapterNUnit3TestExecutor.cs:line 229
[18/09/2018 22:44:15 Warning] Innerexception: System.IO.FileNotFoundException: Could not load file or assembly 'nunit.framework' or one of its dependencies. The system cannot find the file specified.
File name: 'nunit.framework'
   at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
... snip ...
   at NUnit.Engine.Drivers.NUnit3FrameworkDriver.CreateObject(String typeName, Object[] args)
   at NUnit.Engine.Drivers.NUnit3FrameworkDriver.Load(String testAssemblyPath, IDictionary`2 settings)
   at NUnit.Engine.Runners.DirectTestRunner.LoadDriver(IFrameworkDriver driver, String testFile, TestPackage subPackage)

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLMSoftwareMicrosoftFusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLMSoftwareMicrosoftFusion!EnableLog].

[18/09/2018 22:44:15 Informational] NUnit Adapter 3.10.0.21: Test execution complete
[18/09/2018 22:44:15 Warning] No test matches the given testcase filter `FullyQualifiedName=Dns.Test.DnsNameTests.ToByteArray.Returns_Correctly_For_Single_Label_Name` in D:GitHubDnsDns.TestbinDebugnetstandard2.0Dns.Test.dll
[18/09/2018 22:44:15 Informational] ========== Run test finished: 0 run (0:00:00.8276633) ==========

Which is a wonderfully complex and long-winded way of saying «something’s gone very wrong». Taking Visual Studio out of the equation by running the tests via the command line is my next step to try and work out what’s gone wrong here, which gives some slightly more interesting / useful output:

D:GitHubDnsDns.Test>dotnet test
D:GitHubDnsDns.TestDns.Test.csproj : warning NU1701: Package 'NUnit3TestAdapter 3.10.0' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project.
Build started, please wait...
D:GitHubDnsDns.TestDns.Test.csproj : warning NU1701: Package 'NUnit3TestAdapter 3.10.0' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project.
Build completed.

Test run for D:GitHubDnsDns.TestbinDebugnetstandard2.0Dns.Test.dll(.NETStandard,Version=v2.0)
Microsoft (R) Test Execution Command Line Tool Version 15.8.0
Copyright (c) Microsoft Corporation.  All rights reserved.

Starting test execution, please wait...
System.IO.FileNotFoundException: Unable to find tests for D:GitHubDnsDns.TestbinDebugnetstandard2.0Dns.Test.dll. Make sure test project has a nuget reference of package "Microsoft.NET.Test.Sdk" and framework version settings are appropriate. Rerun with /diag option to diagnose further.
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Hosting.DotnetTestHostManager.GetTestHostProcessStartInfo(IEnumerable`1 sources, IDictionary`2 environmentVariables, TestRunnerConnectionInfo connectionInfo)
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyOperationManager.SetupChannel(IEnumerable`1 sources)
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyExecutionManager.StartTestRun(TestRunCriteria testRunCriteria, ITestRunEventsHandler eventHandler)

Test Run Aborted.

So it looks like there’s something not quite right with NUnit3TestAdaper!

First things first, clear up the bin/obj folders by running dotnet clean then make sure that it’s done what you think (it won’t have, I read something recently that explained that clean doesn’t blow everything away, rather it uses some metadata stored during build to essentially remove any artifacts from the build). So, looking at the Debug folder it’s clear that there are a load of files left which haven’t been cleaned, the netstandard2.0 folder inside is entirely empty. Does it matter?

The complaint from dotnet test on the command line is that NUnitTestAdapter is the .NET Framework version rather than the .NET Core/Standard version so lets take a look at NUnit3.TestAdapter.dll and check. The file in the Debug folder has a size of 67,584 bytes, going up into the solution level packages folder and digging down into NUnitTestAdapter3.10.0build gives two folders, net35 and netcoreapp1.0. The file in net35 has a size of 67,584 bytes, in netcoreapp1.0 it’s 65,024 bytes, there’s a potential culrpit!

One of two things has happened, either files have been left over from before I converted the projects in the solution fron .NET Framework to .NET Core or something went wrong when the packages were restored. I’m going to take a bet on the former by deleting the contents of the bin folder for both projects and seeing what happens:

D:GitHubDns>del Dnsbin*.* /S /Q
D:GitHubDns>del Dnsobj*.* /S /Q D:GitHubDns>del Dns.Testbin*.* /S /Q
D:GitHub>Dns>del Dns.Testobj*.* /S /Q
D:GitHubDns>del packages*.* /S /Q
D:GitHubDns>del DnsPackages.config
D:GitHubDns>del Dns.TestPackages.config

Just for info /S instructs delete to remove files from subdirectories as well and /Q tells it to not prompt with an ‘Are you sure?’ for each and every thing.

Doing what I should’ve done in the first place(!)

Even after all this, no dice so it’s time for the option that should’ve been taken from the start, using the dotnet command to create an nunit project, overwriting the existing project file and then adding back the reference to the main project, so (from inside the Dns.Test directory):

dotnet new nunit --force
dotnet add reference ..Dns
dotnet build

The result of that set of commands is much healthier:

Microsoft (R) Build Engine version 15.8.166+gd4e8d81a88 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  Restoring packages for D:GitHubDnsDns.TestDns.Test.csproj...
  Restore completed in 54.9 ms for D:GitHubDnsDnsDns.csproj.
  Restore completed in 650.17 ms for D:GitHubDnsDns.TestDns.Test.csproj.
  Dns -> D:GitHubDnsDnsbinDebugnetstandard2.0Dns.dll
  Dns.Test -> D:GitHubDnsDns.TestbinDebugnetcoreapp2.0Dns.Test.dll

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:03.48

Finally comes running dotnet test to see what that gleans, and the net result is success along with the same in Visual Studio:

All the tests passing after actually running in Visual Studio 2017

Converting the project to .NET Core was a little bit fraught as I should’ve just let the tooling do the heavy lifting of creating an NUnit test project for me, but thanks to the defaults for «new style» project files where they include all source files by default, the amount of actual work was minimal!

Понравилась статья? Поделить с друзьями:
  • Error cs0535 unity
  • Error cs0433 the type exists in both
  • Error cs0305 using the generic method group getcomponent requires 1 type arguments
  • Error cs0246 unity3d как исправить
  • Error cs0246 unity как исправить