The Application is configured to use IIS (Visual Studio 2017/2019) - c#

**Hi Guys I just Cloned my project from a repository.
I am getting this Similar error
The Web Application Project […] is configured to use IIS. The Web server […] could not be found.
I do have IIS Manager on my pc. one of the solution is to set True on my cs.proj file but when i do it auto imports a port number. when i try to run the application with that port number the application hangs(load forever).
What are possible ways to solve this error ?**

Just to register an answer for all getting into the same problem under the same scenario, as we discuss and resolve it from the question's comments:
Ps: as i said this solution works for this particular scenario, maybe anyone else has to apply a different approach!
In this case, try to follow the below link for other solutions!
The Web Application Project [...] is configured to use IIS. The Web server [...] could not be found.
Reset the IIS; (https://learn.microsoft.com/en-us/visualstudio/debugger/error-the-web-server-is-not-configured-correctly?view=vs-2019)
Publish the project;
Add it to IIS Server;
Run it using IIS Local (not the IIS Express)

Related

asp.net core app deployed on iis meets 500 internal server error

:( Oops.
500 Internal Server Error
An error occurred while starting the application.
This message came out when I added database functionality to my asp.net core app and deployed it to iis. When I developed it in Visual Studio, everything went well. But after deploying, this error messages appeared.
I tried to use dotnet myapp.dll to run my app in the deploy folder, and found out it worked well. It is likely that the problem is relation to iis. I tried to add <compilation debug="true">..</compilation> to web.config, but it seems useless. What is problem are actually, or is there any other way to see the detailed error info to help find out what's happened?
Change stdoutLogEnabled="false" to true and then check the logs at stdoutLogFile=".\logs\stdout". The error(s) there might tell you something.
Check that you set up right Environment Name using ASPNETCORE_ENVIRONMENT environment variable as so use correct settings like connection string. On your machine by default you have "Development" environment.
You may use Error Handling middlewares for showing exceptions like
app.UseDeveloperExceptionPage();
Had the same issue. Here is the guide that helped me. Note, that I did not want to install the "Runtime" on the web server, but rather deploy all the necessary files as a stand alone app. Below are the steps in a more abbreviated form:
On your local PC, Determine which version to publish based on your server. I was targeting Windows Server 2008, R2 which meant i needed to publish win7-x64. Open a command prompt in your project directory and run the command below:
dotnet publish -c release -r win7-x64
This creates a publish folder containing hundreds of dlls, an .exe, and web.config located here: bin\Release\netcoreapp2.0\publish
On the web server with IIS, go to this landing page. Click the link for your desired version. Find the link for the Runtime and Hosting Bundle. Click to download and run.
Restart IIS by running this from an elevated command prompt:
net stop was
net start w3svc
Copy all of the files in your local publish folder to your desired application folder on the IIS server.
On the server, Open IIS, and create a separate AppPool and Application like normal. For the AppPool, under Basic Settings, change the .NET Framework version to No Managed Code. Make sure your Application in IIS points to your desired folder and the proper AppPool.
Test your web application in a browser.
In my case, I got this because I hadn't actually installed the latest 'DotNetCore.2.0.0-WindowsHosting.exe' on the windows server I was running it on... so it was working fine on my local machine in debug and error five hundy'ing on the server.
I had other non trivial to fix issues with the upgrade also... I'd advise avoiding it if you can.
Mark333's comment below solved my problem.
Quoting for easy reading:
"I'm using the normal publish provided by Visual Studio. And, I just
found out using the latest version of Hosting Bundle will fix the
issue. +1 on this
microsoft.com/net/download/dotnet-core/runtime-2.1.0-rc1"
I had to install for 1.1 since my app is a little older, but Hosting Bundle fixed it. In my case we deploy to a Docker image for our official environment, but when I want to do some testing locally I publish it and let my local IIS serve it up.
My problem was solved installing .netcore latest: https://dotnet.microsoft.com/download/thank-you/dotnet-runtime-2.2.2-windows-hosting-bundle-installer
https://learn.microsoft.com/pt-br/aspnet/core/host-and-deploy/iis/index?view=aspnetcore-2.2#install-the-net-core-hosting-bundle
Worked like a charm!
I had installed DotNetCore.2.0.5-WindowsHosting.exe on a Windows 2008 R2 Standard machine and encountered the same http 500 error. Logging didn't help (blank logs were generated - and Event Viewer logs were the generic ErrorCode = 0x80070002)
I had to do two things to solve my problem:
Give Read rights to the ApplicationPoolIdentity user (EG: IIS APPPOOL\AppPoolIdentityName) to the website directory and the application directory
I had to install IIS ASP Core under Server Manager (this felt weird, but it worked!)
I had the same issue.
My problem was that my connection string to db was not set in appsettings.production.json
And the internal server error 500 was to vague error message.
Changing the stdoutLogEnabled = true did nothing to me so i was not seeing any information about the error.
Make sure the App Pool has permissions to the folder where your app resides.
I experienced this issue. The problem was due to my local Sql Server instance. Remote connection were not allowed. So I manually restarted the SQL instance and my App restarted working fine.
I had similar issue after istalling dotnetcore-windowshosting using chocolatey while doing AWS ec2 instance bootstrapping.
When I checked my IIS modules AspNetCoreModule was missing.
This solved my issue. https://github.com/aspnet/IISIntegration/issues/434
I had to uninstall chocolatey package, restart machine and install it again.
Hope this helps!
In my case, I created a .NET 5 single file output, and I was getting:
500 - Internal server error.
There is a problem with the resource you are looking for, and it cannot be displayed.
The problem turned out to be that the EXE file was for some strange reason recognized as a virus by the protection software (CrowdStrike Falcon). Re-building without "single file output" option solved that problem.
There is an article called "Configuring IIS, ASP.NET, and SQL Server" which I highly recommend.
I followed the steps described there and my asp.net core app now communicates with my SQL database (after being published to IIS):
https://www.codeproject.com/Articles/674930/Configuring-IIS-ASP-NET-and-SQL-Server
It also happens when you install dotnet-hosting-bundle/dotnet runtime beofore IIS.
In this case re-install dotnet-hosting-bundle/dotnet runtime.
To be able to see the excetion's detail I just needed to change the ASPNETCORE_ENVIRONMENT to "Development" in the "IIS Express" profile in the launchSettings.json file. I aldo needed to create the corresponding appsettings.Development.json file to set the variables and data needed in my App. When the environment is Development net core send the detail exception by defaul. As we can read here in the official documentation.

LibSass.x64 not found on Azure VM (virtocommerce)

I new to ASP.NET development and I have managed to deploy VirtoCommerce to my local machine IIS (windows 8.1) following the documentation on http://docs.virtocommerce.com/display/vc2devguide/Deploy+web+applications+to+dedicated+server .
When I tried to deploy it in Azure VM running Windows server 2012, I got the following error when I tried to run the frontend page. The dll mentioned below is definitely in the /bin folder of the store.
Server Error in '/' Application.
Could not load file or assembly 'LibSass.x64' or one of its dependencies. An attempt was made to load a program with an incorrect format.**
I followed the link
Could not load file or assembly 'LibSass.x64' or one of its dependencies in VirtoCommerce but found no luck. What did I miss on this deployment ? Any help is much appreciated, thank you.
Are you running 64 but machine and IIS Application Pool as 64 bit? If not, make sure to go to IIS and configure pool settings to run as 64 bit process. The easier approach will be to follow the guide here: http://docs.virtocommerce.com/display/vc2devguide/Deploy+from+GitHub+to+Microsoft+Cloud+Azure which will setup Virto Commerce as a website in IIS with all correct configuration for IIS. You can then update it manyally by simply uploading site through FTP if you want. You can also clone the repository on GitHub and that way your azure site will auto update on every checkin.
I was able to reproduce this error on a clean Windows Server 2012 Standard. It turned out that Libsass.Net requires Visual C++ Redistributable Packages for Visual Studio 2013. After installing the vcredist_x64.exe the error has gone.

publish .net mvc to a remote windows server

I am facing a problem publishing an mvc webapi to a remote server. Currently i have deployed the website to the server and am I able to run the site in the windows server browser as a localhost however when i try to access it over the internet thought the public ip address i get a 404 error of file not found.
The port is open. i'm using iis 7.0 and windows server 2008.
I have checked all the bindings to the port! I tried to check if mvc is installed and all I read says that mvc comes already with iis 7 and webplatform installer says that .net 4.5.1 is installed
Any ideas how to solve this?
Just some simple ideas of how to resolve it. Hope they are usefull.
a) Check the app pool of the application. Set it to the correct .NET framework if required.
b) A very simple test I perform to see if its the app or the url.
- Stop the app.
- Place your app in a folder temporarily.
- Place a simple index.html HTML file where your app should be.
- Browse to it and see if 404 shows.
c) if its a new box and not set correctly you might need to set up IIS for Application Development. Check this Link with regards to setting it up. Expand the tree to make sure you select what you need.

Allow others to view local IIS7 ASP web application

I'm working on a Visual Studio 2012 web application, and need to allow colleagues to view the current website by my IP address (while I would access it my localhost). It appears that hosting the site locally through IIS7 and allowing others to access it by my local IP the simplest method. After troubleshooting and experimenting for a day though, I still don't understand the relationship between an IIS7 site/website/application and Visual Studio web application, and the MSDN explanations are really hard to follow.
Basically, I'm trying to understand:
1) How to set up a IIS website and application (should the 'physical path' be the VS solution folder or deployment package .zip folder?, for example)
2) How to most simply deploy the web application (e.g. File System/ Web Deploy/ Web Package, etc.) and
3) The order to do all of this.
I'm running VS as administrator, my port 80 is open, and have IIS7 set to use .NET v4, yet when I publish the selection using File System in VS2012 to my C drive, the resulting site gets a HTTP:500 error, with no source code underneath. (Also, before even publishing, setting the solution to use my Local IIS instead of IIS Express and previewing results in a blank page). If there is a better way to do this please let me know.
Thanks in advance.
If you don't want to learn (or bother) with the details of setting it up, you can use a small utility like 'ngrok' that will allow others to view your website at 'localhost'.
Takes about 5 minutes to learn and get up and running (and its free).
https://ngrok.com/

C# ASP.NET can not reload web application

i can not reload the WebApplication project, i got this message error
i moved the server to another place, so the IP is changed.
i already change the ip on IIS and WebApp config
i already uninstall IIS and reinstall
i already use aspnet_reggis -i
but still i, can not reload the WebApplication.
thanks you in advance
PS: i m sure is because the IP configuration. it work well at my home, now i bring the computer to office...it not work anymore....nothing change just the IP my home is not the same like IP in my office
the error message says: the project web ESPTEMPS_WebApp is configured for IIS, the website is not found.
You most likely need to configure your IIS for your website.
here's a helpful link to do this: http://msdn.microsoft.com/en-us/library/cek8kw6e.aspx
Good luck,
Your application is configured to work with IIS, in your case, IIS is not installed in your system or maybe the developer used IIS Express when developing. (You need to install VS 2010 sp1 to get IIS Express 7.5 integration with VS)
What you can do is:
Close your solution and open the csproj file in notepad (of the project that is giving problems)
Find and set these values:
<UseIIS>False</UseIIS>
<UseIISExpress>False</UseIISExpress>
Then reopen your solution again with visual studio. You will be able to debug with the web developer web server.
I found a very good reference for you. It will walk your through set of steps to help you configure your IIS. Here is the link. Please ignore the steps that are not applicable to you. But basic idea is:
Open Project Properties and go to Web tab
Select local IIS web server. If it is already selected, it will show you a virtual directory. If it doesn't already show selected, then mention the virtual directory.

Categories