You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the project's AssemblyInfo.cs, remove the existing AssemblyInfo attribute and use the code below:
This causes a failure
#if NETSTANDARD1_0||WP8[assembly:AssemblyVersion("3.0.0.0")]
#elif NETSTANDARD1_1||WINDOWS8||NET45||NETCORE45[assembly:AssemblyVersion("3.0.1000.0")]
#elif NETSTANDARD1_2||WINDOWS81||NET451||NETCORE451||WPA81[assembly:AssemblyVersion("3.0.2000.0")]
#elif NETSTANDARD1_3||NET46[assembly:AssemblyVersion("3.0.3000.0")]
#elif NETSTANDARD1_4||UAP10_0||NETCORE50||NET461[assembly:AssemblyVersion("3.0.4000.0")]
#elif NETSTANDARD1_5||NET462[assembly:AssemblyVersion("3.0.5000.0")]
#elif NETSTANDARD1_6||NETCOREAPP1_0||NET463[assembly:AssemblyVersion("3.0.6000.0")]
#endif
Addingan `#else` works despite the above logic covering all executable paths.
Try to compile. You get a duplicate attribute error. Looking at the obj directory,the tool has generated an AssemblyVersion attribute that it includes.
Expected behavior
This should work. It shouldn't require an else if the defines are satisfied.
Runtime Environment:
OS Name: Windows
OS Version: 10.0.14379
OS Platform: Windows
RID: win10-x64
The text was updated successfully, but these errors were encountered:
clairernovotny
changed the title
dotnet-compile generates AssemblyInfoAttribute even if brought in via compile
dotnet-compile generates duplicate AssemblyInfoAttribute with ifdefs
Jul 4, 2016
Take a look at this test and the next. You can use properties like < GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute> to disable automatic generation. Less Magic!!
Steps to reproduce
Create a new xproj/project.json project.
In the project's AssemblyInfo.cs, remove the existing AssemblyInfo attribute and use the code below:
This causes a failure
Expected behavior
This should work. It shouldn't require an else if the defines are satisfied.
Actual behavior
Fails with duplicate attribute
Environment data
dotnet --info
output:.NET Command Line Tools (1.0.0-preview2-003121)
Product Information:
Version: 1.0.0-preview2-003121
Commit SHA-1 hash: 1e9d529
Runtime Environment:
OS Name: Windows
OS Version: 10.0.14379
OS Platform: Windows
RID: win10-x64
The text was updated successfully, but these errors were encountered: