-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
UWP App Compiler Errors in x64 Release mode but not Debug mode. #67187
Comments
This is by design. For instance, that error about not supporting a parameterless struct constructor is because those were added in C# 10, but .NET Native only officially supports up to C# 7.3. Anything beyond that might or might not work, but parameterless struct constructors are an example of something that does not. Same for that other error you got, that's also something that's just not supported and will not be. The question is, why do you want to add |
To be clear, it was not my goal to include the analyzers. The issue was that Visual Studio, by default, attempts to include them, and then they fail to compile in .NET Native. As I noted, if the requirement is that they be excluded from release mode (and I agree they should be), then either Visual Studio should not include them in release mode, or clear instructions on the need, and how, to exclude them should be clearly documented. I spent several days scouring the internet and much trial and error on how to handle before I figured it out. Perhaps this is really a VS issue, but I contacted the VS team and they declined to address and pointed to you folks. |
Your project snippet shows that you're referencing the Microsoft.CodeAnalysis.VisualBasic package, not Microsoft.CodeAnalysis.Analyzers. I think that's where the difference lies. You shouldn't reference Microsoft.CodeAnalysis.VisualBasic unless you want to analyze or compile VB code at runtime in your application. |
A couple of things:
The point is, if you reference either package, (as far as I can tell) you cannot compile in .NET Native unless you add the exclude code to the project file. Again, I think that is OK, but someone should clearly document that. Took me days to figure out. |
Version Used:
Microsoft.CodeAnalysis.Analyzers v3.3.3
Steps to Reproduce:
A case was created with the Visual Studio Team here (note, with x64, not x86 as I originally wrote).
After much back and forth and me providing them a sample project that exhibited the errors, they decided it was not their problem:
Diagnostic Id:
Received many errors such as:
And warnings such as:
Expected Behavior:
I expect it to compile correctly.
Actual Behavior:
Did not compile correctly.
Note that I was able to fix this by adding an ExcludeAssets directive to the .vbproj folder as such:
<PackageReference Include="Microsoft.CodeAnalysis.VisualBasic">
<Version>4.5.0</Version>
<ExcludeAssets>All</ExcludeAssets>
<IncludeAssets>none</IncludeAssets>
</PackageReference>
If nothing else, some clear instructions to do this would have been helpful. Took two weeks to troubleshoot via the internet, MS docs, and Stack Overflow. But I expect that it should have worked without doing this.
The text was updated successfully, but these errors were encountered: