Visual Studio Environment Best Practices? - visual-studio

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?

Related

How to Develop on a Mac and Test on IIS

I'm using a Mac for web development, and have a business requirement to use IIS for my web server. I'd like to be able to test my code in IIS before committing and deploying my code to the production server.
I know I could run a VM (I've used Parallels, VMWare Fusion and Virtual Box in the past). The downside is that this uses memory & processor power from my Mac.
Is there an easy way to watch my development folder and automatically copy new/changed files from the Mac to the test server running IIS? Are there any issues around file owner/permissions on Windows for these files? I know IIS can be persnickety sometimes about serving files if the permissions are incorrect.
Basically, I want to avoid running Windows/IIS on the Mac. So what are my options?

Remotely debugging application on a server with no administrator privileges

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

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.

Accessing ASP.NET local server from virtual machine

Don't know if maybe this question belongs on serverfault, but I'll try here first.
I'm running Visual Studio 2010 on my machine, and I want to test my ASP.NET page in IE6. IE6 is running on a virtual machine using Windows XP Mode.
The problem is that I can't access localhost from the virtual machine. I've also tried accessing it via my ip: 123.12.12.123:12121, but that doesn't work either. Is there something I can setup in Visual Studio? Or is the problem most likely with the virtual pc?
The "Cassini" web server provided as part of Visual Studio doesn't support requests from any machine other than the one it's running on. A virtual machine running on that machine is considered to be a different machine for these purposes.
You have twothree options:
Deploy your software to IIS running on your development machine (or a.n.other machine).
Download WebMatrix, to get hold of a copy of IISExpress, as it's somewhat easier to setup debugging against as opposed to "real" IIS.
Have a look at UltiDev Cassini, it's another implementation of the Visual Studio web server. I've never used it so can't comment on quality.
The problem is that the (test) web server that's included won't accept connections from outside. Your virtual machine has its own IP address and is seen as a different machine, just the same as any other physical computer.

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

Resources