Thursday night, I was working on a project built in ASP.NET Core 2.1 (being prepared for ASP.NET Core 2.2) running on my local IIS 10.0 (not IIS Express) and was able to run it without any issue. Friday morning, after heading into the office, I was met with the following error every time I try to run my solution in Visual Studio:
When I open the [file_name].html, I'm given the response:
When I open the Event Viewer, I'm given the response:
I have:
What else can I try because none of my other projects are working either.
I got this fixed by re-installing the Visual studio. Still I'm not sure if this is the best way to fix this.
I've also tried all the approaches mentioned in this question but nothing fixed the issue.
I found the solution.
In the root folder of my team's project, there was an empty "file" file titled "The". For the sake of things, our project is called "The Project" with a space between the words. I removed this file and everything built fine.
My guess is that getting the latest files from our Teams server must have generated a half-formed file and messed with the build of my project.
In my case, the issue is in launchSettings.json.
First, make sure which profile you are running while click run button. my case is 'IIS Express',
Then open the file, go to =>Profiles, make sure the command name in IIS Express profile. my case is IIS. more details about command name.
And check iisSettings in above section. my case is using IIS as command, so I check iis => applictionUrl and sslPort. the issue is here, the application url is using a different domain name. which is different from the launch URL. once i republish the website on my local dev box using the launch url domain, it works fine. BTW, we use host file to fake those domain names.
if you have other team members working on the same project, make sure you all use same settings of the dev web site. or developers can just edit it locally, do not check in the settings if it could not work on other developer's machine.
In my case this issue occurred when I manually cleared the bin folder (which deleted the necessary files in the IISSupport folder) and tried to load the application which was set up as an application under my localhost in IIS.
To solve all I needed to do was to run the application through Visual Studio, which added the necessary IISSupport folder and files to the bin.
In my case, my project was setup as a website in IIS and the file "bin\IISSupport\VSIISExeLauncher.exe" was missing in the project's directory.
I simply selected "IIS" when debugging the project in Visual Studio 2019 and it generated the missing file. It also generated 2 text files (IISExeLauncherArgs.txt, pidfile.txt) in the IISSupport folder, made changes to my web.config file, and my project ran successfully.
After that I was able to access the local website that was setup in IIS without running it in Visual Studio.
User contributions licensed under CC BY-SA 3.0