1 year ago
#289422
mijkolsmith
FormatUrl Error publishing in Visual Studio Forms
Today for the first time I tried to publish an app I built because it has dependencies it needs to include in the build. But when publishing from the powershell with line dotnet publish -r win-x64 --self-contained true -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true
I get this error:
error MSB4062: The "Microsoft.Build.Tasks.GenerateTrustInfo" task could not be loaded from the assembly Microsoft.Build.Tasks.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a. Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.
Any pointers as to what my next step should be? Am I doing anything wrong?
Some more details:
The project is unsigned.
I use WindowsAPICodePack.
Yes, publishing via the interface works fine, but doesn't create a single file. I want to create a single file via either CLI or the interface.
I have added some lines in my .csproj file:
<GenerateResourceMSBuildArchitecture>CurrentArchitecture</GenerateResourceMSBuildArchitecture>
<GenerateResourceMSBuildRuntime>CurrentRuntime</GenerateResourceMSBuildRuntime>
<GenerateResourceUsePreserializedResources>true</GenerateResourceUsePreserializedResources>
<PublishSingleFile>true</PublishSingleFile>
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
Edit: adding <PublishSingleFile>true</PublishSingleFile>
to my .csproj file did not work.
c#
.net
publishing
0 Answers
Your Answer