-
Notifications
You must be signed in to change notification settings - Fork 80
Handle custom MSBuild location #145
Comments
Pinging @AArnott since he knows more about this than I do. |
@jaredpar Which version of GitLink are you using? If the v2.x variety, where the command line tool may actually invoke MSBuild, that's obsolete anyway. If you use the v3.x beta that is now on chocolatey and nuget, the only MSBuild use in GitLink is when MSBuild invokes GitLink rather than the other way around, so I think we've already addressed this. |
GitLink has never invoked msbuild, but it did use the vs project system to load the projects (to retrieve the output directories + pdb files). Probably that's what you are seeing and I think the solution @AArnott is suggesting (use the upcoming 3.0.0 which is equal to PdbLink) is the best. |
Agree. That seems to be what is causing the problem here.
Is there a nice HOWTO consume this new version document we can take a look at? |
Not strictly true. The VS project system is not involved here as this is just an msbuild operation. When I say "invoked MSBuild" I didn't mean executed msbuild.exe, but it does call into MSBuild assemblies, which it must find in the GAC or other places.
Yes: I think this page has all the instructions you need. 😋 Just install the package and it works automatically on release configuration builds. Same as PdbGit in that sense. There is also a command line tool you'll find in the nuget package that you can pass an individual pdb to if you prefer that route. |
Likely prefer that route. We only ship a small subset of our entire solution and only add source server info on very specific builds. Thanks! |
I'm running into this as well when trying to add GitLink 3.0 to NetStandard 1.4 project. Getting:
A quick scan of my system shows that I do have the Microsoft.Build.Utilities.v4.0 installed, just probably not where LinkPdbToGitRemote is looking. Any suggestions on how to solve this? Thanks! |
@Roblinde are you seeing this when building within VS? at the command line with msbuild.exe, or dotnet build, or a combination? |
Just FYI, Application Insights also uses GitLink 2.2 and we ran into this same problem (MSBuild 4.0 doesn't resolve our .props). Had to workaround it in microsoft/ApplicationInsights-dotnet#496 |
The dotnet/roslyn repo, and other dotnet repos in general, can have MSBuild installed into a custom location. This happens as a part of bootstrapping / xcopy scenarios or simply as a part of taking a bug fix in a SxS installation of MSBuild in Dev15.
It doesn't seem that GitLink has a way of being asked to use these copies of MSBuild. Instead it seems to rely on the machine copy of MSBuild 4.0.
That seems like a good strategy in general but ends up breaking down in a couple of cases. The reason is that these custom deployments may bring along props / targets that aren't part of the machine state.
Consider for example the bootsrap case on a clean machine. A machine which never had any version of MSBuild installed via MSI. There will be no reference assemblies or portable target files. Hence
<Import>
declarations of the following nature will fail when using the 4.0 installation of MSBuildThis works using the custom deployment of MSBuild because
$(MSBuildExtensionPath32)
is set to the proper place in the deployment. The machine copy of MSBuild 4.0 though will useC:\Program Files(x86)\...
which has nothing to offer. Ends up leading to errors like the following when using GitLink.A number of tools are handling this by allowing the path to MSBuild to be specified as a command line option (NuGet.exe for instance). Would it be possible to get this added to GitLink as well?
The text was updated successfully, but these errors were encountered: