Should I be able to attach the debugger to a blazor wasm project using the visual studio 2019 professional edition? When I use dotnet watch run, I can't get the symbols to load to hit the breakpoints. It works fine with iisexpress but not when I use dotnet watch run. Any ideas or articles to look at would be appreciated.
Related
I found little weird worth asking the community and get an understanding.
I have Dotnet Core 5.0 Web Application as well as Dotnet Core 5.0 Web API Project. Both are plain vanilla coming straight from Visual Studio 2019 boilerplate template.
I press both one after another from visual studio (press F5 by kipping as default) and make sure it works.
Web Application gives home page while
Web Api gives the swagger output for WeatherForecast API
Now, I want to test the same using Visual Studio Command Prompt through Dotnet CLI command.
First, I tried with Web Application.
I navigated to the path I have Web Application and I execute dotnet "bin\debug\net5.0\webapp01.dll" and it ran. I can see the web application in my browser.
So far so good.
Second, I tried with Web API.
I navigated to the path I have Web API and I executed dotnet "bin\debug\net5.0\webapi01.dll" and it ran. I opened the browser and check the same swagger page and OOPS. 404 error page. nothing is coming. I checked the command prompt and it's still running but no output.
Alternatively (while I troubleshooting), I gave tried to execute dotnet run command for Web API
dotnet run "bin\debug\net5.0\webapi01.dll" - interestingly it prints an additional line in the command prompt than the previous (without run command) one - the line was "Building..." rest everything as is.
I checked the browser with the same swagger link and voila - it's giving me an output.
Well - to check I did the same with Web Application dotnet run "bin\debug\net5.0\webapp01.dll" - that also works with the correct output.
This leads me to ask the questions?
If we should use dotnet "dll" then why is it not working for the web API project?
What is so different running dotnet "dll vs dotnet run "dll"?
I am on VS 2019 16.8.3 with .Net 5.0.
I have created a simple Win Form project without any NuGet or project dependency. I have made sure it runs out of the IDE.
When I published the project to a self-contained single file exe, it does not run. The Task explorer briefly showed the exe and switch it to suspended before killing it. The exe works fine after I republished it either without the single-file or the self-contained option. It seems like both options cannot co-exist.
Any idea?
How do I actually run the debugger with a .net core web app using visual studio along side the dotnet watch tool?
I am using the dot net watch tool which greats work and picks up changes, however if I try to attach the debugger, the code doesn't match with what's compiled. So I have to ctrl-c and stop the hosted app, rebuild and rerun donet run and reattach the app to the dotnet process. Surely this can't be the workflow of .net core developers?
I have a .net core web app written using VS2015 and deployed in Azure.
Recently I have moved to VS2017 and it forced me to convert my web app solution so that I can develop it in new VS. I did this and there were no issues.
Then I made a minor change in my app and commited that change to github. Once I did it, Azure has started to build new version as it is configured to automatically deploy current version of app from github.
the issue is that after solution conversion to VS2017 i cannot deploy it in azure. I constantly get an error:
D:\home\site\repository\WebApp\src\WebApp\WebApp.csproj(84,5): error
MSB3073: The command "dotnet bundle" exited with code 1. Failed
exitCode=1, command=dotnet publish "WebApp\src\WebApp\WebApp.csproj"
--output "D:\local\Temp\8d481c16c48679f" --configuration Release
Can any one help me, I'm not very experienced in VS IDE, I think it might be something with project properties or references.
thank you in advance
In the .csproj file, please get rid of any references to "dotnet bundle" as well as the NuGet package "BundlerMinifier.Core". When you've done that and it compiles correctly, you can install the NuGet package "BundlerMinifier" which will add build time support through MSBuild now in .NET Core apps too
How do I compile and run an ASP.NET MVC app using nothing other than the MSBuild command line? My Visual Studio is super slow and I just want to be able to run an app quickly for bugfixes and showcasing etc. Is this possible? What's the command line for it?
MSBuild is for building your application. If you want to run your app outside of Visual Studio, you need a web server for it. I'd recommend you to publish your app on local IIS. Just point your IIS website to your Web project folder. After that you will be able to access your application from the browser without running it from Visual Studio.
You can build your project from command line. Use msbuild.exe utility for it:
msbuild.exe projectname
You can find it in one of your .NET Framework folders (I recommend you to use the latest one):
C:\Windows\Microsoft.Net\Framework\v2.0.50727\MSBuild.exe
C:\Windows\Microsoft.Net\Framework\v3.5\MSBuild.exe
C:\Windows\Microsoft.Net\Framework\v4.0.30319\MSBuild.exe
C:\Windows\Microsoft.Net\Framework64\v2.0.50727\MSBuild.exe
C:\Windows\Microsoft.Net\Framework64\v3.5\MSBuild.exe
C:\Windows\Microsoft.Net\Framework64\v4.0.30319\MSBuild.exe
When IIS is set up, you can build your app and see changes in your browser. Visual Studio is not necessary at this point.
Instead of IIS you can use IIS Express. Here is an article of how to run application on IIS Express from command line.