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

error SL01: SponsorLink has been incorrectly configured #210

Closed
CheloXL opened this issue Mar 4, 2023 · 4 comments · Fixed by #212
Closed

error SL01: SponsorLink has been incorrectly configured #210

CheloXL opened this issue Mar 4, 2023 · 4 comments · Fixed by #212

Comments

@CheloXL
Copy link

CheloXL commented Mar 4, 2023

I installed ThisAssembly.AssemblyInfo onto one of my projects library, then I simply referencing ThisAssembly.Info.FileVersion here and there to get the .dll file version.

Now, the solution doesn't compile. It throws CSC : error SL01: SponsorLink has been incorrectly configured. Please check the documentation for more information.. I'm not even sure what that means, as a google search returns nothing. If I uninstall ThisAssembly, everything goes back to normal.

Any ideas?

@CheloXL CheloXL added the bug Something isn't working label Mar 4, 2023
@kzu
Copy link
Member

kzu commented Mar 7, 2023

Seems like an incomplete nuget restore. Closing/reopening the solution should fix, could you try that?

(potentially same -fluke?- a shttps://github.com/devlooped/nugetizer/issues/340)

@kzu kzu added need info and removed bug Something isn't working labels Mar 7, 2023
@CheloXL
Copy link
Author

CheloXL commented Mar 7, 2023

That was my first though and I even did a dotnet restore soluction.sln --force. It doesn't work.
What I see is that the error is reported on projects that are using ThisAssembly through a project reference. So, basically, I have project A that have the package installed, and project B references project A and uses ThisAssembly. The error is reported on project B.
I want to do so because I'm interested in the information of project A to be shown on project B (A is the business project, B is a webapp that uses/exposes the business).

@kzu
Copy link
Member

kzu commented Mar 10, 2023

Awesome description to come up with a repro. Thanks for elaborating! Will take a closer look with that in mind...

@kzu
Copy link
Member

kzu commented Mar 10, 2023

Ok, there are two unrelated but relevant issues. First: if you add PrivateAssets=all the the package reference to ThisAssembly, the error should go away in the transitive protect. The other issue is SponsorLink related due to the non-transitive build targets.

Thanks a lot for the report! Will ship a fix ASAP

kzu added a commit that referenced this issue Mar 10, 2023
Since we typically generate code that's intended for consumption within the project itself, we shouldn't cause other projects referencing the consuming project to also get ThisAssembly stuff.

Fixes #210
@kzu kzu closed this as completed in #212 Mar 10, 2023
kzu added a commit that referenced this issue Mar 10, 2023
Since we typically generate code that's intended for consumption within the project itself, we shouldn't cause other projects referencing the consuming project to also get ThisAssembly stuff.

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

Successfully merging a pull request may close this issue.

2 participants