IIS Express path to applicationhost.config in Visual Studio 2010 - visual-studio-2010

Is there a way to tell Visual Studio 2010 what value to use for the /config parameter when IIS Express is started?
Using Process Explorer I can see:
the iisexpress.exe process is started by Visual Studio with the /config parameter pointing to 'My Documents\IISExpress' via the environment variable named IIS_USER_HOME .
However I need to store my applicationhost.config in another location.
Changing that IIS_USER_HOME variable might do the trick (?) but I don't know any way to access it.
What I have tried:
I guess that these instructions on how to debug .NET web projects with IIS Express pre SP1 might work for me but they seems like a hassle to follow. There ought to be an easier way?
This StackOverflow question about global variables within IIS Express suggest that I should move the location of 'My Documents'. Unfortunately that is not an option for me.

You cannot change IIS_USER_HOME because this is set by IISExpress.exe during the process startup.
I am not sure about concerns you have about how to debug .NET web projects with IIS Express pre SP1 .
If you don't want to use macros in VS, probably you can just start IIS Express from command line with /config switch and then from visual Studio attach to iisexpress.exe and debug your web application.

Related

Can you prevent Visual Studio 2013 from starting all web sites in a solution when using IIS Express?

Is it possible to configure IIS Express to not run all the web sites in a given solution? I have a solution with 4 web sites and I only want IIS Express to run 2 of them when I hit Start (F5) in Visual Studio 2013. I have the solution set to only start 2 of them, the other 2 are set to None.
I went into the IIS Express config file and created a new app pool with autoStart="false" and assigned this new app pool to the sites that I do not want to run. I also set the serverAutoStart attribute to false in the site tags, that I don't want to run. These changes didn't make any difference. The IIS Express tray interface still shows all 4 sites as running. (Yes, I shut down Visual Studio and made sure all the iisexpress processes were dead, before restarting.)
Yes you can,
By default all sites has a property called "Always start when debugging" set to True
setting this property to false will allow starting only the specific site you choose to debug.
Try using the Disable Always Start When Debugging VS add-in tool.

Visual Studio 2013 IIS Express

I cannot use VS2013 due to the fact that the "Visual Studio Development Server" option is missing. You can only use IIS Express, or an external host. When I use IIS Express, I get one of several errors when I launch a website with F5.
Failed to register URL "" for site "" application "/". Error description: Cannot create a file when that file already exists. (0x800700b7)
Cannot process request because the process (8204) has exited.
Neither of them make sense. I tried deleting all the configured sites in the IIS express config. I tried reinstalling IIS Express, Visual Studio. I don't see how the first error can occur. In all the demos I've seen, you can just hit F5 in VS and it works. This isn't the case here.
Right click on the Project in your solution and pick Properties.
Select web on the left side.
Choose IIS Express
Enter Project url
example:
https://localhost:44300
or you could check 'Override application root url' and type url like above

Configure Debugging on IIS 8 with Classic ASP files

Given a working Internet application written in classic ASP (with some VBScript) and an IIS 8.
Now I have to debug that application probably in VS2012 or VS2010.
I hear about some rumors, that I can configure the IIS to do that.
Furthermore when I write STOP keyword to the code file (in text editor) then the visual Studio will be triggered to attaching the actual debugger.
Please help me with these IIS or other settings, and ask if the situation is unclear.
What are tried:
in your iis in the asp section set under debug properties "serverside debugging" to "true".
I had to attach to the IIS working process w3wp.exe in Visual Studio manually. Somewhy that wasn't automatical but i saw cases on other computers when it was...

Application Debugging is disabled in Visual Studio 2012 on Classic ASP Debugging

I'd like to debug Classic ASP website at Visual Studio 2012 with IIS Express. Hence, I attached the iisexpress.exe in VS 2012, but it shows Application Debugging is disabled. What could be a problem ? Do I want to enable any configuration settings?
First of all you need to enable server side debugging of classic ASP script. Do this by running the following commands:
"C:\Program Files (x86)\IIS Express\appcmd.exe" set config "[YOUR_SITE_NAME]" -section:system.webServer/asp /appAllowClientDebug:"True" /appAllowDebugging:"True" /commit:apphost
Where [YOUR_SITE_NAME] is the name of your website. You can find this name by opening up:
%USERPROFILE%\Documents\IISExpress\config\applicationhost.config
...and searching for your site.
Next, start an IIS Express instance from the command line:
"C:\Program Files (x86)\IIS Express\iisexpress.exe" /config:c:\users\kevin\Documents\IISExpress\config\applicationhost.config /site:"[YOUR_SITE_NAME]" /apppool:"Clr2IntegratedAppPool"
Again, [YOUR_SITE_NAME] is the name of your IIS Express website.
Then attach Visual Studio 2012's debugger and set a breakpoint in the script you wish to debug. Browse to your site/script and your should see the breakpoint light up:
Go to IIS-->ASP-->Debugging properties -->enable client and server side debugging
then attach w3wp process from VS2012
I don't have visual studio 2012 to test it on as far as I know visual studio cannot debug asp classic code natively.
The way I debug my asp classic code is to put in stop statements on the line above the one I want to debug
like this post says. the break point is just typing in stop.
function DoDate(inp)
stop
if isnull(inp) then
DoDate = "Never"
exit function
end if
In the above example the page when loaded will stop at the breakpoint and pop up a dialog asking if you would like to debug it, you can then step through the function and even see variables like you normally would.
note: The link says visual studio 2005 but it also works in 2010(and should also work in 2012), you also do not need the DEBUG extension.
also ensure you have server side debugging activated in IIS or this will not work.
I like using Full-blown IIS on my dev machine as it's what my web servers run and have had problems with differences between Casini and IIS in the past..
Anyway, I was unable to do it the way that #Kev suggested. I did some more playing around + reading and found that on the "Attach To Process" window, you need to specifically select "Script Code" in the "Attach To:" option.
1) F9 to set breakpoints in code
2) Ctrl-Alt-P to attach to process
3) Next to "Attach To:" click on the "Select" button
4) Select "Script Code"
5) In my case, attach to "w3wp.exe"
Enjoy debugging your code.

How to use W3WP.exe effectively to debug SharePoint applications?

Can anyone tell me how to effectively use w3wp.exe to debug sharepoint applications?
If you are are running SharePoint on your development machine where you have Visual Studio installed - you can attach the debugger to the w3wp process, then breakpoints in your code will be hit when you 'touch' them from the web interface.
How to connect the debugger - good description in the MSDN article here http://msdn.microsoft.com/en-us/library/ff650703.aspx#Performing_Manual_Debugging
If you want to debug your bespoke application that sits within sharepoint via Visual studio i would recommend that you download WSP builder it has dubugging options within it. I'm sure this does the same thing as the post above but it also has sharepoint related things within it that may be of use.

Resources