Attaching to web server process starts asp.net development server - visual-studio-2010

I am getting the same problem as this:
Debugging w/ Attach to Process Starts ASP.NET Dev Server
Every time I attach to the web server, I get another asp.net development server, eventually ending up with more and more.
However I don't see the option described in my Properties page. I have Visual Studio 2010. All I have in the Properties is "Full Path" and "Opened URL".
EDIT: Note: they all have different port numbers

You created the application as a web site. If you create a new project (vs. web site), you will get the Project properties page that is described in the SO question you referenced.

Related

Azure Web Role - Multiple websites don't compile when debugger is run in Visual Studio

I have an Azure Cloud Service Project that has a web role with multiple websites associated with it.
When I click the "run" button, it fails to load the debug symbols for all the websites in the web role. In order to debug the other websites, I have to explicitly build the web project in question before I can run the debugger.
How can I configure the Azure Cloud Service Project to compile all the associated webs within a single web role?
As of this posting, Visual Studio 2012 support for multiple websites within a single web role is fairly poor (Exibit A, Exibit B).
When you click the "Run" button in a solution, it doesn't mean that all projects will be compiled. Only those directly related with the project that is being run at the moment will be compiled (and debug symbols updated).
Consider the following work-around:
Identify the main web role web project in the solution (it should the one that
matches the name of the web role in the Azure Cloud Service Project).
Right click on the web project
Go to "Add Reference"
Go to "Solution"->"Projects"
Check the checkbox next to each of the web role's associated websites.
Click OK
By adding a reference to the other web projects, it causes the compiler to compile the other webs when the Azure Cloud Service Project is run with the debugger.
This will allow you once again hit the "run" button with great abandon.
I've posted some details on using multiple web sites within a web role on my blog at http://michaelcollier.wordpress.com/2013/01/14/multiple-sites-in-a-web-role/.
As for the debugger, are you using host headers for the different sites? If so, try switching to use different ports instead. I've had better luck going that route for debugging purposes. Then switch back to host headers when ready to deploy.

Manually Assigning WCF Application in IIS

In a Visual Studio "WCF Service Application" project, on the properties->web page, if I select "Use Local IIS Web Server"->"create virtual directory"...it creates the IIS application successfully in the Default Web Site of a local IIS 7.5 install. So far so good.
However, I'd like to use a site other than the default web site. My attempts to host the service in a different web site aren't working. I tried:
Delete the application / virtual directory in IIS that Visual Studio successfully created.
Manually create a new IIS application, in the different web site, using the same settings that were present in the IIS application previously created by Visual Studio automatically.
Go to Visual Studio, project properties->web, and select the "visual studio development server". Save. This is just an "erase" step.
On the same properties page, I select "Use Local IIS Web Server" again and hit save (without pressing "Create Virtual Directory").
In that last step, I expect it to save. It doesn't. It pops up a message saying the virtual directory does not exist. But as I stated, it does exist because I had manually created it just prior.
My own guesses about this problem:
*. The non-default site I've made is somehow different from the default web site, in a way I've yet to determine.
*. Visual Studio is not designed to work with a virtual directory that is not in the default web site.
Any suggestions or clarifications?
I've activated IIS "failed request tracing," but no records are created for this issue.
What you want to do is look at your second site is IIS (the one you want the WCF service to run under) and look at the host name on new or if you go to manage web site -> advanced settings and look at what is after the the bindings. So it may show something like: http:*:80:localhost2 . localhost2 is what you need. It may be an IP Address too, not sure how you set it up.
So then in your WCF project properties in the Use Local IIS Server -> Project URL you put the host name of the site. So for example it may be something like: http://localhost2/yourservice.svc .

Debugging an existing sharepoint solution

I've recently mapped a sharepoint solution from TFS to a local directory and successfully 'got' the latest version.
It wasn't building, but this was because of there were no Site URL's in the properties of the several projects included in the solution. So, using central admin, I created a new web app (the port 36352). U then added the url and port to the Site Url and it's now building fine.
However, when I go to run with the debugger I get the following two errors:
Error 2 Error occurred in deployment step 'Recycle IIS Application Pool': Cannot connect to the SharePoint site: :36352/">http://:36352/ (deleted url for security reasons). Make sure that this is a valid URL and the SharePoint site is running on the local computer. If you moved this project to a new computer or if the URL of the SharePoint site has changed since you created the project, update the Site URL property of the project.
AND
Error 3 Program 'Path.PowerShell.exe' (deleted path for security reasons) does not contain a static 'Main' method suitable for an entry point
It seems that the first error is related to the way in which I've 'connected' it to the new web app I've created - have I done this part right?
The 2nd error seems to be with regard to the entry point at which the debugger should execute, but this is a sharepoint site - so I just want to run the site (has VS not identified this as sharepoint somehow?).
Thanks a LOT for any help.
I got this exception when I had the solution on a different server. Make sure your solution is on the same server as the SharePoint web application. When you run the solution, Visual studio packages the solution and tries to deploy it onto the URL you specified in the properties. If your project is a farm solutions such as visual web part then make sure you have rights to deploy.

Visual Studio: testing on different a server than developing on

In dreamweaver, it's really simple to set up a site so when you test a page that you are developing that it deploys it to a different test server that you are developing on and then browses to that page at that location also.
Question: Can you set up Visual Studio so that when you "run" or "View in Browser" that it automatically pushes the pages out to the test server and then browses to that location as well?
You've got two options as far as I can see:
1) Create a local project and set it up to run from your own local IIS, (this is not exactly what you're asking, but it should be more of an apples to apples test, as opposed to the built-in visual studio web server).
2) Use Remote Debugging to attach your Visual Studio instance to a remote server, links here and here
With option two, you'll still likely need to publish/deploy your solution to the server each time, but you will be able to step through and debug your code running on the remote server.
I think you can use an FTP project (File>Open Web Site and then select FTP) - as far as I'm aware, when you save a file it's automatically uploaded to the specified server. Then you could just point your browser at that web server.
I don't think this is possible,but you can always set up a shared folder where you put your code, and that shared folder is in fact the folder where your web server expect the code to be.

Web Application within a Web Site in Visual Studio?

Visual Studio allows you to make "Web Sites" and "Web Applications", but, inside a project, can you have one within the other?
Say I have my website "www.mysite.com" and I have an application called "BudgetCalculator". One the production server, this is supposed to be located at:
www.mysite.com/BudgetCalculator
And the BudgetCalculator app contains links back to other parts of the website, like "/page1" and "/page2".
However in Visual Studio, when they're listed as two different projects, they're on the same level. When I fire up the debugger for the BudgetCalculator app, those links aren't going to point back to the main website, like they should.
Is there a way around this?
One solution would be to stop using the built-in .NET Web Server.
Use IIS, create one site, and make your Web App a Virtual Directory inside of the Web Site.
A project cannot host/contain another project in Visual Studio.
You can however create a project that sites in the directory of another higher level project when you create it, however they may not be directly linked, so you couldn't debug them both at the same time.

Resources