我已经在Visual Studio中构建了一个dotnet-core 2.1控制台应用程序。 它使用nuget程序包CommandLine和EFCore。
它使用
作为独立文件包发布dotnet publish -c Release -r win7-x86
输出是一个包含70MB文件的文件夹,其中.exe文件。
现在我在2台不同的Windows 7计算机上遇到2种错误。
Error:
An assembly specified in the application dependencies manifest (MyApp.deps.json) was not found:
package: 'CommandLineParser', version '2.3.0'
path: 'lib/netstandard1.5/CommandLine.dll'
有什么方法可以正式描述Windows上的要求以确保我的应用程序可以运行?
如果NuGet软件包依赖项存在问题,可以在构建/发布过程中捕获该问题吗?
我当前的解决方法是将整个应用重新打包为.NET 4.6.1应用,在安装.NET 4.6.1之后,我的应用没有问题。尽管以dotnet为核心的已发布应用仍然失败。
答案 0 :(得分:0)
通过@omajid的评论找到了解决方案。
我的错误:我压缩了文件夹bin/Release/netcoreapp2.1/win7-x86
,并在该文件夹中运行MyApp.exe。
该解决方案就像在子文件夹publish
中运行MyApp.exe一样简单