Skip to content

Commit

Permalink
Call "dotnet CodeGenTask.dll" instead of "CodeGenTask.exe" (#503)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Daniel-Svensson authored May 8, 2024
1 parent 0a4b40a commit bea2859
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -769,16 +769,16 @@ 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);

using var loggingServer = new CrossProcessLoggingServer();
var startInfo = new ProcessStartInfo
{
FileName = path,
FileName = "dotnet",
UseShellExecute = false,
CreateNoWindow = true,
};
Expand All @@ -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);

Expand Down

0 comments on commit bea2859

Please sign in to comment.