Is it possible to get the URL for a web application project from the EnvDTE Project object?
i.e. I want the URL I see in Visual Studio when I look at the Web tab in Project properties.
Ideally, I'd like to be able to retrieve it if the project is set to either "Use Visual Studio Development Server", or "Use Local IIS Server"
Have you checked the Properties collection of the Project object you've got? As per this post a ProjectItem has an "URL" item in there, so the Project might have one too ...
I admit this is just a guess since I know absolutely nothing about webapps, I'm just digging through EnvDte stuff myself right now. But maybe it helps ...
Related
Here is my situation...
I have to maintain a website with multiple applications. We no longer have any of the solution files and the code is deployment code (so it uses DLL's instead of the original classes).
I basically grab the code from the website and stick it in a Visual Studio projects folder (This is generally C# code with Javascript that was originally developed on VS). I then open Visual Studios's 2010 Professional (VS) and open website, using the path in the project folder. I then add references to all the DLL files and if all the includes, images , and css files paths are referenced correctly, I can hit F5 and get the webpage to appear with some functionality. This creates a Project file in the Projects folder which I can then open instead of opening a website.
The problem is that I am unable to debug. If I set a breakpoint, it goes from solid red to outline red upon start of debugging. The standard message is "The breakpoint will not be currently hit. No symbols have been loaded for this document".
I have cleared out the symbols and reloaded.
I have debug = true in all my Web.config files.
I have gone into project properties and set the startup project action to "Start".
Any ideas why I can't debug ? My other projects that I develop from scratch work fine, but it is these projects that I am trying to get working from website files that won't debug.
My goal is to get every one of the Website apps under VS control were I can fix bugs and make improvements. Not very easy when the original source code is no longer available.
Please Help !
Thank You,
Eric
I fought this issue for a half of a day. I'm currently maintaining a website application. What worked for me is going into the project's Property Pages >> Start Options and changing the server to "Use Custom Server". I believe this setting will use IIS and not IIS Express. I started the project and was immediately able to debug.
When I open a particular mvc 3 website project in VS 2010 I get the following message:
The Web Project "X" requires missing web components to run with Visual Studio. Would you like to download and install them using the Web Platform Installer now?
ASP.NET Web pages with Razor syntax.
When I click yes
The web platform installer shows with the message that "0" items need to be installed.
My other mvc 3 projects do not show this behavior
Not a major inconvenience, but still...
thoughts any one?
I got the same error after reinstalling my computer.
I came to this conclusion, VS needs IISExpress to load my additional project. The addition projects has a webservice and it can run locally. Even if my endpoints points to a local address it still needs the IISExpress (standard IIS 7.5 does not respond the endpoint request) to open from VS (im running VS2010).
So after installing IISExpress i could reload my project in VS.
C.,
That shouldn't happen, and it would be interesting to figure out why. In the meantime, you should be able to turn this off by unchecking the "Package Restore" checkbox in Visual Studio's Options dialog. (Select "Package Manager" in the tree view to find it.)
If it's happening only for specific projects, you can solve this more surgically by removing the packages.config file for the affected project. In fact, if you want to do root cause analysis, you should look into why that file exists and how it got there.
HTH,
Clay
I have a web service that Visual Studio just won't let me add to my solution.
If I right click on the solution, click Add, then Existing Project, then I navigate to my project, select the Visual C# Project file, I get "The local IIS URL http://127.0.0.1:8099/ specified for web project has not been configured.
It asks if I would like to create the virtual directory now.
If I choose no, nothing happens
If I choose yes, creation failed error, could not find the server http://127.0.0.1:8099 on the local machine.
Creating a virtual directory is only supported on the local IIS server.
Does anybody know how to fix this? I've been struggling with it for a while. Thanks
Does anybody know why VS 10 change himself project type from Web Appliacation to Web Site when this project is downloaded from Team Foundation Server?
Sounds like someone has changed the application and checked it in that way...
Visual Studio won't change the project type on it's own.
Project type is stored in the project file, not in the solution file. Do a TFS compare (or view the history) on the project file to see if that was changed.
For C# project files the extension is .csproj
This site says "web applications" have a .csproj or .vbproj , but that a "website project" will not have a project file (http://msdn.microsoft.com/en-us/library/dd547590.aspx). If the Web Application project was blasted away, and a web site created in its place, it may be difficult to track down when the change happened.
I believe I understand fully the differences between Visual Studio 2005's web site model versus the web application project model that was fully delivered in VS2005 SP1 - but I have run into a confusing thing:
I have a web application project I wrote (it has a bin folder with the compiled projectname.dll and referenced .dlls too, etc.). but I just noticed that if I right-click on the project within Solution Explorer, a menu item called "Convert to Web Application" is exposed). That makes no sense to me.
I was comparing this project to a "web site" solution in VS2005 and contemplating converting it to a web application project. Strangely, the solution explorer offers nothing related to "Conversion to Web App" here like one would think is possible and/or appropriate.
I conclude there is nothing to help automate changing a "web site" construct to a proper "web application project". I assume it all has to be done by hand. Tasks such as reconstituting files in App_Code into one or more class library projects needs to be done manually.
I realize a lot has been written about the history and differences but can someone explain why the offer to "convert to web app" seems to be made in the "wrong" model - and just confirm that conversion is manual.
The conversion wizard does a decent job -ie, the process is far from being strictly manual - but you're still going to spend a lot of time moving from the website to web application model.
The "Convert to Web Application" context menu option for aspx pages generates a myclass.designer.cs file, which ties controls defined in markup back to the codebehind class, allowing for intellisense, compile-time validation, and other things.
Performing this action on a project file should generate designer files for all of the aspx's in the project, and I believe also creates some default application settings such as assembly name, etc, that aren't defined in a website project where the output is source, not an assembly.
I'm going to guess that the 'web application' that you wrote didn't start out with the correct vsproj file. If you bring in a project that doesn't have the correct file system scheme .aspx, aspx.cs, aspx.designer.cs then visual studio will assume that you're trying to create a 'web application' and gives you that conversion feature.
Back in 2005, Scott Guthrie did a tutuorial about converting a web site project to a web application project. Here is the section about Migrating from a Web Site Project to a Web Application Project.
Hope this helps some.