因此,我想为基于.NET Core 3的C#项目创建安装程序。我安装了Visual Studio 2019的Installer Projects扩展,并在解决方案中创建了一个新的Installer项目。在尝试了不同的设置之后,最终我将两个可执行文件的PublishItemsOutputGroup添加到了Application Folder中。这(向重复的dll抛出各种警告)会创建一个不错的安装程序包,其中“应该”包含所有必需的dll(.net库很多)。但是,在目标计算机上执行已安装的exe文件之一后,我得到:
It was not possible to find any compatible framework version
The specified framework 'Microsoft.NETCore.App', version '3.0.0' was not found.
- Check application dependencies and target a framework version installed at:
C:\Program Files\dotnet
- Installing .NET Core prerequisites might help resolve this problem:
https://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409
- The .NET Core framework and SDK can be installed from:
https://aka.ms/dotnet-download
- The following versions are installed:
2.2.7 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
[我知道,发布.exe文件时我可以创建一个巨大的自包含.exe,但是,这对我来说似乎很浪费-创建两个包含几乎相同的.dll的巨大.exe文件。
是否也无法在安装程序项目中包含.NET Core 3安装程序?我在互联网上找不到关于该主题的任何信息...
我发现这也有同样的问题,但是最终发现,如果您在安装程序项目中设置了publishProfilePath设置,它将包含所有文件并且可以正常工作。