Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSC : error SL01: SponsorLink has been incorrectly configured #251

Closed
sandrock opened this issue Feb 22, 2023 · 5 comments
Closed

CSC : error SL01: SponsorLink has been incorrectly configured #251

sandrock opened this issue Feb 22, 2023 · 5 comments
Labels

Comments

@sandrock
Copy link

sandrock commented Feb 22, 2023

Describe the Bug

After adding the nuget to a class library, build fails with error:

CSC : error SL01: SponsorLink has been incorrectly configured. Please check the documentation for more information.

I also get a warning from my firewall telling me dotnet.exe tries to make an external HTTPS call.

Expected Behavior

  • Build should pass right after installing the nuget
  • if extra steps are required: readme should indicate extra configuration steps
  • the error message should contain a link to a documentation OR the error message should be referenced in search engines (now it will be :))

Version Info

GitInfo 3.0.4 (Devlooped.SponsorLink 0.9.7, ThisAssembly.Constants 1.2.9, thisassembly.prerequisites 1.2.9)

target framework: net40+netstandard2.0

using: Windows 10, JetBrains Rider 2022.3.2

Additional Info

related code in my project: branch, commit

partial build log:

Logging verbosity is set to: Normal.
1>Project "C:...\ini-parser-dotnet\src\IniFileParser\IniFileParser.csproj" on node 1 (build target(s)).
1>_GitClearCache:
Deleting file "obj\Release\net40\GitInfo.cache".
_GitRepositoryUrl:
git config --get remote.origin.url
1:2>Project "C:...\ini-parser-dotnet\src\IniFileParser\IniFileParser.csproj" on node 2 (build target(s)).
1>_GitClearCache:
Deleting file "obj\Release\netstandard2.0\GitInfo.cache".
_GitRepositoryUrl:
git config --get remote.origin.url
1>GenerateTargetFrameworkMonikerAttribute:
Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input files.
CoreCompile:
C:\Program Files\dotnet\dotnet.exe exec "C:\Program Files\dotnet\sdk\7.0.102\Roslyn\bincore\csc.dll" /noconfig /unsafe- /checked- /nowarn:1701,1702,0618,1591,1573,IL2121,1701,1702 /fullpaths /nostdlib+ /errorreport:prompt /warn:4 /doc:obj\Release\net40\IniParser.xml /define:TRACE;RELEASE;NETFRAMEWORK;NET40;NET20_OR_GREATER;NET30_OR_GREATER;NET35_OR_GREATER;NET40_OR_GREATER /highentropyva- /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\mscorlib.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\System.Core.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\System.Data.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\System.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\System.Drawing.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\System.Numerics.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\System.Runtime.Serialization.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\System.Xml.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\System.Xml.Linq.dll" /debug- /debug:portable /filealign:512 /keyfile:Properties\publickey.snk /optimize+ /out:obj\Release\net40\IniParser.dll /target:library /warnaserror+ /utf8output /deterministic+ /langversion:7.3 /analyzerconfig:obj\Release\net40\IniFileParser.GeneratedMSBuildEditorConfig.editorconfig /analyzer:C:\Users....nuget\packages\gitinfo\3.0.4\analyzers\dotnet\GitInfo.CodeAnalysis.dll Configuration\Dummy.cs Exceptions\Dummy.cs Exceptions\ParsingException.cs FileIniParser.cs Helpers\Assert.cs Model\Configuration\ConcatenateDuplicatedKeysIniParserConfiguration.cs Model\Configuration\IniParserConfiguration.cs Model\Formatting\DefaultIniDataFormatter.cs Model\Formatting\IIniDataFormatter.cs Model\IniData.cs Model\IniDataCaseInsensitive.cs Model\KeyData.cs Model\KeyDataCollection.cs Model\SectionData.cs Model\SectionDataCollection.cs Parser\ConcatenateDuplicatedKeysIniDataParser.cs Parser\IniDataParser.cs Properties\AssemblyInfo.cs StreamIniDataParser.cs StringIniParser.cs "obj\Release\net40.NETFramework,Version=v4.0.AssemblyAttributes.cs" obj\Release\net40\IniFileParser.AssemblyInfo.cs /warnaserror+:NU1605
1>CSC : error CS8032: An instance of analyzer GitInfo.SponsorLinker cannot be created from C:\Users....nuget\packages\gitinfo\3.0.4\analyzers\dotnet\GitInfo.CodeAnalysis.dll : Could not load file or assembly 'Devlooped.SponsorLink, Version=0.9.7.0, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified..
CompilerServer: server - server processed compilation - fe90c2b1-8a81-4121-bf8e-7af15449e5b2
1>Done Building Project "C:...\ini-parser-dotnet\src\IniFileParser\IniFileParser.csproj" (build target(s)) -- FAILED.
1>GenerateTargetFrameworkMonikerAttribute:
Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input files.
CoreCompile:
C:\Program Files\dotnet\dotnet.exe exec "C:\Program Files\dotnet\sdk\7.0.102\Roslyn\bincore\csc.dll" /noconfig /unsafe- /checked- [...] /analyzer:C:\Users....nuget\packages\devlooped.sponsorlink\0.9.7\analyzers\dotnet\roslyn4.0\Devlooped.SponsorLink.dll /analyzer:C:\Users....nuget\packages\devlooped [...] /additionalfile:C:\Users....nuget\packages\devlooped.sponsorlink\0.9.7\analyzers\dotnet\roslyn4.0\Devlooped.SponsorLink.dll /additionalfile:C:\Users....nuget\packages\devlooped.sponsorlink\0.9.7\analyzers\dotnet\roslyn4.0\System.Net.Http.WinHttpHandler.dll /additionalfile:C:\Users....nuget\packages\gitinfo\3.0.4\analyzers\dotnet\GitInfo.CodeAnalysis.dll /additionalfile:C:\Users....nuget\packages\thisassembly.constants\1.2.9\analyzers\dotnet\roslyn4.0\cs\ThisAssembly.Constants.dll [...]
CompilerServer: server - server processed compilation - 66c951c3-6dc5-4623-ae96-b3eace4e6009
SponsorLinkMessages:
Skipping target "SponsorLinkMessages" because it has no inputs.
GenerateBuildDependencyFile:
Skipping target "GenerateBuildDependencyFile" because all output files are up-to-date with respect to the input files.
CopyFilesToOutputDirectory:
Copying file from "C:...\ini-parser-dotnet\src\IniFileParser\obj\Release\netstandard2.0\IniParser.dll" to "C:...\ini-parser-dotnet\src\IniFileParser\bin\Release\netstandard2.0\IniParser.dll".
IniFileParser -> C:...\ini-parser-dotnet\src\IniFileParser\bin\Release\netstandard2.0\IniParser.dll
Copying file from "C:...\ini-parser-dotnet\src\IniFileParser\obj\Release\netstandard2.0\IniParser.pdb" to "C:...\ini-parser-dotnet\src\IniFileParser\bin\Release\netstandard2.0\IniParser.pdb".
Copying file from "C:...\ini-parser-dotnet\src\IniFileParser\obj\Release\netstandard2.0\IniParser.xml" to "C:...\ini-parser-dotnet\src\IniFileParser\bin\Release\netstandard2.0\IniParser.xml".
1>Done Building Project "C:...\ini-parser-dotnet\src\IniFileParser\IniFileParser.csproj" (build target(s)).
[...]
1>Done Building Project "C:...\ini-parser-dotnet\src\IniFileParser\IniFileParser.csproj" (Pack target(s)).
Build FAILED.

