Can't start ANY ASP.NET projects - asp.net

I've been trying to fix this for quite some time now, but I simply can't make any ASP.NET projects in Visual Studio Express 2012 for Web. I get this error when I start a new project:
Web application projects 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 Options menu. Configured IIS Express failed with the following error:
Filename: redirect.config
Error: Cannot read Configuration file.
So I went on the internet to try and find others with the same error but I can't find a concrete solution to my problem. I find something similar for older versions, but it doesn't fix my problem. I do have the IIS Manager up under my Services (When you want to Manage Windows). I even made a virtual folder, but to no avail. Still doesn't work.
I want to use IIS
How do I fix this?

In Solution Explorer, right-click the name of the Web application project for which you want to specify a Web server, and then click Properties
In the Properties window, click the Web tab.
To choose the Visual Studio Development Server, under Servers, click Use Visual Studio Development Server.
To use a specific port number with the Visual Studio Development Server, select Specific port and enter the port number. By default, the Auto-assign Port option is selected, and the port number that has been assigned to your application appears
To choose IIS, under Servers, select Local IIS Web server. This option is not available if IIS is not enabled on your computer. A URL that combines localhost with the name of your Web application will automatically be created for you and appear in the Project URL box (for example, l ocalhost/WebApplication1).
To choose IIS, under Servers, select Local IIS Web server. This option is not available if IIS is not enabled on your computer. A URL that combines localhost with the name of your Web application will automatically be created for you and appear in the Project URL box (for example, loca lhost/WebApplication1).
To choose a custom Web server, select Use Custom Web Server. In the Server URL box, type the URL that Visual Studio should start when it runs the current project.

You may for example open you project file in notepad search for the string <useiisexpress>true</useiisexpress> replace it with the string <UseIIS>True</UseIIS> save and reload the project.
Make a copy of the project file first though.

Related

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.

Deploy website from a Windows XP Desktop

