Error 503 Service Unavailable when using localhost with Visual Studio - visual-studio

I'm posting this to save others a day wasting time trying to solve this.
My PC froze during a build and publish of my web application, so I had to switch the machine off and back on again. This coincided with a Windows Update being applied when the machine restarted.
After this I could not run the web application in Visual Studio, getting a Error 503 Service unavailable.
After trying everything mentioned here and elsewhere on the web, I noticed an app_offline.html file sitting in the solution folder. The file was empty.
I deleted the file and of course it all starts working. This file had been left during the incomplete build process.
So, hope this helps someone else.

Delete the app_offline.html file if one has been left after a broken build and publish process.

If you have IIS. Then go to IIS and click Application Pool, then click on default application pool and the clik on START.

Related

Unable to connect to web sever IIS Express

I am working on project, where I need to have an access to debugging option.
I've tried to run my application as usually, but this time I received following message:
Unable to connect to web server 'IIS Express'
When I checked the console output I found there following note:
Failed to register URL "http://localhost:49748/" for site xxx application "/". Error description: The process cannot access the file because it is being used by another process. (0x80070020)
Successfully registered URL "https://localhost:44333/" for site xxx application "/"
I found also that 0x80070020 error - "in the case of IIS Express (or IIS) means that the port that it is attempting to listen on is being used by another process" (link to the similar question).
I can't understand what's happen here. When I try to run this application I'm receiving this error in my Visual Studio, but the application is starting in the background (I can manually navigate to the https://localhost:44333 and app is there). The problem is that I can't debug the code, cause the Visual Studio looks like 'unrelated' to this instance. Previously IIS Express was opening new browser window with URL of the application, and I was able to debugging my code.
I also can't understand why this problem is not appearing for brand new project - I've created new web app project to test this behaviour, and it does what I expect - I can use debugging in VS.
What I've tried to do so far is:
Restart VS,
Restart my local machine,
Change app url in solution explorer/properties/debug,
Remove applicationhost.config from .vs directory
and nothing works for me.
Before this issue appear I forked this repo: https://github.com/jasontaylordev/CleanArchitecture
and downloaded WSL and Docker - I doubt that this have an impact on my solution, but maybe this information will be helpful.
Is there anything what I can change/edit to back to my previous behaviour?
Thanks
I had this issue after upgrading to Windows 10 20H2. There are many answers I found on SO that did not work for me, but I found this blog that helped me figure out the problem. Try running netsh interface ipv4 show excludedportrange protocol=tcp on the command liine and check to make sure that the port you are using is not one of the excluded ports listed. If so, change it to one that is not excluded. I did this and everything worked as normal again.

Sitecore Setup installation fails with error Failed to open XML file, system error:-2147024786

When running Sitecore Setup the following error pops up:
Failed to open XML file, system error:-2147024786
I've tried going through the eventviewer but to no avail.
Not unimportant is that I used the installer but forgot to change my rootdirectory. As a consequence I had to uninstall (using the same installer Sitecore).
Now however it "feels" as though there are some references or remnants left behind somewhere.
Who has a clue or can give me an idea of what is going on?
You are correct, this issue is because the previous Sitecore instance, with the same name, has not been removed completely. You will need to manually complete the following tasks to remove the remnants and be able to run the installer, it has worked for me in past;
Stop the App Pool for the uninstalled site in IIS
Stop the Web Application for the uninstalled site in IIS
Perform an iisreset in command line
Delete the App Pool and Web app in IIS
You should now be able to completely delete the folder containing the Website and Data folder completely
If you are still having trouble deleting it check the folder's Security Permissions, the Users and their Permissions and Read Only checkbox. Ensure you have control to delete
Delete the relating entry in the hosts file
If you also installed Databases access them via MSSQL Management Studio, take all relating databases Offline then delete them.
This will effectively remove all remanants of the previous site. If what ever reason the issue still persists, Sitecore's own Sitecore Instance Manager has a delete option which will completely uproot the site for you. Try installing with SIM then.

Error: Registration of the app failed

While trying to deploy an app from Visual Studio, I'm getting an error. I have already set developer mode and also deleted the app package from the packages folder, but it still won't work.
Here's the error message:
Error : DEP0700 : Registration of the app failed. Deployment Register
operation with target volume C: on Package
App_1.0.0.2_x64__m0fsgersa29a0 from: (AppxManifest.xml) failed with
error 0x80070002. See http://go.microsoft.com/fwlink/?LinkId=235160
for help diagnosing app deployment issues. (0x80073cf9)
Do I need to set anything else?
I got this when attempting to debug a project from a shared folder.
Opening the project from a local folder first resolved the issue.
I know there is already an accepted answer, but I had a totally different problem with the same excact error message. When th app was running I took a look in the SQLite database with a program that I didn't close when I uninstalled the app and re-run it from Visual Studio. I think that Visual Studio couldn't overwrite the database as I was 'using' it.
Closed the program and voila the app run smoothly.
Hope this helpes anybody else as I was stuck for precious hours!
In Windows 10 there are two possible cause of this problem are as follows,
Previously installed app is locked and preventing VS to delete while deploying the application. Goto C:\Users\{you user}\AppData\Local\Packages and delete the folder of your application. Now rebuild and deploy your application.(this was the solution in Windows 8 devices as well)
If it is still not working, double check if you have removed the below entry from appxmanifest file. If you are targeting Desktop Name="Windows.Desktop" entry should be there in the file. If it is Phone, Name="Windows.Mobile" should be there in the TargetDeviceFamily. You can have both in the configuration but sometimes Microsoft will suggest to keep separate configuration when you submit the application for STARTS testing.
< Dependencies>
< TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
< /Dependencies>
Hope this help in figuring out the reason and solution for "Error : DEP0700 : Registration of the app failed" error.
Don’t worry, the solution is actually very simple.
Error: DEP0700: Registration of the app failed. An internal error occurred.
So you’ve started your Windows 8 app development journey. All things are going smooth until one day you hit this error when trying to run/debug your app. The error says “Error: DEP0700: Registration of the app failed. An internal error occurred with error 0x80073D05. See http://go.microsoft.com/fwlink/?LinkId=235160 for help diagnosing app deployment issues. (0x80073cf6)”
This is a very cryptic error and does not give you any info about what the problem actually is. The problem is that Visual Studio is not able to delete the application data in your local packages folder.
Don’t worry, the solution is actually very simple. On your Windows 8 machine, go to C:\Users\\AppData\Local\Packages\ folder. There you will find a folder that has your application’s Package Family Name in it – you just need to delete that folder. The issue is that while your app is in development, it might have a random GUID as its Package Family Name, so the folder will also have that random GUID as its name which makes it hard to know which folder belongs to your app. Again, that is easy to find as well. Right click your project in Visual Studio and click properties. The value you see in the “Package Family Name” field is the name you should look for in the folder. Simply delete it and build your solution again and it will run like a charm.
Read more details at http://paraswadehra.blogspot.com/2012/12/error-dep0700-registration-of-app.html
For me this was caused by being signed in with my Microsoft account in windows instead of the local user account. Logging in as a local user fixed this.
DEP0700: Registration of the app failed
For me the error DEP0700: Registration of the app failed, was raised because my Store App was installed from the actual Microsoft Store. I had to uninstall it and then I could debug my app smoothly.
I got this when I tried to run the project from a ReFS filesystem. Running from NTFS worked. My error code was 0x80073cfd.
I stumbled over the same issue today and after a few hours I found out, that the problem was because I moved the AppIcon files into a subfolder and forgot to adjust the references inside my package.appxmanifest. Unfortunatly the corresponding error message didn't point into this direction and all the above mentioned solutions didn't help for me, so hopefully this helps someone else!
In my case, I was opening one of the App files (Log Files). When deploying, Visual Studio attempts to remove all the files and packages (if uninstall is on in the properties). It was unable to remove the Log file as it was opened. When I closed all files, and tried again, it worked.
I ran into this error when testing some code in domain-bound and non-domain-bound scenarios (which requires me to have a domain account and a non-domain account on the same machine).
I found that I had to uninstall the application from the account I originally deployed it from before I could deploy it again on the other account.
My problem is that there is another Microsoft account in my computer that installed the app from Microsoft Store.
Nothing from the provided solution helped.
The only thing that solved my problem is to delete that account that I installed the app there.
SQLlite database might be opened. Just close the sqllite and try to deploy again.

Error While trying to run Project : Unable to start debuggeing on the web server . The project is not configured to be debugged

i have created Project with Visual Studio 2003 and when i try to run my project i faced this problem .
i was search about it and read all solution that related to this problem but no luck
so please any help will be appreciated
I have found the solution to this error recently. It occurs basically due to a mess up in configuring your application in the IIS Server.
Make sure the following things are intact and your error will disappear:
Virtual directories in IIS need to bear the same name as its original application directory.
Check if your application pool is stopped. If so, start it. Also make sure the framework of the pool matches with that of your application.
Clear Temp files, Temp ASP files and restart your IIS.
Happy coding!

MVC3 Ap in Visual Studio 2010- Changed to use Local IIS Web Server and can not get it back to VS dev server

I changed from running Use Visual Studio Development Server to Local IIS Web Server becasue I read it would create the virtual directories properly - it did not - once I navigate out of the account area I get
HTTP Error 404.0 - Not Found
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.
Requested URL
https://localhost:443/xxx/Index
Physical Path
C:\inetpub\wwwroot\xxx\Index
I have been googling and trying to get it to work, but can not and can no longer debug - Now I am trying to change it back and it keeps starting in Local IIS Web. I have HOSED myself and don't know where to go from here.
Thank you
In terms of getting back to using the VS web server you should just need to:
Right click on the web project in VS
Selection properties
Go to the web tab
Select "use visual studio web server" radio button
For the sake of not leaving questions unanswered, I tried all of the suggestions above, and many more, and got nowhere. I was in an early phase at the time, and I had to move on, so I ended up creating a new solution, and porting things over. Not the best idea, but I had to go forward, and I had taken enough time. It is still living on my machine, and I plan to go back and figure it out at some point. Hopefully, I'll have more understanding and will be able to post what I did wrong so someone else can save some time. Thanks all for attempting.

Resources