![](/img/trans.png)
[英]Error while installing Microsoft.net and NuGet latest version from visual studio
[英]How to force Visual Studio to check for latest version of floating point nuget dependencies
我正在為我的其他項目使用浮點依賴項,如下所示:
<PackageReference Include="Farayan.NETCommonSuper" Version="1.0.*" />
版本1.0.*
表示以 1.0 開頭的最新版本的Farayan.NETCommonSuper
1.0.
,但 Visual Studio 不會檢查每個版本的最新版本。
想象一下我更新了模塊Farayan.NETCommonSuper
,我需要將它反映到我的另一個模塊中(讓我們將其命名為depend module
),目前我需要打開Manage nuget packages
上下文菜單,並自己更新依賴關系,刪除 * 版本並修復它.csproj 文件,然后打開該.csproj 文件以將其還原。
是否有任何設置或配置或腳本強制 vs 檢查最新版本的星版依賴項?
右鍵單擊解決方案資源管理器中的解決方案,然后 select "Restore NuGet Packages"
dotnet restore --force-evaluate
msbuild -t:restore -p:RestoreForceEvaluate=true
nuget.exe restore -ForceEvaluate
我同意zivkan 。 但是,VS IDE 會自動檢測浮動版本的 nuget 依賴項。
添加更多細節
版本 1.0.* 表示以 1.0. 開頭的最新版本的 Farayan.NETCommonSuper,但 Visual Studio 不會在每個構建中檢查最新版本。
請如果您啟用了工具下的兩個選項 - >選項
另外,您可以嘗試這樣做來制作一個自動腳本:
在解決方案資源管理器上右鍵單擊您的項目-->屬性-->構建事件-->
在Pre-build event 命令行下添加這樣的:
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe" -t:restore -p:RestoreForceEvaluate=true
單擊構建按鈕,您可以獲得您想要的。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.