question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Path cannot be null on init

See original GitHub issue

Using VS 2019, .net core 2.1, Windows 10 Surface Pro on an ASP.NET Core app, when I run electronize init (via command prompt) I receive the following error:

C:\source\repos\TranslationMessageManager>electronize init
Adding our config file to your project...
Search your .csproj to add the needed electron.manifest.json...
Found your .csproj:  - check for existing config or update it.

Unhandled Exception: System.AggregateException: One or more errors occurred. (Path cannot be null.
Parameter name: path) ---> System.ArgumentNullException: Path cannot be null.
Parameter name: path
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
   at ElectronNET.CLI.Commands.InitCommand.EditCsProj(String projectFile) in D:\Code\GitHub\Electron.NET\ElectronNET.CLI\Commands\InitCommand.cs:line 126
   at ElectronNET.CLI.Commands.InitCommand.<ExecuteAsync>b__10_0() in D:\Code\GitHub\Electron.NET\ElectronNET.CLI\Commands\InitCommand.cs:line 74
   at System.Threading.Tasks.Task`1.InnerInvoke()
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at ElectronNET.CLI.Program.Main(String[] args) in D:\Code\GitHub\Electron.NET\ElectronNET.CLI\Program.cs:line 54

There isn’t anything in that message that makes it clear to me what might be going on here - just figured I would report it in here in case it makes sense to someone on the team 😃

Thanks!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9

github_iconTop GitHub Comments

9reactions
goonzaahcommented, Sep 1, 2020

I could resolve a problem. I m should be in the folder where are the Startup.cs and Program.cs when I execute this commands. I expect that this resolve yours problems too.

2reactions
aliysscommented, Oct 10, 2020

So here’s the thing:

At the following step:

At the first time, you need an Electron.NET project initialization. Type the following command in your ASP.NET Core folder:

$ electronize init

Be sure you cd to the correct folder in advance:

So if your folder structure is:

├── project
│   └── Startup.cs
└── project.sln

Then in the Terminal do this:

$ cd project
$ electronize init
$ cd ..
$ electronize start
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix: Value cannot be null. Parameter name: path
Looks like it's problem with your GetProtocolPath() . pathBuilder not return path format.
Read more >
Value cannot be null.", "Parameter name: path" - Support ...
I've received this error a few times now. I can repair the database successfully, and have completed at least one manual backup after...
Read more >
Value cannot be null. Parameter name: format visual studio ...
In my case, I start VS2022 and from the "Open Recent" panel Create a New Project (Windows Forms App using .NET 6.0). Project...
Read more >
System.ArgumentNullException: Value cannot be null
I use the assign activity to tell it that “FilStiDokument” is the path(as string) it has to use. Then I invoke the workflow...
Read more >
Understanding null safety
If a function has a non-nullable return type, then every path through the function must reach a return statement that returns a value....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found