On my Windows XP desktop, I have a fairly simple ASP.NET targetting .net 4 in Visual Studio 2010. I can run it on my local host by ctrl + F5, it works all fine.
I have a Windows Server 2003, that I can access via mstsc, but also via Explorer. When I go to the publish section of my build properties, i see 4 publish methods :
Web Deploy, FTP, File System, FPSE
I have already installed IIS 6 successfully on the Windows Server, and given all authorizations for everything I could so far (to get things to work in the first place, will check on that later).
How should I proceed to publish to that remote machine ? Should I target a specific folder ? Do I need to setup things in IIS 6 for that site first ? Or will it all get settled from te properties I have in Visual Studio ?
Thank you guys,
J.
Personally I've always plumped for a manual deployment; that is I create the Web Site in IIS creating an appropriate AppPool and targeting the correct .NET version to utilise. From there simply copy (xcopy if you will) the appropriate files over, e.g. DLL and all supporting pages such as ASPX, CSS and associated images. In most situations where I have direct / RDP access this is what I run with.
That said, this can be automated from Visual Studio and this can be useful for those situations where you're maintaining an awful lot of sites on a regular basis. With IIS 6 and Visual Studio, this was achieved by installing FrontPage Extensions on the server then utilising the Publish option.
For VS2010 it seems this has been streamlined using the IIS Web Deploy module and configuring the Studio to publish in this manner that looks mildly quick...
HTH
I've never used the Web Deploy feature in 2010, so I can't really tell you about its merits or drawbacks. I've read that it works much better with IIS7 than IIS6. If you have direct access to the IIS root folder on the server (typically c:\inetpub\wwwroot) through a network share I would recommend doing the file system deployment. FPSE works as well if you have to publish to the server through a remote URL, but there are some security issues with FPSE that make enabling it on your web server a less than ideal choice.
Once the files have been deployed, all that should be left is to configure the website as an application inside of IIS.
Remote in to the web server and open IIS
Right-click Default Web Site and choose properties (if you've deployed to a subfolder in the root, then locate that folder and choose those properties instead
Switch to the Home Directory tab (Just 'Directory' for a subfolder)
Look for the Application Settings section and click the button that says Create
Optional: Select an app pool if you have created a custom one from the default
That should enable IIS to execute your .aspx files inside of your application. Once you've successfully configured the app for the first time, you can just keep publishing your app to the same location over and over without having to reconfigure it.

Setting Up A Website App On The Shared Network

How do I setup the project on the network instead of localhost? I want to setup a Remote Site, I think is the lingo
Go into visual studio
File, open website and put the website name in the box and a password to open the source.
Create a unique url name like myWebApp.mycompany.com
When I create a new website application in visual studio. When I am ready to debug Visual Studio sets all this up for me and it runs on local host automatically.
I guess in my scenario I gotta set it up manually. How do I accomplish this?
I created a new virtual directory, went through the permissions wizard and keep getting this error:
Failed to access IIS metabase.
If you are trying to deploy somewhere you can access via a windows share, it is often easier to just deploy to disk by publishing to the file system and setup the IIS bits manually. In that case, you'll need the name of the server and a share to push to.
Setting the url will be configured in IIS where you host the web app. When you are debugging in visual studio it is running a copy of the web app locally so you can test it. You shouldn't be trying to host the web app within the visual studio debugger.
To configure this you will need to set the host header for the website to myWebApp.mycompany.com. This will tell IIS that incoming requests with this domain map to this website.

how to load webapplication on server

I have made a web application using Visual studio 2008. till now it was running on my local host..
Now i want to load it onto the server so that it can run on my company server.
How do i do that..??
Thanks
In visual studio:
Under the Build menu, select Publish
In the publish dialog, select a location to publish your application to
ex: \\server\c$\inetpub\wwwroot
Set your publish options. I reccomend using the "Only files needed to run this application" setting
Click the Publish button
You will have to mark your deployment directory as an application in IIS for IIS to run your code. See this MSDN article for details on how to do this.
You just need to copy it into the IIS directory on that server, usually c:\inetpub\wwwroot. Make sure you have asp.net installed.
You can use the project menu and copy it to a remote server (specifically the machine that will host this project, in addition a web server). Or you can just go to the remote machine, add a new site and store the .aspx pages and all related images on the web servers inetpub\wwwroot folder.

Why does ASP.NET show this error?

I have installed Visual Studio .NET 2005. But when I am trying to execute an asp.net application then I am getting the following error:
Unable to open the Web 'http://localhost/adiii'. Could not find a Web server at 'localhost' on port 80. Please check to make sure that the Web server name is valid and your proxy settings are set correctly. If you are sure that everything is correct, the Web server may be temporarily out of service.
Click here to view screenshot of the error I am getting
Can anyone please tell me the solution of this problem. As we know there is embedded Web deployment server inside VS2005 then why its giving me this error??
It looks like when you created the project, you selected HTTP for the location instead of the default, File System. HTTP means you have an existing web server (not Visual Studio) that you want to run and test your project on (and where Visual Studio will attempt to find your source code).
Create a project and select File System to create a project on your harddrive that will be run using Visual Studio's internal web server (you can then publish/deploy the project to a real web server when you want)
Are you explicitly have defined that the internal web server should run the application on port 80?
The default behavior is that it runs on a random port.
If your settings are ok, then it might be a port conflict with another web server on your machine (Apache, IIS).
Sometimes even a Skype can okuppy port 80 and cause similar problems.
Update:
Now i see - you're using Web Site project, and we assumed you're working with Web App project instead.
In this case, the procedure is slightly different:
You select the project in Solution Explorer and open Property Pane. Here you should be able to identify two properties for the project: Port number and Use dynamic ports. I assume your first property is set to 80, and second one to false. Change the second one to true and you should be able to fix the problem.
There's a very good chance that you created the project in VS2003 and upgraded it to VS2005. VS2003 uses HTTP (a local installation of IIS for example), whereas VS2005 projects use the built-in server -- most likely, the upgraded project is still trying to use the local IIS which doesn't exist.
Do this: Right click on your project, choose "properties", and navigate to the "Web" tab on the window which pops up. You'll get a screen which allows you to choose which server you want to develop on, then make sure the buttons next to "Use Visual Studio Development Server" and "Auto-assign port" are checked.
Here's a visual reference if you need one:
http://img24.imageshack.us/my.php?image=confignw0.png
You should be be good to go now.
Visual Studio does have an embedded web server, but it never operates on port 80. Your URL clearly points to port 80.
The most likely problem is your program itself working inappropriately, but without code I can't help much more.

Resources