Visual Studio Community 2022. Breakpoint not hit in Blazor WebAssembly (Mud Blazor) Application - visual-studio-2022

In my solution Visual Studio Community 2022, In one solution, I have different projects (class library, Web API and one Blazor Web Assembly). On Startup there are two projects
WebAPI
Blazor Web Assembly
I am using Mudblazor in Blazor Web Assembly project.
I have put different break points in different projects and all projects run in Debug mode. All the break points are hitting well except in Blazor project. I am getting following information on break point.
I have looked for a solution from a number of websites but found no solution. I also went through the following post but no benefit:
How do I remedy "The breakpoint will not currently be hit. No symbols have been loaded for this document." warning?
One more thing to share is that during solution execution I cannot find project name in
Debug -> Window -> Modules
I will be grateful, If someone please suggest a useful solution. Thanks

There are 7 console applications and 2 WebAssembly projects. I have just changed Optimize code setting as Release and breakpoints are getting hit.
I don't know the logic behind it but it works. I will go through as it is for the time being as project's deadline is approaching too fast.

Related

Asp.net Core application is not running with VS 2017?

I have installed the visual studio 2017 for ASP.Net Core. I created Dot Net Core project. Build it successfully and run it but on Firefox it shows the blank page and on chrome it shows "**The localhost page isn’t working
localhost is currently unable to handle this request"
I thought there is a problem in code. I debugged the code and there is nothing wrong with the code. It's the default template and code generated for Asp.Net Core. I googled and tried many things like restart the VS, removed cache, etc but nothing worked for me. Then i uninstalled the VS 2017 and used C Cleaner to remove all temp files etc and installed the visual studio 2017 again but the same error came again. Then i created MVC application, console application in VS 2017 and both worked fine. Issue comes only in Asp.net core application. I use fiddler to see the request status and it is 500. I debugged the code but nothing wrong with the code(No Exception). I have tried many things but did not find anything helpful. Can anyone tell me what's the issue?
The blank page response can be caused by a number of reasons. Sometimes because you are lacking something in the system , routing issues, wrong code on the wrong location, .csproj configuration issues, permission issues, and many more.
There are a couple of things you can try:
Check to see if you have the appropriate ASP.NET Core Module installed in you system. (Either x86 or x64 depending on your system )
Make sure you have enabled IIS Integration in your code
See if you have the error middleware in your Configure code, it mostly helps to solve your issues by giving full detail.
Looks like you are running into error similar to this issue with browserlink .What version of browser link package do you have in your machine
Microsoft.VisualStudio.Web.BrowserLink should be 1.0.1 referring the templates
This SO post discuss the similar issue .If that does not solve, Please make sure you have 1.0.1 in your project referenced and then try this
Clearing your NuGet cache
dotnet nuget locals all --clear
Set Environment variable DOTNET_SKIP_FIRST_TIME_EXPERIENCE to 1 . This is to avoid caching packages
dotnet restore
Does it happens to be runtime compilation issues?
I stumble across this issues log while studying the feasibility of using ASP.Net Core for ERP System host on LinuxOS.
Issues #2017 on GitHub
Try setting
<PreserveCompilationContext>false<PreserveCompilationContext>
in your csproj

Understanding ASP.NET Core Dependencies and Capabilities

When I use a Visual Studio 2015 template to create a brand-new ASP.NET Core project, I see a couple of unexpected pieces. I'd like to understand these:
By default, the new project targets dnxcore50 and dnx451. I thought ASP.NET 5 / MVC 6 required .net 4.6, so I don't know why dnx451 is one of the default targets.
Regardless of dnx target, the startup.cs file specifies app.UseIISPlatformHandler. I've been running the dnxcore50 target in Docker (i.e. Linux) without any problem, even though Linux does not have IIS. So I don't know what UseIISPlatformHandler does. I can find no documentation for it either.
Can anyone clarify?
Why dnx451 instead of dnx46 is basically IIS's fault, see answer here. Also perhaps the templates run behind because Azure has not yet switched to 4.6? Just a little theory of mine. I'm not sure.
UseIISPatformHandler is again only used for IIS. You can savely remove it if you have no interest in publishing your web app to IIS. You can learn more about the HTTP Platform Handler (which IIS needs) here. And you can learn more about the IIS Platform Handler Middleware from the source code.
Does this make it more clear?

MVC4 - AuthConfig.cs missing

I am trying to get started with the OpenAuth features of MVC4 as described here:
http://pluralsight.com/training/Player?author=scott-allen&name=mvc4-building-m7-security&mode=live&clip=9&course=mvc4-building
I already did start over again a couple of times in order not to miss anything, but even though I am choosing the right template (Internet Application) there is no AuthConfig.cs.
Nor do I find documentation what to do to get the required tasks done manually.
I am pretty sure this is a pretty dumb question, but maybe I don't find the answer because it is so obvious...
thx
I followed these steps:
Open File/New/Project
Select ASP.NET MVC 4 web Application
Then Select internet Application
Once the project was created there should be a AuthConfig.cs file within App_Start folder
unbelievable.. I used the RC Version of Visual Studio and even though I reinstalled MVC4 from scratch the recent version including the openauth extensions wasn't properly available.
Following the same steps on the regular Visual Studio Installation did the trick...

Web site to dll

I need to compile my web site, is it possible without converting to a web project first?
I think he wants to "protect" his code for any deployment.
If this is a .Net project you can try hide some code using codebehind components in ASP.NET.
Here is an small tutorial about it:
http://asp.net-tutorials.com/basics/code-behind/
For older projects you may have to build a cgi binary application, but as already mentioned here, add some more details to specify your problem.
I think you want a VS Web Deployment project. This exists as a separate project in your solution but can compile and copy the existing web project to a different directory.
There's a reasonable write-up of it on this blog with step-by-step instructions. You'll need to download and install the new project type separately though (2008, 2010)

Need msbuild file that will publish a Web Application

Has anyone had success making an msbuild file that will publish a Web Application, not the old 2.0 web site but a Web Application?
This is not what I am looking for:
<MSBuild Projects="eRx.Web.SecureSiteShell.csproj" Properties="Configuration=Debug;OutDir=$(OutputFolder)\$(OutputWeb)\bin\;WebProjectOutputDir=$(OutputFolder)\$(OutputWeb)\" Targets="ResolveReferences;_CopyWebApplication" />
I tried simply using 'targets:Publish' but I get : Skipping unpublishable project.
Apparently this just isn't possible. My first hint was getting absolutely no response from this site.
I began to look into making a web setup project but was unsatisfied at having to edit the installation dialogues to get a custom installation folder. All I really need is something that will copy the published output of a Web Application (not Web Site you 2.0 peeps).
I think I have cheated the system by creating a simple Windows Setup program. Surprisingly I am able to include the primary output of my web application which satisfies my need. I DO have to manually add each projects debug symbols if I want them so the process can be lengthly but doable.
Like I said, not completely satisfied because I wanted to get the files in a nice deploy folder for my QA group to work with but feeding them an MSI has its advantages I suppose.
I leave this for anyone to comment on. I still can't believe I can't do this from msBuild or any other tool.