mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-03 21:25:13 +00:00
.csproj Assets not copied to output in dev builds #86
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @yoDon on GitHub (Nov 28, 2017).
When doing full desktop builds, items listed in the .csproj as
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>are copied into the built app's folder hierarchy but when doing dev builds the developer needs to manually copy the files into the destination directory.For example, if you've included files from the Assets folder in your .csproj, those files need to be copied into
obj/Host/node_modules/electron/dist/resources/app/bin/Assets(on a PC) orobj/Host/node_modules/electron/dist/Electron.app/Contents/Resources/app/bin/Assets(on a Mac). I suspect the same issue is present on Linux machines and I'm guessing the destination path matches the PC path but I've not been able to confirm for Linux.@jcphlux commented on GitHub (Dec 11, 2017):
you could setup webpack to copy the file for you.
@yoDon commented on GitHub (Dec 11, 2017):
Unfortunately webpack can't see inside the .csproj file so it can't easily understand or correctly predict what assets need to be copied, making it viable as a hard-coded temporary workaround but definitely not a real solution (I've got a similar manual work-around I'm doing at the moment).
@jcphlux commented on GitHub (Dec 12, 2017):
but you can easily tell webpack to copy all files in Asset to the wwwroot and obj folder and that will get published
@GregorBiswanger commented on GitHub (Dec 18, 2017):
@yoDon Do you mean the "electronize start" command creates a different folder on other platforms?!
And the assets folder is not in the correct path?
@yoDon commented on GitHub (Dec 21, 2017):
@GregorBiswanger This is a dev vs. production build issue not an OS platform issue. Dev builds and production builds act differently with respect to assets listed in the .csproj. Production builds copy assets listed in .csproj to the expected output folder. Dev builds don't work because the dev server expects to find the assets under obj/Host/..... as described in the initial bug report here and the dev build process doesn't copy them there.