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
AD0001 crash in ILLink.RoslynAnalyzer.RequiresAssemblyFilesAnalyzer in 6.0.200 / 6.0.201
Run dotnet publish --no-restore -warnaserror -p:PublishSingleFile=true --configuration:Release -r:linux-x64 --self-contained:true -p:PublishReadyToRun=False -p:PublishReadyToRunShowWarnings=True -p:PublishTrimmed=False -p:DisableSwagger=False -p:TreatWarningsAsErrors=True -p:Version=0.0.1.9-master -p:IncludeNativeLibrariesForSelfExtract=false -p:SolutionDir=..\\ --output ../server-dist
Microsoft (R) Build Engine version 17.1.0+ae57d105c for .NET
Copyright (C) Microsoft Corporation. All rights reserved.
AD0001.Publish.Example.Lib1.Data.Interfaces -> /home/runner/work/roslyn-ad0001-requiresassemblyfilesanalyzer-error/roslyn-ad0001-requiresassemblyfilesanalyzer-error/src/AD0001.Publish.Example.Lib1.Data.Interfaces/bin/Release/net6.0/AD0001.Publish.Example.Lib1.Data.Interfaces.dll
AD0001.Publish.Example.Database.Interfaces -> /home/runner/work/roslyn-ad0001-requiresassemblyfilesanalyzer-error/roslyn-ad0001-requiresassemblyfilesanalyzer-error/src/AD0001.Publish.Example.Database.Interfaces/bin/Release/net6.0/AD0001.Publish.Example.Database.Interfaces.dll
AD0001.Publish.Example.Lib1 -> /home/runner/work/roslyn-ad0001-requiresassemblyfilesanalyzer-error/roslyn-ad0001-requiresassemblyfilesanalyzer-error/src/AD0001.Publish.Example.Lib1/bin/Release/net6.0/AD0001.Publish.Example.Lib1.dll
CSC : error AD0001: Analyzer 'ILLink.RoslynAnalyzer.RequiresAssemblyFilesAnalyzer' threw an exception of type 'System.InvalidCastException' with message 'Unable to cast object of type 'Microsoft.CodeAnalysis.CSharp.Symbols.PublicModel.TypeParameterSymbol' to type 'Microsoft.CodeAnalysis.INamedTypeSymbol'.'. [/home/runner/work/roslyn-ad0001-requiresassemblyfilesanalyzer-error/roslyn-ad0001-requiresassemblyfilesanalyzer-error/src/AD0001.Publish.Example.Database.Dapper/AD0001.Publish.Example.Database.Dapper.csproj]
Error: Process completed with exit code 1.
CSC : error AD0001: Analyzer 'ILLink.RoslynAnalyzer.RequiresAssemblyFilesAnalyzer' threw an exception of type 'System.InvalidCastException' with message 'Unable to cast object of type 'Microsoft.CodeAnalysis.CSharp.Symbols.PublicModel.TypeParameterSymbol' to type 'Microsoft.CodeAnalysis.INamedTypeSymbol'.'. [/home/markr/work/personal/roslyn-ad0001-requiresassemblyfilesanalyzer-error/src/AD0001.Publish.Example.Database.Dapper/AD0001.Publish.Example.Database.Dapper.csproj]
note that if you change the .net SDK version to 6.0.102 (as is in master) then the error can no longer be reproduced.
Expected behavior
Compiles with no AD0001 error (or a sane diagnostic to be output that can be fixed)
Actual behavior
CSC : error AD0001: Analyzer 'ILLink.RoslynAnalyzer.RequiresAssemblyFilesAnalyzer' threw an exception of type 'System.InvalidCastException' with message 'Unable to cast object of type 'Microsoft.CodeAnalysis.CSharp.Symbols.PublicModel.TypeParameterSymbol' to type 'Microsoft.CodeAnalysis.INamedTypeSymbol'.'. [/home/markr/work/personal/roslyn-ad0001-requiresassemblyfilesanalyzer-error/src/AD0001.Publish.Example.Database.Dapper/AD0001.Publish.Example.Database.Dapper.csproj]
Additional context
Example code that demonstrates the issue showing the one change needed to exhibit it:
The text was updated successfully, but these errors were encountered:
credfeto
changed the title
error AD0001: Analyzer 'ILLink.RoslynAnalyzer.RequiresAssemblyFilesAnalyzer' threw an exception of type 'System.InvalidCastException' with message 'Unable to cast object of type 'Microsoft.CodeAnalysis.CSharp.Symbols.PublicModel.TypeParameterSymbol' to type 'Microsoft.CodeAnalysis.INamedTypeSymbol'.
error AD0001: Analyzer 'ILLink.RoslynAnalyzer.RequiresAssemblyFilesAnalyzer' during publish
Mar 13, 2022
credfeto
changed the title
error AD0001: Analyzer 'ILLink.RoslynAnalyzer.RequiresAssemblyFilesAnalyzer' during publish
AD0001: 'ILLink.RoslynAnalyzer.RequiresAssemblyFilesAnalyzer' during publish
Mar 13, 2022
Analyzer
AD0001 crash in
ILLink.RoslynAnalyzer.RequiresAssemblyFilesAnalyzer
in 6.0.200 / 6.0.201Analyzer source
SDK: Built-in CA analyzers in .NET 6 SDK or later(https://docs.microsoft.com/dotnet/fundamentals/productivity/code-analysis)
Version: SDK 6.0.201, 6.0.200
Note issue doesn't appear in 6.0.102, 6.0.103...
Also happens when the Microsoft.CodeAnalysis.NetAnalyzers 6.0.0 package directly with the 6.0.201, 6.0.200 SDKS but not with 6.0.102, 6.0.103
NuGet Package: Microsoft.CodeAnalysis.NetAnalyzers
Version: 6.0.0
Describe the bug
When publishing using the following command line Get an AD0001 error.
Steps To Reproduce
depends/ff-3881/update-dotnet/6.0.201/src/global.json
dotnet publish --no-restore -warnaserror -p:PublishSingleFile=true --configuration:Release -r:linux-x64 --self-contained:true -p:PublishReadyToRun=False -p:PublishReadyToRunShowWarnings=True -p:PublishTrimmed=False -p:DisableSwagger=False -p:TreatWarningsAsErrors=True -p:Version=0.0.1.149-master -p:IncludeNativeLibrariesForSelfExtract=false -p:SolutionDir=..\\ --output ../publish
note that if you change the .net SDK version to 6.0.102 (as is in master) then the error can no longer be reproduced.
Expected behavior
Compiles with no AD0001 error (or a sane diagnostic to be output that can be fixed)
Actual behavior
Additional context
Example code that demonstrates the issue showing the one change needed to exhibit it:
credfeto/credfeto-notification-bot#10
The text was updated successfully, but these errors were encountered: