Repository navigation
2.0: MSBuildSdkResolver: resolve symlink for 'dotnet' binary - #7137
Conversation
On Linux the dotnet installed by the dotnet packages is a symlink (/usr/bin/dotnet -> ../share/dotnet/dotnet). We need to resolve the symlink so we're passing the path to the actual .NET Core installation to libhostfxr. Fixes https://github.com/dotnet/cli/issues/7125
|
@akoeplinger, |
|
@akoeplinger if you need this considered for 2.0, can you please fill out the ASK MODE template like here: #7129? |
|
@livarcocc updated. My main motivation for this is getting a build of the assembly from the myget packages (but we can just build it ourselves as well without too much work). Should be easy given that it has no impact on the binaries you're shipping on Windows/msbuild :) |
|
@srivatsn for approval. |
|
cc @nguerrera |
|
@akoeplinger Can you point me to the resolver package you're using? AFAIK, we don't actually package up the portable version and push it anywhere. Maybe I missed some build magic that did this automagically, but I'm not finding any such package in our myget feed. It's been on the backlog to get done as @DustinCampbell needs it for VS code too (or perhaps it would flow there via mono msbuild automaticaIly?) I'll be happily surprised if it's already done, but I'm missing how that's the case. |
|
I don't think it's there as part of the Mono MSBuild that we provide in C# for VS Code. |
|
@nguerrera I talked to our msbuild dev about it and looks like I misunderstood a bit: we took the libhostfxr.dylib from a myget package but actually built the netstandard version of Microsoft.DotNet.MSBuildSdkResolver.dll ourselves :) |
|
@akoeplinger @DustinCampbell And the mono msbuild that has this custom build is different from the one that C# VS Code uses? |
|
Yes. We don't acquire MSBuild from Mono. On OSX/Linux, we build it ourselves. Besides, this wouldn't help C# for VS Code on Windows. |
|
Got it. OK, we should just pack the project and push it. It shouldn't be too hard. |
|
#7151 |
|
BTW, this is a very nice fix. I may pull it into OmniSharp for resolving symlinks. |
Backport of #7126 to release/2.0.0.
ASK MODE template:
Customer scenario
msbuild shipped with Mono 5.2 won't pick up msbuild sdks from .NET Core on Linux before this fix since the sdkresolver doesn't correctly find the .NET Core installation directory.
Bugs this fixes
#7125
Workarounds, if any
Set DOTNET_MSBUILD_SDK_RESOLVER_CLI_DIR env var to
/usr/share/dotnetRisk
Zero, since you're not using the netstandard binary of the sdkresolver in Windows/msbuild but the NET46 version.
Performance impact
Low
Root cause analysis
We removed "run as user" during install process. However, native installer other than Windows are using the old prime cache command which will create templatecache folder as super user and caused the permission denied
How was the bug found?
Xamarin testing