ashmind / SharpLab

.NET language playground
https://sharplab.io
BSD 2-Clause "Simplified" License
2.72k stars 199 forks source link

Add info how to debug / run SharpLab via VisualStudio #949

Open bernd5 opened 2 years ago

bernd5 commented 2 years ago

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...

ashmind commented 2 years ago

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).

bernd5 commented 2 years ago

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?

TomasMalecek commented 9 months ago

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