VS2010 ASP.NET web app solution unavailable issue - asp.net

I have an ASP.NET project managed in the VS 2010 IDE. I constantly copy it from one development machine to another. By its nature this ASP.NET project must run on an actual IIS. One development machine has a local IIS configured but I couldn't set it up on a second machine. The project is set up to Use local IIS in its properties. The issue happens when I try to copy this project from a machine with the local IIS to the one that does not have it. When I load it up in VS 2010 the only thing I get in the "Solution Explorer" is <SolutionName> (Unavailable) and I can't do anything, even open up its properties. The only way to fix this is to go back to the first machine and set up this project to Use Visual Studio Development Server and then copy it.
Is there any way to do this on the destination machine without this route of going back to the first computer?

Related

How does the view in browser option work in Visual Studio without IIS?

It seems like the View in Browser option doesn't really require IIS and it seems to process ASP pages fine. So how does it really work without a web server?
They used to have a developer web server (Cassini) which is dead long time back so is there some kind of built in capability in visual studio? Who processes the requests by asp pages if it doesn't require IIS?
I already have IIS installed so I am not sure if is servicing the pages but seems like it will work without IIS because I don't configure anything in IIS and new ASP.NET projects work out of the box as well View in Browser option for an asp page option which just directly executes that page.
Actually this is what occurs:
Your web web.config is copied.
Then VS spools up a WHOLE running copy of IIS (it is the express version - but it is the same for the most part as the full edition of II).
Once VS spools up and starts and configures that running copy of IIS?
Then your web page and web application can run. If you look at your system try, you see this:
So in above that 2nd from the left in the tray shows that blue thing icon. I have right clicked on it to show the options you see.
So now you have a running copy of IIS on your computer. So you ARE running a full web server here. (well, ok IIS express - but the base parts and what that means is much the same as the full edition).
Around about VS version 2010, they USED to have a smaller built in web server as part of VS. The problem of course was for Microsoft to maintain 100% compatibility was VERY hard. So while for a considerable time frame and history of VS? Yes, they had a built in web server as part of VS. But they dropped it a number of versions ago in VS, and as noted now use IIS express.
So Now? Well, when you install VS, they also install a working copy of IIS. (the express version). The express version is quite much the same as the full pop edition of IIS. What is removed is "most" if not "all" of the IIS management screens and setup. (and sometimes I wish they would just install that part too!).
Your experience thus that a copy of IIS is launched. Once launched IIS does keep running during your development process (depends on your VS config and setup). But, if you go file->close solution, then you find that IIS express then also shuts down.
So, to view that web page? Yes, VS does config, and then does spool up and start internet services and that web server. So this running of IIS on your computer is what allows those web pages to work and run correctly. As noted, while this is a copy of IIS, it is for the most part the same as the full edition - just with most of the management tools removed. As noted, you SHOULD see that new icon appear in the system tray.
And as noted, I believe around VS 2010, they made that switch from the VS built in IIS to that of now using IIS express edition. As noted, this change was made to ensure a greater probability that when coding and debugging your web site in VS, that the end result will be much the same when running a full edition.
I do find that over time, the production (web hosted site) does get so many config and tweaks and changes, that I now can't include my web.config file in the publish (can't risk overwriting the server production web.config). So, over time, we added things like https security certificates and installed them, and set them up for the production web site. I don't have those same security certificates setup on my local machine. And of course there are some virtual folders and few more things that exist on the production web site as opposed to the dev copy I use. So, it somewhat my fault to let the production web.config over time to become "different" then what I run local when coding and debugging the web site. So now, when I publish - I remove the web.config file before I actually copy the new updated web application to the final production server (which of course is running the full edition of IIS).
But to make a long story short?
Yes, a whole copy of IIS web server is configured for you, and that whole copy of IIS is spooled up, launched, and once that occurs, then your web page option "view in browser" can run. But make no mistake here - IIS services is setup, is started, and is running for that web page preview to occur.

Strange LocalHost Behaviour for ASP.NET 4.0 site

I have a folder MyWebSite. I open it in Visual Studio 2010 and browse using the local webserver. It runs fine.
Now when I create a copy of the folder, open the website in Visual Studio and try to run it from there, it says:
This page can't be displayed. Make sure the web address http://localhost:21926 is correct.
What seems to be the problem?
Create a separate application pool and virtual directory for each. Your original site name is tied to a particular port because you are using the built-in server. Better to develop against IIS.
Please make sure you close Visual Studio and the instance of the ASP.Net Development server before you re-launch visual studio with the other folder.
In case you are trying to run both instances together, you might get such as error.
You could also try clearing the ASP.Net temporary folders and see if that solves the problem.

Can't start ANY ASP.NET projects

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.

ASP.Net local debug on a Windows Server 2008 R2 Terminal Services Server

We have a Windows Server 2008 R2 box setup as a Terminal Server with Visual Studio 2012 installed on it for remote developers to be able to do development on our ASP.net systems.
We would like to be able to do debugging on out projects the same way we do when developing on our local machines using visual studios internal development server.
I am trying to start local debugging on an ASP.Net project (F5) in VS2012 - the project compiles - IE comes up with my localhost url and then it just spins with "connecting..." and the page never comes up.
Pulling up the same workspace on a local machine and debugging comes up just fine.
I've exhausted my google-fu on looking for solutions here and humbly ask you all for any insight.
Visual Studio works a little differently when you are debugging on a server. You don't really want to use VStudio to play/debug on a web server. You need to use the menu option "Debug", "Attach to process". There will be several processes running, so it might take a few tries to find the right process.
Be careful though. Because your break-points will actually freeze IIS for the entire server. It could be a pretty big inconvenience for everyone who is using IIS at the time.
If you are trying to debug the project from your IIS server, you need to verify if the account has Administrator rights, also if the project has been deployed with its source files, you can attach the process (maybe it is w3wp.exe) in Visual Studio and debug it.
Another way is to open the solution using Visual Studio and change in the web project's property the server: Use Visual Studio Development Server.
Let me know more info about your scenario to provide you more paths.
What I would do is attach to the IIS process on the server: http://msdn.microsoft.com/en-us/library/vstudio/3s68z0b3.aspx you can even do this off your machine.
make sure debug is enabled in web.config for that app and you've mounted the remote project. Add a break point, debug by attaching to the IIS app pool process & it'll trigger the break point.
I was able to Attach Process to the SPUCWorkerProcess.exe even though it's a farm solution and not a sandbox solution

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.

Resources