Skip to content

Running exe from file explorer and powershell throws exception #1

@inkydom

Description

@inkydom

I built a release version of the NoOverlaysDemo project. I navigated to: C:\Users\dom\Documents\TASagentTwitchBotDemos\TASagentTwitchBot.NoOverlaysDemo\bin\Release\net6.0-windows and double clicked on TASagentTwitchBot.NoOverlaysDemo.exe to run. The program seems to start and immediately exit.

I launched powershell and ran the program and this was the exception I got:

Unhandled exception. System.ArgumentNullException: Value cannot be null. (Parameter 'path1')
   at System.IO.Path.Combine(String path1, String path2, String path3)
   at TASagentTwitchBot.Core.Extensions.StartupUtilities.UseCoreLibraryContent(WebApplication app, String libraryName, Boolean useDefault) in C:\Users\dom\Documents\TASagentTwitchBotDemos\TASagentTwitchBotCore\TASagentTwitchBot.Core\Extensions\StartupUtilities.cs:line 31
   at Program.<Main>$(String[] args) in C:\Users\dom\Documents\TASagentTwitchBotDemos\TASagentTwitchBot.NoOverlaysDemo\Program.cs:line 172
   at Program.<Main>(String[] args)

The line in question is:

wwwRootPath = Path.Combine(app.Environment.WebRootPath, "_content", libraryName);

How are you running this without visual studio (if you are). Any suggestions on how to resolve this? I tried running from the solution, project, and bin directories in case it was a pathing issue.

I should note I can run it fine from within visual studio hitting f5.

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions