When creating a new project in Visual studio 2013 I get an error because they are automatically trying to use IIS express - asp.net

When creating a new Web API ASP.NET project I get the error "Configuring IIS Express failed with the following error: Unable to access the IIS metabase. You do not have sufficient privilege to access IIS web sites on your machine.
The problem with this error is that I don't even have IIS express installed any more so I want to associate new projects with regular IIS. I can manually change the settings of the project by opening it in notepad. But this is pretty annoying and I can't see where to change the default.
Any help appreciated. Thanks.

When creating web project in VS, IIS Express is assumed to be on the machine (because VS puts it there). If you've removed that required dependency, your machine is in an unsupported state. Why not just have IIS Express installed, and change the projects after creating them?

Related

Problems publishing site to localhost on windows 2008 rs server

I must preface this post by saying that I am not an experienced developer, I am in the process of learning through trial and error and a lot of google searches so detailed (step-by-step) feedback would be greatly appreciated. I created a website, which does not use a database, using visual studio 2015 and I am attempting to host it locally on a Windows 2008 R2 server.
I installed IIS and loaded the asp.net v4.0 framework. The site works fine, produces no errors when I test it and works after being published only if the visual studio is still running.
However, when I close the Visual studio and open my browser window to http://localhost:50044 (which is the URL listed in properties menu in VS), I also tried using port :80 and nothing. When trying to add Web Site via the IIS management utility I receive the following authentication error: ”Cannot verify access path (C:\Inetpub\wwwroot).”
I checked the permissions and windows authentication is enabled with read access, and all other permissions seem to be correct. I am at a loss, I'm sure it is probably something simple that I am missing due to my lack of knowledge and experience. Any help would be appreciated.
It's sounds like you are running on IIS express which in your case stops running when you close visual studio. Normal process is create a new website in IIS and point to the folder where your web.config is. You can then hack your host file (C:\Windows\System32\drivers\etc) so DNS works. Add an entry like "127.0.0.1 mytestwebsite.com". I hope that helps
So I figured out part of what was happening. I didn't realize that visual studio has built in IIS and was using that by default.
I ran VS as an admin, created a new project, then attempted to create a virtual directory thru VS under the project/properties/web tab. I selected local IIS and entered http://localhost/boc and it returns an error: unable to create vd. Web server http://localhost... Could not be found.
I then went in to the IIS manager and set up a virtual directory with no issues. However, when I attempt to reference it thru VS I again receive an error message.
Any ideas?

Unable to run migrated web application in VS2013

I have an ASP.Net web application developed in Visual Studio 2008 (.Net 3.5). I have copied this solution to another root folder (both on my Win7 64b machine) and upgraded the copy to VS2013 (Professional) and .Net451, but when I try to debug the web app in VS2013 I get an Access Denied error ("Unauthorized: Logon failed due to server configuration. Verify that you have permission to view this directory or page based on the credentials you supplied and the authentication methods enabled on the Web server"). I don't have this issue runing the original from VS2008 on the same machine.
Apart from the changes mentioned above the two are a straight code copy.
In VS2008 the project Web properties are: Use Visual Studio Development Server, auto-assign port, Virtual path = /
In VS2013 the project Web properties are: Server=IIS Express, Project URL=http://localhost:63064/ (and I have clicked on Create Virtual Directory)
I can see this must be some sort of security issue, but what extra needs to be done to get a VS2008 web app, upgraded to VS2013, to run within the VS2013 IDE?
Postscript: If I start the web app without debugging (ctrl-F5) I get "HTTP Error 503. The service is unavailable."
It turns out that the simple solution is configure the web app properties in VS2013 to use the local webserver (IIS) instead of IISExpress, and also to run VS2013 as administrator (but this is not necessary for VS2008). So obviously it is an IIS permissions thing but IIS is common and hasn't been changed - so what has changed in VS2013 to make this necessary? I don't really want to run VS2013 as administrator if I can avoid that.

Configure Visual Studio 2013 .sln to use Local IIS (Not Express)

I keep getting errors saying that my IIS express has stopped working and I would like to configure my project to use IIS instead of IIS Express. When I run it I can see that is says IISExpress, as seen in the picture below. I tried to research a possible solution and saw that some people were able to go to properties and change the server to use Local IIS but I don't think I have that option available in the same place because I am using a different type of project. How would I be able to configure my project to use Local IIS (and stop receiving these "IIS Express Server has stopped working" error messages).
Thank you
You need to adjust the project properties to point to IIS.
See: MSDN

ASP.NET and IIS 7.5: Creating a virtual directory

I have written an ASP.NET MVC 5 application in Visual Studio 2012, and I am now attempting to run it on IIS 7.5. Following a tutorial, within IIS Manager I have created a virtual directory, whose physical address is the address on my computer of the web application. That seems to work fine.
However, the tutorial also says that an alternative way to create this virtual directory is from within Visual Studio. Again following the tutorial, under the project Properties->Web, I select Use Local IIS Web server, and then type in http://localhost:8010/MyWebApp as the Project Url. Then, after clicking the Create Virtual Directory button, I receive the message The virtual directory was created successfully.
However, I notice that this virtual directory does not appear in fact appear in IIS Manager, even after refreshing or restarting. What am I doing wrong? (Note that Use IIS Express is checked, if that makes any difference.)
Using IIS express is the issue, the IIS manager is for the inbuilt IIS instead.
If you untick that use IIS express box, it will remove the port number and you will create a virtual directory under the main IIS installed.
http://localhost/MyWebApp
Note that VS must be run as an administrator for it to be able to access the IIS metabase, otherwise your web app project will fail to load.
If you are running on a base install, you may also need to install some extra features into IIS to get it working properly.

How do I change where Visual Studio looks for applicationhost.config?

I've looked all over this site and I cannot find the answer to this question.
Basically I'm trying to set up a new site for use with another project I'm working on. This site will run locally on my personal computer and will also be accessible via internet. So I installed IIS 7.5 Express and IIS Manager 7 to host this site. When I went into VS 2012 elevated to create a new site and map it to 'localhost', it pulled up the following error:
Invalid URI: The hostname could not be parsed.
2nd attempt was by creating the site in a new directory by itself inside inetpub, just for the project itself and leaving wwwroot alone. When I do this, I get the following errors:
Filename:
\?\C:\Users\Joel\Documents\IISExpress\config\applicationHost.config
Error: Cannot read configuration file
File system Web sties are currently configured to use IIS Express. To switch back to using the Visual Studio Development server, change the development server option under the Projects and Solutions\Web Projects category of the Tools\Options menu.
When I browse the above location, applicationHost.config does not exist, but when I go to
C:\Windows\System32\inetsrv\config
I find it just fine. IIS Express 7.5 works fine and IIS Manager can find the default site just fine and will even let me browse it using my web browser. What am I doing wrong and how can I fix this so that VS 2012 can create web sites and access the necessary files.
I run Windows 7 Professional x64 and I just finished installing IIS Express and IIS manager. I configured VS 2012 for Web Development. I ran VS as Administrator (elevated) for all of this.
Okay, I found the solution. I needed to manually set Visual Studio NOT to use IIS. Not sure what the issue is there.
But the solution is here for everyone else having this issue.
It was right there, I'm sure, when I was setting it up initially and I just missed it. After doing that, I could set up the new website to use the file system, which would bypass IIS anyway, but the setting to use IIS was conflicting with the bypass, which caused the error.
Hope this is superhelpful!

Resources