Closed bernd5 closed 7 months ago
I understand that the latest previews for .NET 6 require an opt-in in the project file (certainly for preview 7), so you would need to add:
<ImplicitUsings>enable</ImplicitUsings>
that said, it should still work, as it shells out to msbuild. So if it works for you with your current SDK, buildalyzer should pick that up and get you some results that match what you are seeing in your IDE / command line.
Update: wrong - It's rc1 that will require the opt-in
In the new templates these implicit usings are enabled by default. I created a test pr with a helloWorld sample without touching the csproj file. The test fails currently.
I've ran the test locally here, and it fails due to a weird error, which is the same error I see on all my projects (whatever TFM):
Could not copy the file apphost.exe
I'm not sure why, but when the .NET 6 SDK is present (i.e. installed and not suppressed by a global.json
file) then the error crops up.
I can work around like this:
System.Environment.SetEnvironmentVariable("UseAppHost", "false");
When I add that to the tests, your TestUsing
project compiles successfully.
cc @daveaglick
Potential fix: https://github.com/daveaglick/Buildalyzer/pull/187
Merge of solution accomplished
Hello,
with net 6.0 we get generated code by default (implicit global usings). I would like to load those generated files with Buildalyzer, too.
What should I do?