How do I debug a Goa application using Goland? - goland

I'm new to Goa and the Goland IDE, currently I'm resorting to fmt.Println() to debug parts of my application, however this isn't ideal.
I have Goland setup to run my Goa application, and that works fine - I simply pointed my run configuration to the directory in question. But when I start the debugger I get could not launch process: EOF
How do I setup Goland to debug my application?

Related

Visual Studio 2022 VUE3 Project Won't Start "Unable to start debugging"

Background: I have a VUE3 WebApp created using the VS2022 templates
https://learn.microsoft.com/en-us/visualstudio/javascript/tutorial-create-vue-app?view=vs-2022
that was working well on a desktop (Windows 10 Pro) and a laptop (Windows 11 Home); i.e. I could open Visual Studio 2022; have the WebApp as the start-up project; click run/debug and it would run up.
Current Issue: On the desktop this continues to work as expected; however on the laptop when I go to startup the WebApp I get a message "Unable to start debugging. The startup project cannot be launched. Ensure that the correct project is set as the startup project. .... Additionally make sure its debug settins are correctly configured in project properties"
Project Properties: the two machines have the same project properties; nothing really in there other than Startup Command is npm run serve
I don't believe I've changed anything and the two machines are using the same source control repository and branch; just wondering how I work around this / what might have changed. I've done Visual Studio 2022 Updates on both machines (so up to current version on both machines). One difference is on the WebApp project if I right click, select Debug, on the laptop the options are all greyed-out; on the desktop you can select "Start new instance", "Start new instance with debugging", etc..
Any ideas on what is happening here? Or troubleshooting steps I can take to resolve?

How do I run an ASP.Net Core executable file?

I am new to ASP.Net Core. I have been following a tutuorial. I got to the point at which Javascript code was added to my project. I ran my program, and nothing in the script worked. After adding a few alert() calls, it was apparent that my program was not finding my script. People here and at Reddit suggested I look at the network tab of DevTools. I saw that my program was not able to find any js or css files.
Being an old-school C++/C# developer, I was running the program from a command window by going to the folder containing the executable file and typing the name of the file.
I went back to the beginning. The tutorial directs me to use the dotnet command, which is brand new to me. The first time it tells me to run my program, it tells me to go to the project directory and enter "dotnet run". It just hit me like a ton of bricks that that was what I should have done the first time. I went back to that project, used "dotnet run", and it worked.
So, my question is this: is it possible to run MyProject.exe by itself? If so, how? Copy it into my project folder? Or is the "dotnet run" command the standard way of executing an ASP.Net Core application?
I think it won't work if you directly run it (not sure if we can run MVC project using dotnet-cli (dotnet run will try to load only MSIL to CLR)).
DotNet core console application is different from .net core MVC projects
you can run your project by following ways.
1. Run using visual studio
when you create an MVC application, in the visual studio there will be multiple options to run it, you can choose IISexpress one, it will open in the default browser.
for step by step guide -> https://learn.microsoft.com/en-us/visualstudio/ide/quickstart-aspnet-core?view=vs-2019
2. publish it in IIS
For this you need to ensure few things, like hosting bundle is installed or not, IIS is correctly configured for core application or not.
for step by step guide -> https://stackify.com/how-to-deploy-asp-net-core-to-iis/
3. Use VSCode
for step by step guide -> https://learn.microsoft.com/en-us/aspnet/core/tutorials/publish-to-azure-webapp-using-vscode?view=aspnetcore-3.1

vs2019 C# console app does not run as expected

Visual Studio 2019 is not creating and executing a console app like previous versions of VS.
If I open a new project, put this code in Main():
Console.WriteLine("hello");
Console.ReadKey();
and hit F5, the app appears to run, then exit with code 0. The console doesn't wait for a key input to close, and breakpoints in the source do not hit.
The EXE should be in this folder
c:\projects\test-app\bin\debug\
but it is actually in:
c:\projects\test-app\bin\debug\netcoreapp3.0
and when I run it from that location outside the IDE it opens a console and immediately closes it, apparently not running the code in Main().
Going through the exact same steps with Visual Studio 2017 runs the app as expected.
I can live with the final exe being located to a different folder but VS2019 doesn't even seem to be running any of my code. Am I missing something?

Visual Studio 2017 Doesn't Run Core Apps with IIS Express

I am having an issue with Visual Studio 2017 RC where when I run an MVC and/or WebAPI app using IIS Express the app never actually runs. Instead I get stuck with a page in the browser indicating it is trying to attach and from there it goes no further. If I open another tab/window in the browser and try to navigate directly to the launch URL, it just spins forever. Likewise when I run this using the dot net run command, the app launches and runs fine.
There do not seem to be any errors that I can see, just that the browser spins indefinitely without actually ever loading the page/endpoint.
Note: this occurs for most any circumstance. Newly created project in VS with no changes, known working project from previous versions, etc.
You could follow or upvote the issue: https://developercommunity.visualstudio.com/content/problem/11391/aspnet-core-iis-express-httplocalhost51733-failed.html
Looks like our workarounds meanwhile are
dotnet run
Publish to local IIS. Which is working for me.
(Untested: downgrade from core-1.1 to core-1.0)
If you aren't familiar with VS2017/asp.net:
You have, or can reveal via View Menu-->Other Toolbars :
Debug toolbar --> dropdowncombobutton saying "[green arrow>] IIS Express"
Click on the dropdown downarrow part of the button.
You should see a Run {yourprojectname} option.
This is the equivalent of dotnet run {yourprojectname} from the commandline.
You can configure the options that appear in the dropdown with
Right-click on project in solution explorer --> Properties --> Debug
I had this same issue and after digging around for a while I discovered that I had dotnet preview v1.0.0-preview2 installed under Programs Files (x86) and a non-preview version in x64. I think VS is launching the x86 (preview) version but expecting to see the full version. To fix this, I did the following.
from programs and feature uninstall every visible dotnet core. (note: for me this did not remove the x86 preview)
go to https://www.microsoft.com/net/download/core#/sdk and install BOTH x86 and x64 SDK packages
open command line and from the root directory check run: dotnet --version (at the time of writing it was 1.0.4)
fire up .net core project in VS 2017 and run.
When I did all of the above, I was able to start up the site in IIS Express from VS.

dotnet run command does not find user secrets

I have a asp.net core project running on a macbook. I'm using visual studio code as my code editor. When I run the project from visual studio code the application boots fine however when I execute dotnet run from the terminal in the project's working directory I get an error that the database hostname value is null. This value is defined in user-secrets. Is there an extra setup I'm missing from the command line?
If it is loading the user secrets only in Development as is normally done, you have to remember to set the environment variable ASPNETCORE_ENVIRONMENT to Development.

Resources