Weingartner / FixNuGetPackagePaths

Visual Studio extension (.vsix) to make sure that paths to NuGet packages are relative to the directory of the current solution.
MIT License
3 stars 4 forks source link

Update to VS 2017 #4

Closed Rowandish closed 7 years ago

Rowandish commented 7 years ago

Hi Johannes,

I update your solution in order to work with new VS 2017 (following this tutorial).

Actually I don't know if this could work also on old VS version. Any improvments suggested?

johannesegger commented 7 years ago

Thanks a lot.

Just out of curiosity: Why did you switch to .NET 4.6.2, was it necessary? Could you please run Update-Package -Reinstall -Project FixNuGetPackagePaths from the package manager console. This is advisable after switching .NET Framework versions. It updates the packages.config to use the correct TFM and also updates csproj references if necessary.

I don't care too much about old VS versions, so that's fine.

Rowandish commented 7 years ago

I switch to .NET 4.6.2 in order to use the last references version (VisualStudio Imaging, Shell, Shell.Framework, Shell.Immutable, Utilities); their version 15.0.0 target .NET 4.6.

Thanks for the suggestion Update-Package -Reinstall -Project FixNuGetPackagePaths, I add the commit.

johannesegger commented 7 years ago

I just realized that I can't merge your PR because I don't have write access to this repository any more (the company I previously worked for owns it). @bradphelan please review this, LGTM.

bradphelan commented 7 years ago

@johannesegger You do now ;) Welcome back

johannesegger commented 7 years ago

@bradphelan so you mean I now work for Weingartner without getting paid? Not sure this is what I wanted ;-)

bradphelan commented 7 years ago

I can't load the project anymore.

C:\Users\phelan\workspace\FixNuGetPackagePaths\FixNuGetPackagePaths\FixNuGetPackagePaths.csproj : error : The imported project "C:\Users\phelan\workspace\FixNuGetPackagePaths\packages\Microsoft.VSSDK.BuildTools.15.0.26201\tools\VSSDK\Microsoft.VsSDK.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk. C:\Users\phelan\workspace\FixNuGetPackagePaths\FixNuGetPackagePaths\FixNuGetPackagePaths.csproj

The offending line in the csproj file is

<Import Project="$(SolutionDir)packages\Microsoft.VSSDK.BuildTools.15.0.26201\build\Microsoft.VSSDK.BuildTools.props" Condition="Exists('$(SolutionDir)packages\Microsoft.VSSDK.BuildTools.15.0.26201\build\Microsoft.VSSDK.BuildTools.props')" />

You have to go to the pack manager console and type

nuget restore

For the project to load. I'm not sure it should be this way.

johannesegger commented 7 years ago

I also had this problem, but I thought it was the same before. Thanks anyway.

bradphelan commented 7 years ago

Ok.