Need better error message when generated assembly info collides with one in source.
See original GitHub issueI usually generate assembly information (such as version, informational version, etc) with custom tasks. However, when trying to use these with the SDK, it fails with errors such as Duplicate 'AssemblyVersion' attribute
. If I add <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
to the csproj it is built with no issue and my custom generated versions are available.
A simple way to reproduce this is to add the GitVersionTask
to the project and attempt to build.
The SDKs I’m using are:
<PackageReference Include="Microsoft.NET.Sdk">
<Version>1.0.0-alpha-20161104-2</Version>
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Sdk.Web">
<Version>1.0.0-alpha-20161104-2-112</Version>
<PrivateAssets>All</PrivateAssets>
</PackageReference>
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (7 by maintainers)
Top Results From Across the Web
Source file 'Properties\AssemblyInfo.cs' could not be found
I got the error using TFS, my AssemblyInfo wasn't mapped in the branch I was working on. This solved my problem. You should...
Read more >AssemblyInfo.cs not being generated automatically
There is no AssemblyInfo.cs generated based on the project properties, but rather the assembly information is automatically injected into the ...
Read more >Assembly definitions
A cyclical assembly reference exists when one assembly references a second assembly that, in turn, references the first assembly. Such cyclical references ...
Read more >MSB3277: Found conflicts between different versions of ' ...
This error occurs during a build when more than one version of the same dependent assembly is referenced in a build of the...
Read more >GCDS error messages - Google Workspace Admin Help
GCDS is running as a different user to the one that installed GCDS. Permissions have changed since installation. org.jdom.input. JDOMParseException: Error on ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This is a regression from previous behavior - an even simpler repro is add the following to a file:
This is how assembly information is added in all other .NET projects and is now broken with the new SDK without adding this property. The assembly level attributes should only be created if they are not already available.
Perhaps we just need some guidance on the landing page for this error:
https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-messages/cs0579
I tried to add a community comment:
But the site wouldn’t accept my Hotmail account. Go figure. Anyway, I think this would be enough to address the issue.