Closed emirmo closed 11 months ago
Hi, Were you able to solve it?
You come to the wrong place. That MSBuild task you used has nothing to do with this repo, but Repack.Lib.MSBuild.Task/issues so you should go there and contact its developers.
I was confused at first :)
Yes, this should probably go to https://github.com/ravibpatel/ILRepack.Lib.MSBuild.Task/issues. Although I suspect the latest version of the task NuGet may fix it: https://www.nuget.org/packages/ILRepack.Lib.MSBuild.Task/2.0.22
Hi, my project is a Windows Forms application that uses the .NET Framework version 4.8. The project uses several external dependencies, and I'm hoping to merge them into a single assembly file for release.
Configuration
After installing the nuget package, my *.csproj file was updated with a new reference:
<PackageReference Include="ILRepack.Lib.MSBuild.Task" Version="2.0.18.2" />
Then, I added an ILRepack.targets file to the project root, with the following contents:
Problem
When I publish my project via the Visual Studio GUI, the Output tab reports success:
When I open the Release/net48/publish folder, all dependencies are deployed, as if it were a regular, non-merged publish action. If I delete an assembly (e.g. "Newtonsoft.Json.dll") from the publish folder, and open my executable, an exception is thrown when the executable calls the assembly:
Could not load file or assembly 'Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified.
It's the same with any other external dependency.
I'm wondering if I've missed something, because all assemblies are reported as correctly merged, but the published project files behave like regularly published, non-merged files.
Other
This may not necessarily be related, but when I try building the project via command line (rather than through the Visual Studio GUI):
dotnet build
the following error occurrs:
The "ILRepack" task could not be loaded from the assembly {my path}.nuget\packages\ilrepack.lib.msbuild.task\2.0.18.2\build\ILRepack.Lib.MSBuild.Task.dll. Could not load file or assembly 'Microsoft.Build.Utilities.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified. Confirm that the <UsingTask> 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.