Remotely debugging application on a server with no administrator privileges - debugging

My application runs fine on my machine (Windows laptop) but not on production machine (Windows Server 2012). I don't have administrator rights on production machine, so installing Visual Studio remote tools is not possible. Prod machine does not have Visual Studio installed. What is the best way to debug the application running on remote machine in this case?
To get some idea of what is breaking, I looked at EventViewer on prod machine and I see Exception and got to know which function is causing issue. However, as I am new to C#, I need to be able to set breakpoints and step through the code to understand better and fix the issue.

Without remote debugging configured you will not be able tp step trough your code.
Please look at another options like log4Net - when enabled in your application can be very useful to pinpoint a production issue
(very easy to use and configure) installs from VS package manager

Related

is it possible to use VS Profiler (Perfomance Wizard) on machine without VS installed?

I have performance issue that can not be reproduced on my development machine.
Issue only reproduce on "deployment" machine so I have to run profiler right there (normally I use development machine for such type of work).
Can I do that remotely? For example can I use Visual Studio UI from my development machine to run profiler via network on deployment machine?
Probably I can install only "profiler" part (without VS) to deployment machine and run it from command-line via RDP?
What options do I have? Of course I can just install VS on deployment machine but I want to install as less things as possible as this machine is used for business and VS is not required there.
upd just googled Standalone Profiler http://www.microsoft.com/en-us/download/details.aspx?id=23205 Probably this is what I need...

Error debugging worker role in Azure

All the sudden started getting the following error while trying to debug a worker role:
"Windows Azure Tools for Microsoft Visual Studio
There was an error attaching the debugger to the role instance 'deployment16(360)blah blah' with Process Id: '8780'. Unable to attach. The Microsoft Visual Studio Remote Debugging Monitor has been closed on the remote machine."
Restarting Visual Studio and the machine do not help.
As you start getting this problem all of sudden in your development machine something must have changed and it is mostly due to some of the OS auto-update and/or some application update you installed in your machine. There could be any random reason for this problem however if I would have hit the exact same problem here is what I would do to troubleshoot such issue:
To start, first thing is to just check it is not an application specific problem by creating a base app from web/worker template and see if that exhibit the problem.
If you have installed new release Windows Azure SDK 1.7 check with both SDK 1.6 and 1.7 to verify if both exhibit the problem.
Check if your could debug IIS based application as well outside Compute Emulator. This will isolate if the problem is specific to Windows Azure development Fabric or bind to your IIS itself.
If this is IIS specific issue, Check IIS configuration for all enabled functionalities, try resetting Application Pool configuration, running "ASPnet_regiis -i" etc to fix the issue.
If it is Windows Azure Computer Emulator specific, I know sometime OS updates may make application unstable so in that case, I will re-install .net 4.0 and VS2010 SP1 again respectively. (This does help so many time) then re-install Azure SDK 1.7 completely.
Such random problem mostly occur due to some change in your machine configuration, so restoring the VS2010 and the re-installing all other application does help to solve problems.
If you have an exception in the role's OnStart() or in Application_Start() that the debugger doesn't pick up, you may also receive this message. Application_Start() errors are especially pernicious because the debugger doesn't attach to the web process until after this method returns.
If you are wedded to cloud specific classes such as RoleEnvironment and cannot make the web role a startup project, you can use Ctrl-F5 to run the cloud project without debugging. With some luck you'll get a yellow screen of death to show you the true error.
Avkash covers the points.
I had the same issue recently. I set my web project as start-up rather than Azure and I discovered that that web project didn't actually run. Turned out somehow when of my projects was compiling for X64. I changed that and it worked.

How can I test my code against different environments with Visual Studio 2010?

I am working on a project that carries out actions against different versions of IIS depending on what is locally installed. I thought I had read that you could debug in different Virtual machine environments through Visual Studio 2010 if you have the VM's available.
I am working in a Windows 7 environment but need to test my code against a Windows 2003 / IIS 6 environment. Am only limited to creating that environment (VM and all necessary development tools) and testing my code locally?
My question wasn't as clear - I want all the benefits of running in debug mode that I would get if I was developing directly in that environment.
I think I found my own answer:
Remote Debugging of a Project Built Locally
http://msdn.microsoft.com/en-us/library/8x6by8d2.aspx
I'm not sure if you can automate it, but you can remotely debug from visual studio to code running on another machine. If I remember correctly, the trick is (if you're on a domain network) to log into both machines with the same user account (I did this in an active directory networked type environment).
It may have changed in 2010 (I'm on 2008 today), but start the debug instance on the remote machine, then from the VS debug menu, choose "Attach to Process", change the transport to "Remote" and enter in the machine name.
You should then be able to attach to the process, and set breakpoints and debug as you would any other session.

step into web service on another LAN server

I'm debugging a vb.net windows program which I've upgraded to a VS 2010 solution, targeting Framework 2. I need to step into a webservice's code. The web service is framework 3.5, also vb.net, running on a windows 2003 server on our LAN. I've seen a ton of crap on the Net about it, mostly other people who couldn't get it working either.
The error I get in VS2010 is the exact same one I got before upgrading the project from VS 2005:
Unable to automatically step into the server. Connecting to the server
machine [servername] failed. The Microsoft Visual Studio
Remote Debugging Monitor (MSVSMON.EXE) does not appear to be
running on the remote computer. Please see Help for assistance.
So I did what Help said to do and ran the VS 2008 remote debugging wizard on the host server. I have verified that the remote debugger is running as a service on that machine. And it still fails.
Little help? THANKS
Just in case anyone comes here looking for this answer, here it is. No goofy 'Attach to Process', no weird bad instructions
from websites going off on a million stupid tangents. This answer has been FALKENIZED.
When on the same LAN and on the same domain, remote debugging from Visual Studio 2010 works when you do the following steps.
on web service host machine, share the web application folder where the web service lives; give yourself 755 permissions.
oops, give yourself wrxr permissions.
on local development machine, map a network drive to the [web service host machine][web app] folder you just shared.
copy the Visual Studio 2010 remote debugger folder (containing msvsmon.exe + support files) to web service host machine.
Make sure you get the correct platform for your host server, e.g. x86, x64, etc. Remote debugger is found here:
C:\Program Files\Visual Studio 2010\Common7\IDE\Remote Debugger[platform]
on web service host machine, drag a shortcut from the newly-copied debugger to the desktop, then start the remote debugger
on local development machine, step thru code. when reaching a call to the web service, you'll be prompted to navigate
to the location of requested web service code file, which will then be available in your mapped path. Do it.
Finally after 1000000 headaches, you may start debugging your web service. CONGRATULATIONS

Visual Studio Environment Best Practices?

I have a VM on my Win 7 machine running Server 2008. My website can't run properly unless it's running on the server due to COM+, other website integration and environment variables. Currently, I have VS2008 installed on the Windows Server 2008 and I develop there (which is dumb, I know) instead on in my Win 7 workstation. I hate this setup.
My question is, how can I developer on my workstation and then EASILY push and test th websites on the VM Server?
Access files across the network so the actual changes are made on the VM Server?
Make changes locally and publish to VM Server?
Can I set up VS2008 so that if I when I Run the application in VS2008 it pushes everything over and opens a web browser that points to the VMServer's IIS Website?
Of course, the VM is a server on your network. Exactly like any other server on your network, virtual or otherwise.
For debugging you can setup VS2008 to remote debug but I think you'd have to publish the site, start it and then hook up the debugging but I'm happy to learn that there's an easier way... anyone?

Resources