-
Notifications
You must be signed in to change notification settings - Fork 325
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
.NET 5.0 RC1 - "dotnet build" succeeds to build but "dotnet test" fails to build the same exact SLN #2570
Comments
@Pedramrezaei could you show us the error please? 🙂 |
@nohwnd, here is an example:
|
@nohwnd I'm facing the same issue with w4k-aspnetcore-correlator, however when I specify @Pedramrezaei what if you try adding |
@wdolek looking at the error in your pipeline you have net5.0 installed but you don't have the runtime for netcoreapp3.1 which is the target framework of your test projects. This means that you can build the project just fine, because SDK can be used to build any TFM (target framework). BUT then when you try to run it, the test host will try to start using the appropriate runtime (netcoreapp3.1) and will fail to resolve it. You can either:
|
@Pedramrezaei what if you do |
@wdolek Can repro on your master. I collected some binary logs. It looks like it takes different paths if we provide the TargetFramework and when we don't provide it. When we provided it uses the new core build target. And the old one is missing a reference when calling compiler (csc). @rainersigwald Would you mind having a quick look on this one, please. Looks like when the build itself has to figure out it is a dotnet core it misses some references and does not succeed, do you see why that would be and if we can change something in the vstest task to fix this? See the different paths to the build in the bottom. The left one is triggered when we just call Took the command line to csc from working and failing build, replaced whitespace ( binlogs for the failing and working build, and normal dotnet build attached. Plus the CSC. |
I'll look into this later |
actually is it possible to have a minimal repro? The missing reference seems very specific to this project. And there is a fair amount of custom build. |
I think I ran into the same problem and was already setting up a repro for it before I found this issue. Some observations I made that might be helpful:
|
Fixes microsoft/vstest#2570 by moving _ComputeTargetFrameworkItems outside the CallTargets used inside the VSTest target. This means that @(_InnerBuildProjects) is available in all CallTarget scopes.
Fixes microsoft/vstest#2570 by moving _ComputeTargetFrameworkItems outside the CallTargets used inside the VSTest target. This means that @(_InnerBuildProjects) is available in all CallTarget scopes.
This will be fixed in the GA release of .NET SDK 5.0.1xx. So we can close this issue. |
Thanks! Especially @rainersigwald 👏👏👏 |
I managed to make this not work with the .NET 6 Preview 3 SDK in Github Actions with |
Issue moved from dotnet/sdk#13584
From @Pedramrezaei on Monday, September 14, 2020 8:23:06 PM
Repro:
1- Clone this repo: https://github.com/cloudtoid/interprocess
2- Run
dotnet build src/Interprocess.sln
and it succeeds.3- Run
dotnet test src/Interprocess.sln
and it fails to build.The text was updated successfully, but these errors were encountered: