How to get hot reloading working with React.js project template in VS2022 Mac - asp.net-core

I am using the React.js project template in VS2022 for Mac and the application starts up fine when run with “Start Debugging” or “Start Without Debugging”. When making changes to the React front end code, the page refreshes and the changes are instantly viewable. However, when making any changes to the backend API code, you have to stop and restart in Visual Studio before the changes are reflected in the API calls.
I have also tried running the application with “dotnet watch” from the terminal and in this case I can see the API being re-compiled in the output window when a change is made to the API code, but then it seems to kill the dev proxy server because I am not able to refresh the page as it just returns “The site can’t be reached” (I can see the bash process getting killed in activity monitor, which I think is hosting the dev proxy server). I have to restart the application again in Visual Studio to get it working and see the changes to the API code.
Is there a way when using the SPA proxy in VS 2022 so that you can make changes to either the front end or back end code and have those changes hot reloaded?

Related

Visual Studio with React project keeps starting multiple copies of the development server

I'm using Visual Studio 2022 with the React template on .NET (core) 6.
When I press f5 to start debugging, it starts a command prompt to start the development proxy server, fires up my deafult browser (chrome), and everything seems to work OK.
However, about every 2 minutes after, regardless of whether I have touched VS or the app, it then starts another copy of the development server, which then gets stuck with a prompt saying Something is already running on port 3000. Left to its own devices it just keeps starting more.
This doesn't stop the previous one working but it's frustrating to have all these windows appearing, especially as they steal focus when prompting with the "port in use".
Something that I suspect is related is a message appearing in the debug output around every 8 seconds saying "Microsoft.AspNetCore.SpaProxy.SpaProxyMiddleware: Information: SPA proxy is not ready. Returning temporary landing page." However as noted above the SPA proxy certainly seems to be running OK.
Has anyone got any ideas what might be happening or any workaround for this?
OK I managed to figure this out by creating another blank project and comparing them.
The port that the development server will listen on is stored in a file called ClientApp\.env.development; the port that visual studio expects it to listen on is in the .csproj file under PropertyGroup/SpaProxyServerUrl. If there is a mismatch you will get this behaviour because VS thinks the server isn't running and keeps on trying to start it.
In my case I had added the .env.development file to the version control ignore list thinking it wasn't important. This was causing the dev server to listen on the default port 3000.

Quarkus app runs perfectly on local but does not respond to any request on windows server

I have a simple quarkus api app. I've tested the app on my local machine and its running fine. But when i try to run the same app in windows server it starts perfect but does not respond to any of my api request. It is not showing any error or problems. I've tried multiple ways to run the app also through package and jar files but all led to same result. screenshot of the palce where app gets stuck

IIS Express won't stop after debugging

I have this problem with VS 2019 and IIS Express: we have a setup with an ASP.NET Core web app as backend and an Angular front end. How we develop is using VS Code for Angular app (served on localhost:4200) while running backend from VS 2019 using IIS Express.
What I noticed after I upgraded to VS version 16.11.5 (wasn't updating for months prior to this) is that IIS Express won't stop after I stop debugging on VS.
For example: I hit break point in POST method on BE but I don't want to continue and I just want whole thing to end (e.g. don't want to modify my test data) however angular app makes second call to the method (because that's what it do) and request is processed.
Meaning even when I stop debugging IIS Express still goes on. This is very uncomfortable to me especially when I need to trace bug in my code without doing mess in my data. I tried many suggestions like this however without any luck.

403 Error (Forbidden) when trying to view my MVC4 application on AppHarbor

I'm new to both ASP.net and AppHarbor. I also have never deployed an ASP.net application before.
I've set up an MVC4 website using the Visual Studio 2012 release candidate and it is near completion. Locally, it is working fine / as expected.
To send the client a current progress demo, I've been advised that I should use AppHarbor to host the application / website.
I've gone through the process of setting up a Git repository and connecting that with AppHarbor. I then used the Build -> Publish Selection option in Visual Studio to create a 'Web Deploy Package' within my local copy of the repository. Finally, I pushed the files (shown below) that were created to the repository and AppHarbor listed the commit as 'Active'.
However, when I click Go to your application, all I get is this magnificent 403 page.
I've tried a bunch of things (none of which have worked so far) that I've seen in forums (including here and AppHarbor support), including:
Adding a <modules runAllManagedModulesForAllRequests="true"/>
Ensuring I didn't have multiple web projects.
Checking and confirming that there are no errors listed in AppHarbor.
I've turned CustomErrors off, yielding no differences.
I haven't touched any of the .config stuff since I began the project (because I don't know how to use them yet). Perhaps I've just not added something blatantly obvious in there?
You shouldn't use the Web Publish stuff when you want to deploy to AppHarbor. AppHarbor takes your source code straight up, builds it, tests it and deploys it.
Here's a guide on deploying your first app on AppHarbor using Git. There's also a video on the AppHarbor front page that you can check out.

Problems with debugging in Silverlight 4 using Out of Browser and WCF RIA Services

With Visual stuido 2010, it's simple to set up SL4 to debug with an out-of-browser installed app. I followed the instructions from here and everything seems to set up fine. Debugging from the browser runs the program just fine, but running from the OOB program gives a different result. After starting, the screen will go blank and then hang forever. I have some concerns that it might be because of some of the technologies that we're using.
Firstly, there's a popup that happens because we're using WCF RIA Services (formerly .NET RIA Services).
"RIA Services will fail unless the silverlight project is hosted and launched from the same web project that contains the RIA Services."
This seems to just be a warning, but I have a suspicion that this warning might be telling me that RIA Services needs to have the .web project as its startup project.
We're also using prism and the error has an odor of a Prism error too. (something loading and then not ever appearing)
Has anyone else had any issues with OOB debugging in SL4? Is anyone else OOB debugging in SL4?
Sorry it's so vague. It's a complicated mess. The only message I see is the italicized popup warning. Then the window (which was previously showing the background of our application) just goes blank
There is currently a known issue with debugging an Out of Browser Silverlight 4 application when using F5 to launch the application from within VS 2010. The question I have is whether or not the application launches without debugging (-F5 or running it from the shortcut)? In the case of using F5, a dialog typically appears with the following error dialog “Unable to start debugging. A fatal error occured. For more details, please see the Microsoft Help and Support web site. HRESULT=0x80070018” and then the application appears to hang. In this case detaching allows the process to continue and then reattaching should allow you to debug the process.
If this is completely blocking or you’re trying to debug code running at startup (like the page startup event), one possible way to get around this would be to put in a call to System.Diagnostics.Debugger.Break, start the program and then attach when dialog pops.
This can be caused by the OOBA install being older than the version you are trying to debug. Remember, Silverlight OOBAs do not automatically update themselves to the latest version of the XAP file that may be available on the server. You have to update them yourself. If you get this error and you have included the auto-update logic in your app, just bounce out of VS, run the app so it auto-updates, then go back in and debug.
Alternately, you can uninstall the app and re-install it. That will ensure you are debugging against the latest VS build.
I ran into this same issue with VS 2008 and Silverlight 3. If I got it, I just jumped out and updated the app then re-ran it in VS and had full debugging.