@sandrock sandrock added the bug label Feb 22, 2023
@devlooped-bot devlooped-bot added the sponsor 💜 Sponsor label Feb 22, 2023
@kzu
Copy link
Member

kzu commented Mar 7, 2023

Hi @sandrock! Thanks for reporting this and sorry it took a bit to reply.

It seems JetBrains Rider is not respecting the diagnostic's LinkUrl which IS provided in the diagnostic descriptor I define and expose via the analyzer. I'll look into that and see if I can determine why that's the case.

I'll update the dependency so it does not end up reporting as an error something that is most likely transitory (did you try closing/reopening the solution? sometimes there's a lag between MSBuild targets being imported in the project and the analyzer running).

Thanks for being a sponsor, and I'd totally like to get your feedback on SponsorLink, once I can help you get passed this error. The HTTPS call is expected and by design of SponsorLink, it's what I hope will allow proper attribution of sponsors to package usage.

I'm starting to think there should be a standard included markdown/text when you install/upgrade a package that explains this, as you mentioned... Fortunately, a web search for SponsorLink gets you to the feature introduction blog post on the first page for Google and DuckDuckGo, and second on Bing.

@sandrock
Copy link
Author

Hi @kzu,

[...] as an error something that is most likely transitory (did you try closing/reopening the solution? sometimes there's a lag between MSBuild targets being imported in the project and the analyzer running).

Oh! The error was transitory. It builds fine now.

The HTTPS call is expected and by design of SponsorLink,
I'd totally like to get your feedback on SponsorLink, once I can help you get passed this error

I was trying to use GitInfo. Dependency magic made me stumble on the issue.

I did not know about SponsorLink and just read the article. The idea is quite singular. I might look further into in the future.

@kzu
Copy link
Member

kzu commented Mar 10, 2023

Great news that it now works as expected. I did find an issue with transitiveness and build targets which I'm fixing in the next build.

Yeah, I'm trying SponsorLink to see if I can nudge more users to be as generous as you are sponsoring my projects. Fingers crossed!

@kzu
Copy link
Member

kzu commented Mar 22, 2023

Ok, got a new version out that should have done away with all these issues! Could you give it a try please? Thanks!!

@kzu kzu closed this as completed Mar 22, 2023
@sandrock
Copy link
Author

It works with 3.0.6

@devlooped devlooped locked and limited conversation to collaborators Sep 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants