From bea2859beddc2f2ae638440689d8e6fdb9645a3d Mon Sep 17 00:00:00 2001 From: Daniel Svensson Date: Wed, 8 May 2024 15:48:14 +0200 Subject: [PATCH] Call "dotnet CodeGenTask.dll" instead of "CodeGenTask.exe" (#503) * Call dotnet codegen.dll instead of codegen.exe * Works "better" with antivirus / application control since dotnet is signed and codegen.exe is not * Makes build cross platform * Call GetFullPath for shorter search path to assembly --- .../Framework/CreateOpenRiaClientFilesTask.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/OpenRiaServices.Tools/Framework/CreateOpenRiaClientFilesTask.cs b/src/OpenRiaServices.Tools/Framework/CreateOpenRiaClientFilesTask.cs index 04881a6d..cac92d12 100644 --- a/src/OpenRiaServices.Tools/Framework/CreateOpenRiaClientFilesTask.cs +++ b/src/OpenRiaServices.Tools/Framework/CreateOpenRiaClientFilesTask.cs @@ -769,8 +769,8 @@ internal void GenerateClientProxies() private bool GenerateClientProxiesOutOfProcess(string generatedFileName, ClientCodeGenerationOptions options, SharedCodeServiceParameters sharedCodeServiceParameters) { // Call the console app from here if Net 6.0 or greater - string path = Path.Combine(Path.GetDirectoryName(typeof(CreateOpenRiaClientFilesTask).Assembly.Location), - "../net6.0/OpenRiaServices.Tools.CodeGenTask.exe"); + string path = Path.GetFullPath(Path.Combine(Path.GetDirectoryName(typeof(CreateOpenRiaClientFilesTask).Assembly.Location), + "../net6.0/OpenRiaServices.Tools.CodeGenTask.dll")); if (!File.Exists(path)) throw new FileNotFoundException(path); @@ -778,7 +778,7 @@ private bool GenerateClientProxiesOutOfProcess(string generatedFileName, ClientC using var loggingServer = new CrossProcessLoggingServer(); var startInfo = new ProcessStartInfo { - FileName = path, + FileName = "dotnet", UseShellExecute = false, CreateNoWindow = true, }; @@ -787,7 +787,7 @@ private bool GenerateClientProxiesOutOfProcess(string generatedFileName, ClientC string fileName = RiaClientFilesTaskHelpers.CreateAndWriteArgumentsToNewTempFile(arguments); - startInfo.Arguments = "@" + fileName; + startInfo.Arguments = path + " @" + fileName; var process = Process.Start(startInfo);