我正在创建 .yml ,该自动在github操作中构建.NET框架应用程序。
因此,我尝试通过powershell内部的msbuild.exe构建.NET Framework 4.7.2应用程序。
像这样:
PS : & "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe" /t:myProject /p:Configuration=Release
但是,您可以看到以下错误,并且无法下载软件包。
错误:此项目参考Nuget软件包丢失了
这台计算机。使用Nuget软件包还原下载它们。更多
信息,请参阅 http://go.microsoft.com/fosrosoft.com/fwlink/?linkid = 3222105 。这
缺少文件是
..\packages\MaterialDesignThemes.4.5.0\build\MaterialDesignThemes.targets.
如何通过msbuild.exe下载我需要从powershell构建的软件包?
(由于.NET框架而无法使用Dotnet CLI。)
谢谢!
++
Visual Studio正常建造。我想要的是一个为CI/CD管道自动构建的脚本。
I'm creating .yml that automatically builds .NET Framework applications in GitHub Action.
So, I try to build .NET Framework 4.7.2 Application via Msbuild.exe inside Powershell.
like this:
PS : & "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe" /t:myProject /p:Configuration=Release
However, you can see the following errors, and you cannot download the packages.
error : This project references NuGet package(s) that are missing on
this computer. Use NuGet Package Restore to download them. For more
information, see http://go.microsoft.com/fwlink/?LinkID=322105. The
missing file is
..\packages\MaterialDesignThemes.4.5.0\build\MaterialDesignThemes.targets.
How can I download the package that I need to build from Powershell through msbuild.exe?
(The dotnet CLI is not available because of the .NET Framework.)
Thanks!
++
Visual Studio builds normally. What I want is a script that is built automatically for the CI/CD pipeline.
发布评论
评论(2)
我找到了一个解决方案。
我可以使用Nuget CLI代替Dotnet CLI。
解决方案:
ps:nuget Restore
I found a solution.
I can use the nuget CLI instead of the dotnet CLI.
Solution :
PS : nuget restore
https:https:// hearn。 microsoft.com/en-us/nuget/consume-packages/package-restore#restore-usis-usis-us-visual-studio 这是所有的方式。
如果没有任何帮助,您可以尝试使用以下方式手动安装软件包:
https://learn.microsoft.com/en-us/nuget/consume-packages/package-restore#restore-using-visual-studio here are all the ways.
If nothing helps you can try installing the packages manually using: