Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Error While Running a Fresh Clone #4

Open
juicebyjustin opened this issue Jul 28, 2021 · 3 comments
Open

Error While Running a Fresh Clone #4

juicebyjustin opened this issue Jul 28, 2021 · 3 comments

Comments

@juicebyjustin
Copy link

juicebyjustin commented Jul 28, 2021

I am trying to run this project from a fresh clone, and I get an error message running dotnet watch run or docker-compose -up. There are no log messages after the message below.

How to replicate:

  1. Clone repo.
  2. Open root directory in terminal.
  3. Run dotnet build
  4. CD to CodeGen
  5. Run dotnet watch run

Complete Log Output: https://gist.github.com/juicebyjustin/d5d61c7b50550d19ab65ffd06cb12875

Error Message:

fail: CodeGen.Worker[0]
      No such file or directory
      System.ComponentModel.Win32Exception (2): No such file or directory
         at System.Diagnostics.Process.ForkAndExecProcess(String filename, String[] argv, String[] envp, String cwd, Boolean redirectStdin, Boolean redirectStdout, Boolean redirectStderr, Boolean setCredentials, UInt32 userId, UInt32 groupId, UInt32[] groups, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean usesTerminal, Boolean throwOnNoExec)
         at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
         at System.Diagnostics.Process.Start()
         at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
         at CodeGen.Runners.DotNETProjectRunner.Run() in /Users/justin/Documents/GitHub/code-generator/CodeGen/Runners/DotNETProjectRunner.cs:line 50
         at CodeGen.Worker.ExecuteAsync(CancellationToken cancellationToken) in /Users/justin/Documents/GitHub/code-generator/CodeGen/Worker.cs:line 47

CodeGen/Runners/DotNETProjectRunner.cs:line 50:

await Process.Start(openSwagger).WaitForExitAsync();
@steffbeckers
Copy link
Owner

The error you get might be related to a cross-platform issue, since you get a Win32Exception. Currently I'm using windows explorer to open a browser and navigate to the running API's swagger page.

// Open swagger
_logger.LogInformation("Opening Swagger docs: " + _outputProjectPath);

ProcessStartInfo openSwagger = new ProcessStartInfo("explorer");
openSwagger.Arguments = _projectTemplateSettings.DotNET.StartupProjectURL;
await Process.Start(openSwagger).WaitForExitAsync();

I think this functionality needs to be changed or removed.

@juicebyjustin
Copy link
Author

I switched from VS Code to Visual Studio and actually debugged the project. I see that it's trying to start the web browser at https://localhost:44370. I'm running on a Mac so of course explorer is not available. However, Swagger is not running on port 44370.

@steffbeckers
Copy link
Owner

Can you try to run the generated project from in the _Output folder?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants