Pull iis .net sites into visual studio - asp.net

I've recently inherited some old code that needs some work, and I need to know how to pull existing iis websites into visual studio (2017 pro) so I can work on them. There's 6 iis sites I need to pull in, and any given site can have 0 or more iis applications and virtual directories associated to it. I've seen the option to add an existing website to a VS solution, and also saw how to assign virtual directories to individual projects. My questions are:
How do we handle iis applications within a site in visual studio?
Can all 6 sites be pulled into a single solution? This would be ideal if possible
Is there a way to pull in iis site settings into the projects/ solution? I'm talking about the config data stored in the applicationHost.config
Update- I've got the raw source code, in addition to the bins in these iis site directories. I don't have a need to decompile, just need to pull them back into visual studio.

Related

Opening Visual Studio Solution from Server Explorer

I don't know if this is possible, but I am trying to open a Visual Studio 2010 solution that is on a remote server from in Visual Studio. The project I am on is using Kentico CMS and we would like to be able to sync changes made to the hosted site (on the server) using TFS and Visual Studio as well as changes made via the Kentico CMS Desk portal. I haven't found anything on the Visual Studio or Kentico dev site or in the documentation. Whether or not this is possible, or if there is a better way of achieving this goal, I would appreciate any insight you could give.
I believe this system would help you accomplish syncing your development environment to a remote server.
http://www.kentico.com/Product/All-Features/Other-Modules/Staging-and-synchronization
You can check out what gets synced on this page:
http://devnet.kentico.com/docs/devguide/index.html
The content staging is good for synchronizing changes made via the user interface.
For synchronizing changes in the file system (e.g. changes in the code files in Visual studio), you can use some third party tools to keep the folders up to date - i.e. Drop box or Google drive (but there are also other tools and utilities).
After talking with a couple developers who were a bit more familiar with Kentico, we eventually found a good solution to our problem. It's not perfect, but it will work for our purposes.
We had the Kentico administrator generate a new license code for Kentico for 'localhost'.
In Visual Studio, we pulled down one of the default Kentico projects from the server.
On the project properties, we set Use Dynamic Ports to false and chose a number to set the ports to.
Once the project was built and running, we could navigate to 'localhost:1501/[ProjectName]/[PageName (CMSDesk, Landing.aspx, etc.)]' to access the CMS Desk portal.
In the CMS Site Manager, navigate to Sites > (click the Edit button for the site) > Domain Aliases > New Domain Alias and set a new domain alias (the website you want to use when viewing the site (for us it was dev.[projectname].com). This allows other developers to log onto and use the pages via the domain alias when the project is on the server. Changes made on the localhost copy must be pushed to the server before they are visible.
Using the local copy, we could work with the web parts and sync changes to TFS. We still have to manually copy the project from our local machine to the server in order to deploy, but we are hoping to set up a build machine that will push the TFS build to the server on a regular basis, which shouldn't be especially difficult.
If we find any better way to achieve this goal, or find any potential problems, I will be sure to update.

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.

IIS 6 to 7 is making me scared of web.configs

Hi guys,
We have a mixed development environment of three servers running: Win Server 2003 & 2008, IIS 7 & IIS 6, ASP.NET 2.0 & ASP.NET 3.5. Previously, all three servers were Server 03/IIS6/ASP.NET 2.0, but with this new change, I am finding that pushing/moving any applications from server to server is always a terrifying experience because there are always a variety of problems with the web.config from server to server. I used to consider myself a confident ASP.NET developer but now I am frightened to come to work every day.
I have always used the web.configs that VS generates for me on the Win 2003/ ASP.NET 2.0 server. None of our web.configs are "leet", they are just normal, although we do use ScriptManager and UpdatePanel.
To get by, as a temporary fix, I'm having to remember that when projects are moved/tested/deployed, never to move or overwrite any web.configs and things get confusing very fast. I've tried "ducttaping" like suggested here my web.configs with the new IIS7 stuff but even that doesn't work all the time.
What can I do here, what's going on? Is there a standard web.config that will work on all of the servers and do the UpdatePanel and ScriptManager ?
[edited question]
Since IIS6 is the baseline install for your application, you should make sure to run the application in "Classic" mode under IIS7. This makes configuration the same as an IIS6 box. This is how we run our web applications for now until we have fully migrated to 100% IIS7 server environments and we have zero problems with deployment/runtime.
To do this you can either choose to run your app under the built in "Classic .NET AppPool" that comes with IIS7 or, assuming you create your own custom application pools, just make sure you set the "Managed Pipeline Mode" to "Classic" under the "Advanced Settings" dialog for the app pool.
You should seriously look at web deployment projects for visual studio 2008.
This is an official add-on for Visual Studio that gives you a new project type called web deployment project. Among the most useful features is the ability to do web.config search/replace as well as pre-compiled builds of your web sites or web application projects.
In your case, what you'd do is create a solution configuration in visual studio for all of your target web servers. Then you'd create a web deployment project for your web app. In the properties for the deployment project you tell it how you want to compile the project and what web.config replacements you want to use for each solution configuration.
The end result should be that you can open Visual Studio, pick a solution configuration, build the deployment project. The build will create a folder with everything you need for that environment including the correctly configured web.config files. Then you just copy the folder to your server and you are up-and-running.
Best of all, since the different config files are all stored in the projecct, it lets you manage your configuration in one place and check it all into source control.
Do note that there is no equivalent in Visual Studio 2010. Instead, VS 2010 has a whole new deployment mechanism called MSDeploy. With 2010 you don't need a seperate project for deployments, and MSDeploy goes a lot further allowing you to package your SQL databases and other stuff too.
You can use the Classic mode under IIS6 by changing the process. That is actually pretty simple and it should work.
Another approach would be to automating your deployment process and have it so that it deploys the correct web.config to the server when you need to update your application.
If you run your IIS 7 websites using the Classic .NET App Pool, then the config files will match what you would use for IIS 6. That's probably the easiest thing to do until you're ready to migrate everything to IIS 7.
Knowledge is a great way to get over fear. Figure out what's going on (you're currently grasping at straws) and the fear will go away.
It's my guess that you'll do better if you refactor the code that uses the config file. Sloppiness there can definitely explain your weirdness and inconsistencies. You can't control much with your config settings if the code isn't behaving properly.

how do i connect my asp.net

Another beginner question for ASP.NET:
I'm starting an ASP.NET project in Visual Studio 2008, and would like to link it to a folder on a remote server (as in it builds/publishes to this folder). It may be my phrasing, but I cannot seem to figure out how to do this (even with Google at my side!).
I naively tried to just upload the code files to the server, but running my code produces errors related to the fact that the pages are not set up as an application.
Any help would be appreciated (or a link to a resource where i could learn more about this basic asp.net/vs08 stuff I keep running into).
On your web server the folder you copied your files into needs to be set up as an application or a virtual directory. This is done through the Internet Information Service panel found in the "Administrative Tools" off the Control Panel.
Depending what flavor of IIS you are using the procedure may differ.
Visual Studio 2008 has a publish feature. If you right-click on the web project there is a "Publish" option. You can then select where you want to Publish your files.
2 fast answers:
You can use the Publish option in Visual Studio and create a folder inside wwwroot to publish
Alternatively, you can create a simple setup program. Just add a new "web setup project" to the solution and add the results of the web site to the setup project.
And of course, have you tried googling asp.net deployment to get some help?
Good luck! :)
You will love Visual Studio 2010, which should be out in early 2010, if it follows previous versions. This would also mean an MSDN release a few months earlier. Why? Better deploy story.
As for where we are today, you can publish and have a directory created. You will have to publish to IIS instead of a directory to accomplish this. This means you have to have permissions to add a web app and publish to it.
For a directory, you will have to create the app in the IIS Manager. If you do not have access, try the IIS admin. If you cannot get them to do it, you are back to publish.

How can i have two concurrent web apps running on VS2008/VSS8.0/ASP.NET/IIS for a trunk and branch version?

Applications I am using:
Visual Studio 2008 (C#/ASP.NET)
Visual Source Safe 8.0
IIS 5.1
I have two Web Apps both named the same but one is used for major releases and the other is for minor (trunk and branch). I am wondering if there is an option in Visual Studio that prevents it from creating an ASP.NET app in IIS using the web app's project name. Since both of them are named the same I have to go into IIS and change the path of the application so that it point to the major (or minor) folder when i go between the two.
What I would like to do is have something like this:
http://localhost/webapp_major
http://localhost/webapp_minor
but the web projects still have the same name. I know I can go into the properties of the each project file and have them point to different places but I think that breaks something when you want to merge between the two.
Any Ideas would be very appreciated.
Instead of having HTTP based projects in your visual studio solution, add them as file projects, where the website will be accessed as c:\inetput\wwwroot\major_version (for example) in visual studio (and not http://localhost). That way you can have any kind of setup you want in IIS and your projects won't conflict when you merge them.
Your web application project will let you name the Virtual Directory anything you want. VS2008 extends this by allowing you to set this on a per-user basis, so this information won't be saved in the project file, and therefore won't be propagated to source control.
You can manually create a new web application in IIS and let it point to your working directory. Visual Studio should honor these settings.

Resources