Quantcast
Channel: WE MOVED to github.com/nuget. This site is not monitored!
Viewing all articles
Browse latest Browse all 7612

Commented Issue: Nuget Update -Repository breaks csproj hintpath [2783]

$
0
0
nuget update "C:\work\MyProject\Src\ClassLibrary1\packages.config" -RepositoryPath "C:\work\MyProject\Feed" -Verbose

my Feed folder has nothing but a bunch of nupkg files, and the one of interest is a newer version of nuget.core. i.e. Nuget.Core.2.1.0.nupkg

The above call does indeed update the packages.config file to the latest version
In my case I am going to expect that nuget.core is going from version 2.0.1 to version 2.1.0.
original:
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NuGet.Core" version="2.0.1" targetFramework="net45" />
</packages>

After update
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Nuget.Core" version="2.1.0" targetFramework="net45" />
</packages>

OK so all this seems fine.
Until I looked into my csproj file.

csProj snipet:
Original

<ItemGroup>
<Reference Include="NuGet.Core, Version=2.0.30619.9119, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\NuGet.Core.2.0.1\lib\net40-Client\NuGet.Core.dll</HintPath>
</Reference>

After update
<Reference Include="NuGet.Core">
<HintPath>..\..\Feed\Nuget.Core.2.1.0\lib\net40-Client\NuGet.Core.dll</HintPath>
</Reference>


It gets worse, since the Feed folder is nothing but nupkg files, it can't find the dll, so instead it gets it from the GAC.
my project now references nuget.fore from here.
C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v2.0\Assemblies\NuGet.Core.dll
This is the 1.6.30117.9648 version.


I would have expected that my csProj reference should have looked like this, where nuget update would have correctly got the strong name and HintPath right.
<ItemGroup>
<Reference Include="NuGet.Core, Version=2.1.31002.9028, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\NuGet.Core.2.1.0\lib\net40-Client\NuGet.Core.dll</HintPath>
</Reference>

I have exhausted my google search time to see if I was doing something wrong. At this point it looks like a defect.

Thanks

Comments: OK, User error, I should have used Source instead of RepositoryPath as stated in the docs. nuget update "C:\work\MyProject\Src\ClassLibrary1\packages.config" -Source "C:\work\MyProject\Feed" -Verbose This works, but not to be deterred from complaining. The original one should have failed straight out. It made me think that it was working ;) So I would like to change my defect to the following; Make Nuget update fail when I pass in a RepositoryPath that doesn't have any unpackaged packages in it.

Viewing all articles
Browse latest Browse all 7612

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>