mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-03 21:25:13 +00:00
Pass configuration profile to electronize #497
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 @nazar322 on GitHub (May 19, 2020).
Originally assigned to: @GregorBiswanger on GitHub.
I work on a cross-platform project that supposes to run on both Mac and Windows. To avoid code duplicates I have classes that mostly share the same code but might have platform-specific areas that I distinct from the rest of the code with
#if WINDOWSfor instance. Then I have created configuration profiles for each Windows and Mac builds that define symbols I need to compile my project for the platform I need.The problem with
electronizeis that I cannot pass my configuration profile and therefore, because my code dependent on predefined symbols,dotnet publishfails to build my project.Please add a command argument to pass the configuration profile to both
electronize buildandelectronize startcommands.@GregorBiswanger commented on GitHub (May 19, 2020):
Have you tried the following command?
electronize start /args ASPNETCORE_ENVIRONMENT="Development"@GregorBiswanger commented on GitHub (May 19, 2020):
With .NET Core you can use native methods:
bool isWindows = System.Runtime.InteropServices.RuntimeInformation .IsOSPlatform(OSPlatform.Windows);@GregorBiswanger commented on GitHub (May 19, 2020):
I see, we have already the following command:
electronize start /dotnet-configuration developmentWorks?
@nazar322 commented on GitHub (May 20, 2020):
It's an option to check for the platform in the runtime, but I also have executables embedded as a resource both for Mac and Windows and in order to embed a correct resource I use confitional including in csproj, like in the example below.
So I still need to pass the configuration needed.
@nazar322 commented on GitHub (May 20, 2020):
Unfortunately, it didn't work.
The following
dotnet publishcommand does not contain--configurationargument. It is the same as when not passing/dotnet-configurationargument.However, when I use the same
dotnet publishcommandelectronize startproduces but just append--configuration MYCONFIGURATIONit builds well.I also have not found any references to
/dotnet-configurationin StartElectronCommand.cs.By the way, here is my version of Electron.NET CLI
ElectronNET.CLI Version: 8.31.2.0