Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

dotnet restore with update in the new csproj/msbuild-based projects?

How do I actually update the new csproj-based project's Nuget packages to the latest ones when using Visual Studio Code?

This is what I have within the .csproj file:

<PackageReference Include="Microsoft.AspNetCore" Version="1.0.3" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.0.2" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="1.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="1.0.1" />
<PackageReference Include="Microsoft.VisualStudio.Web.BrowserLink" Version="1.0.0" />

If I do dotnet restore it will only install the specified package versions.

There is no dotnet restore update or dotnet nuget update option available.

All of the above referenced Microsoft.AspNetCore.* packages have newer versions (1.1.0).

I would like to update the packages and have the references updated automatically in the same way we do this in Visual Studio.

like image 823
mare Avatar asked Oct 17 '22 18:10

mare


1 Answers

Currently, VS Code does not have a built-in Nuget Manager tool. The only possible way is to edit .csproj file manually and update versions.

If regarding VS Code extensions, there is a Net Core Project Manager extension, that works pretty well.

like image 175
Set Avatar answered Oct 30 '22 19:10

Set