Skip to content

Conversation

@brettfo
Copy link
Member

@brettfo brettfo commented Mar 15, 2018

There were two issues with building in Visual Studio:

  1. Converting the portable PDB to a Windows-style PDB was failing because the command-line build explicitly sets the %NUGET_PACKAGES% environment variable to <repo-root>\packages, but that variable wasn't set when VisualFSharp.sln was open in VS so it was falling back to the common location of %USERPROFILE%\.nuget\packages which doesn't work. The fix for that is to set the fallback to <repo-root>\packages.
  2. The property pages project explicitly sets its $(OutputPath) variable which means the HACK_CopyOutputsToTheProperLocation target was being unnecessarily run which was resulting in incorrect PDBs and locked files.

<GeneratePkgDefFile>true</GeneratePkgDefFile>
<IncludePkgdefInVSIXContainer>true</IncludePkgdefInVSIXContainer>
<UsePackageTargetFallbackHack>true</UsePackageTargetFallbackHack>
<DisableOutputPathCopying>true</DisableOutputPathCopying>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might need this on a few more projects

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At this point we shouldn't. The only projects picking up the path copying hack from FSharp.Directory.Build.targets are projects converted to the SDK where the copy hack is necessary, and this property pages project. All other projects in our repo directly write outputs to release\net40\bin, but because we ultimately depend on $(TargetFramework) from SDK projects to determine release\net40\bin vs. release\coreclr\bin, we have to copy files after the build has completed.

tl;dr - This is the only project file that can properly set $(OutputPath) and that pulls in FSharp.Directory.Build.targets which defaults to the copy hack.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, understood, thanks. I thought it was about the Copy File conflicts.

@brettfo brettfo merged commit d7653dd into dotnet:master Mar 15, 2018
@brettfo brettfo deleted the build-in-vs branch March 15, 2018 23:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants