-
Notifications
You must be signed in to change notification settings - Fork 15
MSBuild target assumes correct dotnet is on the path #50
Comments
An alternative to running the user process is to use a cc @DamianEdwards \ @davidfowl since they were discussing this yesterday. |
@pranavkm here is that code. It's ~5 months old and I labeled it "WIP", so not sure how complete/functional it is. https://github.com/natemcmaster/EntityFramework/blob/6dc4b2b231d5b28472a683e3bdaabc6eba057ccf/src/Tools.DotNet/Internal/DependencyContextExtensions.cs |
@natemcmaster mentioned that this approach (as is our current one) doesn't work with ClassLibraries - blocked due to https://github.com/dotnet/cli/issues/2645. Linking it here so we can follow up on the blocking issue. |
Actually, if you are going to try the AssemblyLoadContext approach, the actual blocking bug is this: https://github.com/dotnet/core-setup/issues/635 |
For the 1.1.0-msbuild3 release, there's an <PropertyGroup>
<MvcRazorRunCommand Condition="!$(TargetFramework.StartsWith('netcoreapp'))">$(MSBuildThisFileDirectory)..\.dotnet\dotnet.exe</MvRazorRunCommand>
</PropertyGroup> The Similarly, the property can be used to run the precompilation tool using Mono for net451 on a non-Windows OS. <PropertyGroup>
<MvcRazorRunCommand Condition="'$(OS)'!='Windows_NT'">mono $(MvcRazorRunCommand)</MvRazorRunCommand>
</PropertyGroup> |
@Eilon: Should this be considered for preview2? Does this bug mean the CLI zip installer cannot be used with MVC apps? If so, this seems like a major issue. |
Or add the issue and workaround to a readme or similar docs for Preview2. |
@mikeharder we've had this issue since the 1.0.0 of the tool, so I'm not entirely sure it would warrant requiring a preview2 fix. The msbuild task assumes |
Using MSBuild's muxer if available as part of fe4cc97. We can look running the tool in-proc if we get further issues about this. |
Currently the MSBuild target assumes that the correct dotnet is on the path here. This is not a safe assumption in general, as VS uses a different install of dotnet than the commandline and a couple other instances of weirdness. We should get some more detailed logic in there about finding the correct version.
The text was updated successfully, but these errors were encountered: