Visual Studio 2013 Asp.net Razor v3 website unable to host to IIS windows 7.5 - iis

I am trying to host a asp.net razor v3 website to IIS, but it is not working. I tried multiple options including first creating the website then publishing to IIS, or directly creating a new website under IIS using visual studio 2013. It gives me HTTP Error 503. The service is unavailable.
Methods to reproduce Error:
Option 1
1) Create a new asp.net web site (razor v3) in visual 2013, and click publish to publish to a directory. Then, add that directory as a website in IIS.
Option 2
1) On the new website window, in visual studio 2013, go to browse and select IIS, and create a virtual directory directory under IIS to save the site.
Then, go to the browser and try to access the hosted site: localhost/sitename, it always produces some kind of errors. Like 503. What am I missing? Please help, looks like I am missing some steps or some configuration changes.
Also, I am trying this with the default razor v3 webiste content and without modifying anything. So, I have not touched any files or anything, I am just trying to upload to IIS.

The correct answer I found was that for some reason you must use the IIS Express 8.5 to test/host that site.
Even the installations on the fresh copies of Windows with Full IIS prior to version 8 did not work on my test machines.

Related

How to switch ASP.NET Core MVC application from IIS Express to local IIS after allowing Visual Studio to generate IIS certificate?

I had a previously running ASP.NET Core MVC application working fine on local IIS in Visual Studio when I hit the PLAY button, however some other sites and applications I was working on, on the same computer, did not run on IIS Manager when browsing directly to them from IIS manager or running them in Visual Studio.
Most applications that uses HTTPS for example mentioned that the "Remote Certificate is invalid for the validation procedure message". Yet for some other sites that used IIS Express, it worked fine.
What I have done to try to fix this is:
Removed the original IIS Self Signed Certificate from IIS Manager
Then deleted the website that was working fine
I then used GIT to clone the repository the application is located in
When I opened the solution again that previously worked in Visual Studio it gave me the following message about creating a new IIS Certificate:
Message I get when opening visual studio after deleting the already Self Signed IIS Express Certificate for Local development
Initially I hit YES to this which may be the cause of the problem
Now when I run the application that previously was working and seemed to be using LOCAL IIS, it keeps defaulting to IIS EXPRESS I can see beside the play button
Is there anyway I can put this back to running on LOCAL IIS for my ASP.NET Core MVC application? I cannot see it listed even in the IIS Manager on my computer.
Thanks
Henry

Debugging multi-site web applications in Visual Studio on Windows 8.1

I have a multi site Azure based web application. One site contains the web pages (with the view functionality driven through jQuery, Raphaƫl, and HTML) and a thin WCF service. The second site contains a more functional WCF service which in turn calls the data objects that call the database. We stopped development on the site a few years ago but it is still live for the few people who still enjoy using it.
Yesterday I had to fix an cross-site scripting vulnerability someone had reported on the site.
I was alarmed to find that I can no longer run the sites on my local machine under Visual Studio to test and debug any changes before deploying them to Azure.
Because of the interaction between the two WCF sites I had the local debugging set up as follows:
In the Internet Information Services Manager tool (InetMgr) I add additional websites with their physical path set to the location of the source code in the TFS local path on my machine.
I edit the host name in the site's binding to mimic the Azure location, i.e. the main site is projname.cloudapp.net:80 on Azure and projnamelocal.cloudapp.net:80 in my local IIS and the data WCF site is projname-wcf.cloudapp.net:8080 on Azure and projname-wcflocal.cloudapp.net:8080 in my local IIS. (N.B. The main site has a HTTPS binding too.)
I edit C:\Windows\System32\drivers\etc\hosts to include the lines
127.0.0.1 projnamelocal.cloudapp.net
127.0.0.1 projname-wcflocal.cloudapp.net
In Visual Studio I edit the web properties for the main site's project so that it uses the local IIS and project URL http://projname.cloudapp.net/ and I have a switch (in the code to say whether to call the local WCF or the live Azure one.
In the past when the project was under active development this set-up worked fine for locally testing and debugging. Yesterday it failed, one one machine http://projnamelocal.cloudapp.net/ gave a 503 error on another a 404. (N.B. I can ping each URL from the command line so the hosts redirect is working.) Visual Studio complains that it is "unable to start debugging on the web server" and that it "could not start ASP.NET debugging".
I've tried all the suggestions and some:
Running without debugging
Running Visual Studio as administrator (I was already)
Re-registering ASP
Changing the app pool
Giving everyone full permissions to the code directory
Running as my own domain account that is an admin on the local machine
Changing IE to not auto-detect proxies
Adding the sites to IE's list of trusted sites
Turning off IE's protected mode
Restarting Visual Studio
Restarting the PC
Restarting the PC again
How should I set-up this style of running, testing, and debugging local sites work in IIS under Visual Studio?
Got it.
I had forgotten to go to Control Panel > Programs > Turn Windows features on or off > .Net Framework 4.5 Advanced Services > WCF Services > HTTP Activation
Now that I have that installed the local sites start

Why websites created in WebMatrix not visible in IIS?

I have windows 7 home premium. The version of IIS is Home Premium 7.
I have created a website using DotNetNuke through WebMatrix. The files related to the website are created under the "My Documents" folder. However, when I open the IIS window, I do not see any website that I created in WebMatrix through DotNetNuke. Following are my questions:
1) I would like to understand how WebMatrix configures the website to be run without the website being visible under the IIS console?
2) Where does WebMatrix stores the configuration i.e the port assigned to Localhost (In my case it is localhost:32189)
WebMatrix does not create sites under the full version of IIS. It uses IIS Express. If you want your site to run under the full version of IIS, you need to configure that yourself.
You can usually find the IIS Express configuration file in C:\Users\<your-username>\Documents\IISExpress\config\. Its a file called applicationhost.config.

Configure Aptana Studio 3 with Local IIS Server

I am very new to web development and so I am also very new to Aptana Studio and IIS. I just installed both on my computer today. I read instructions on Aptana Studio's help system about adding a web server, but it does not seem to work for IIS.
I have IIS 7 running locally on my machine. In Aptana, I went to Servers --> Add Server --> Simple Web Server. Then I gave it the following parameters in the dialog:
Name: IIS
URL: http://localhost:80
Document Root: C:\inetpub\wwwroot
The server then appeared in the Servers View, but status was N/A and the preview of any website would still use the built in web server included with Aptana.
My Google searching has not found any more specific instructions for configuring Aptana with IIS.
I have had some success by going to the Debug Configurations, from there you can switch the launch location (and browser executable) with a combination of radio buttons. To access the menu, click on the pull down next to the debug button.

Create a web application on IIS when using a Web Site (the microsoft version)?

sorry for possibly a very stupid question.
I have one of those Visual studio Web Sites ( ie not a web application) ,
is there any way I can automate the creation of the IIS Web Application that points to the web site within Visual Studio ( ie then when developers open the solution, the IIS site will be set up automagically?
Sorry, just not famiiar with the Web Site side of things
Thanks
AFAIK It's not someting Visual Studio will do out of the box. What you could do is create a batch file that creates the virtual directory then opens the solution. Store it in source control and your developers will be able to run it instead of opening the solution directly.
There are a few options for creating an IIS virtual directory automatically - see this and this.
Also - if you are using VS2005 or above you could change you application to use the development web server instead of IIS and then you won't need to mess around with virtual directories at all. Select 'Use default Web server' on the 'Start Options' section of the projects property pages.

Resources