SharpLab icon indicating copy to clipboard operation
SharpLab copied to clipboard

Add info how to debug / run SharpLab via VisualStudio

Open bernd5 opened this issue 2 years ago • 3 comments

I very much like to use SharpLab - unfortunately there are some issues from time to time (e.g. the current TypeInitializationException). To solve them fast I would like to contribute to the project.

But if I run the project WebApp.Server after sl setup I get:

Application startup failed: could not load index.html from the assets storage. 

Would it be possible to add some docs how to debug SharpLab in Visual Studio? What needs to be configured... Which services need to run...

bernd5 avatar Mar 27 '22 14:03 bernd5

Hi @bernd5 -- thanks for reporting! I do agree it would be a good idea to update documentation a bit. In the meantime, to run SharpLab you can use sl run (as suggested by sl setup).

ashmind avatar Apr 01 '22 05:04 ashmind

When I execute sl run I get the message (from webapp-server)

Application startup failed: could not load index.html from the assets storage.

In the console output I see:

[12:18:31 INF] Launching service azurite_e1889a75-6: pwsh -Command "azurite"
[12:18:31 ERR] Failed to launch process for service azurite_e1889a75-6
System.ComponentModel.Win32Exception (267): An error occurred trying to start process 'pwsh' with working directory 'D:\work\SharpLab\!azurite'. Der Verzeichnisname ist ung�ltig.
   at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
   at Microsoft.Tye.ProcessUtil.RunAsync(String filename, String arguments, String workingDirectory, Boolean throwOnError, IDictionary`2 environmentVariables, Action`1 outputDataReceived, Action`1 errorDataReceived, Action`1 onStart, Action`1 onStop, CancellationToken cancellationToken) in /_/src/Microsoft.Tye.Core/ProcessUtil.cs:line 173
   at Microsoft.Tye.Hosting.ProcessRunner.<>c__DisplayClass9_0.<<LaunchService>g__RunApplicationAsync|0>d.MoveNext() in /_/src/Microsoft.Tye.Hosting/ProcessRunner.cs:line 404

Is azurite a required service?

bernd5 avatar Apr 09 '22 10:04 bernd5

Seems so, @bernd5. It is an emulator of the Azure Storage service, which normally runs in the Azure cloud. The emulator is distributed as an NPM package. npm install -g azurite https://learn.microsoft.com/en-us/azure/storage/common/storage-use-azurite?tabs=npm%2Cblob-storage

TomasMalecek avatar Feb 09 '24 22:02 TomasMalecek