-
Notifications
You must be signed in to change notification settings - Fork 87
-
Notifications
You must be signed in to change notification settings - Fork 87
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
Project using CsWin32 doesn't compile using msbuild because System.Memory is missing #875
Comments
Some history is in #836. What version of VS is installed on your agent? |
Hey, I work at the same company. We use VS Pro 17.2.6 on our agents. |
Could you look for this file: "C:\Program Files\Microsoft Visual Studio\2022\MSBuild\Current\Bin\Roslyn\System.Memory.dll" and tell me what the assembly version is? (the path may need slight adjustment for your machine). |
Ok, great. That 4.0.1.1 version is what I needed, and explains why the source generator fails on your machines. Upgrading VS would resolve the issue for you. I don't know if that's an option. |
Thanks a lot for looking into it, that's great news! I will also check if we can just upgrade our CI to the latest VS version, shouldn't be too much of an issue. |
Actual behavior
I'm trying to use CsWin32 source generators in our projects. It works when compiling in VisualStudio and works on our CI running "dotnet build", but doesn't run on our CI running "msbuild".
Expected behavior
Compiling with "msbuild" does work.
Repro steps
I'm using Azure DevOps Server 2020 Update 1.1 with this step in a yaml pipeline, not sure what exactly happens in the background.
However, the build log indicates it's "msbuild MySolution.sln" with a bunch of extra options in the end that are probably just relevant for the CI.
My own analysis
It looks like this an a general shortcoming of source generators, which must provide all their transitive dependencies. I have found this similar issue: dotnet/roslyn#52017
Probably the CsWin32 nuget package needs to have all it's transitive dependencies in the analyzers/cs folder.
Maybe this is a duplicate of #560, but I'm not entirely sure.
Context
LangVersion
: 9.0The text was updated successfully, but these errors were encountered: