gluck / il-repack

Open-source alternative to ILMerge
Apache License 2.0
1.16k stars 214 forks source link

.Net Framework 4.7.2, XAML not working for EXE #369

Open barkermn01 opened 1 month ago

barkermn01 commented 1 month ago

Using it to pack DLL's into an EXE and for some reason it's not working when i try and run the app i just get think it might be because it's using mainwindow.xaml and not MainWindow.xaml it's about the only thing i can think it could be.

System.IO.IOException: Cannot locate resource 'mainwindow.xaml'.
   at MS.Internal.AppModel.ResourcePart.GetStreamCore(FileMode mode, FileAccess access)
   at System.IO.Packaging.PackagePart.GetStream(FileMode mode, FileAccess access)
   at System.Windows.Application.LoadComponent(Uri resourceLocator, Boolean bSkipJournaledProperties)
   at System.Windows.Application.DoStartup()

I'm running it like this:

/log /verbose /pause /targetplatform:v4 /out:Memoria.Launcher.Merged.exe Memoria.Launcher.exe ZstdSharp.dll SharpCompress.dll System.Buffers.dll System.Memory.dll System.Numerics.Vectors.dll System.Runtime.CompilerServices.Unsafe.dll System.Text.Encoding.CodePages.dll **System.Threading.Tasks.Extensions.dll

I have tried not using the `/targetplatform' as well same problem

In the /verbos /log does tell me it has packaged the MainWindow.

Processing XAML resource paths ...
 - Patching type Memoria.Launcher.AdvOptionsWindow
 - Patching type Memoria.Launcher.UiModManagerButton
 - Patching type Memoria.Launcher.MainWindow
 - Patching type Memoria.Launcher.UiLauncherButton
 - Patching type Memoria.Launcher.ModConflictWindow
 - Patching type Memoria.Launcher.ModManagerWindow

Code is: https://github.com/barkermn01/Memoria/tree/feature/archives

The build command is part of our Memoria.MSBuild Project in Pack.cs

KirillOsenkov commented 1 month ago

I tried to build it, but the build fails, References\UnityEnginer.dll is missing

If you'd like my help, you'll have to provide an easy to run self-contained repro (ideally a zip file with run.cmd that I can unpack and run to get the exact same command line as you)

KirillOsenkov commented 1 month ago

Memoria.Launcher doesn't seem to properly reference NuGet packages. If you clone the repo on a new machine it will fail to build. Long term my recommendation is to convert all projects to SDK-style and use PackageReference so that the build is reproducible on any machine.

barkermn01 commented 1 month ago

Memoria.Launcher doesn't seem to properly reference NuGet packages. If you clone the repo on a new machine it will fail to build. Long term my recommendation is to convert all projects to SDK-style and use PackageReference so that the build is reproducible on any machine.

not sure what i you mean i have change the code since then so it's using MSBuild's AfterResolveReferences, and a OnResolveAssembly hook. and it works correctly, but those packages were all installed using the NuGet UI in VS2022 and all from installing SharpCompress so i have no idea what is breaking NuGet from downloading on build.

I tried to build it, but the build fails, References\UnityEnginer.dll is missing

Is because to compile the system you have to have Final Fantasy 9 installed and run the installer script to copy the DLL's we're not allowed to share as that would be piracy and team members have agreements with publisher hence why we don't ship those DLL files.