Setting up a virtual/local test server in Visual Studio 2008 - visual-studio

I am creating a windows service and I would like to be able to debug my code easier. So my plan is to create a web app that will allow me to write and test code and then copy it over to the service.
Is there anyway to set up a virtual or test server similar to XAMPP or WAMP in visual studio?

So far on all of the services I have worked on does a very small ammount of the actual work (usually some sort of timer or file watcher) and the rest of the work is done in seperate classes which allows for easy swapping of .dll files.
a windows form app is very similar to a service and can be used to run code in a way similar to what how the service can.

Related

Is it possible to use to create Visual Studio solutions from an Azure-hosted web application?

I am writing an application that scaffolds the creation of other Visual Studio solutions. My application is intended to be run on an Azure web app instance and uses C# as the primary middle-tier language.
Previously, I have been able to scaffold or generate VS solutions from a Windows forms app running on my local machine using EnvDte and I know it is possible to do the same via a command line.
Is it possible to accomplish to scaffold/generate a Visual Studio solution from my web app that is itself running on an Azure web instance?
Though out-of-scope for the question, please assume that once generated, the solution will be stored in a folder, zipped and emailed to the user, checked into source control, or some other viable option that is altogether a different issue.

WCF IIS configuration and Visual Studio 2010 debug configuration

I am trying to set up my WCF service (.svc) to work in Visual Studio 2010 (pressing F5 to debug), but also to have multiple configurations for each environments (DEV, QA, UAT & Prod). When I originally built the WCF it was used purely in Visual Studio 2010 using .Net version 4 and debugging the service was easy enough by adding a WinForm application to pass in the values needed. When it was time to test the service on a server, I used the Publish feature to put the files on the DEV server and noticed that since it was using IIS that a web.config was created in the base directory.
So now that we are moving on to QA and UAT I need to make sure we have the configuration files for each environment as the Uri's change as well as various other values. Now after searching for a few days on Google, I have tried to use the XDT Transformations, but without having a third party add-in like SlowCheetah, this does not seem to work as it is only built for Web Applications. I have also tried to set up a post-build event to copy different configs:
copy "$(ProjectDir)Config\web.$(ConfigurationName).config" "$(ProjectDir)web.config" /Y
The copy process is set in the Build Events --> Post-build event command line textbox, however this does not seem to work when I use the publish method. I am ok with using multiple config files and copying them, I just have not had success with this.
The XDT makes the most sense to me and would be my preference if I could get it working. The main issue I am having is that it needs to work in Visual Studio, but also to work via IIS on the servers without having to go through a bunch of steps per environment. This is a company rule that I have to follow as well as not having a third party plug-in/add-in.
Is it possible to run the service in IIS and create a servicehost via code? I don't think it is as I believe the MSDN docs say that IIS creates it for you no matter what. Part of my reason wanting to do different configs is so that the page the user gets when they view the .svc file in the browser has the correct Uri in it not the machine name version.
TIA
EDIT: Setting up a dev web.config and including it in the project and then setting it to Build Action: Content fixes the copy method, so technically I have it working as long as I have completely different web.config files for each environment and an app.config for debugging (F5 in Visual Studio).

Test Project in Visual Studio 2010 for a Windows Service Project

I am working now in a Windows Service Project and I am having a lot of headaches trying to debug the service, I found a lot of article on how to debug a service but none of them worked for me :(
How to: Debug Windows Service Applications
There is no way after attach the process to enter in my breakpoints (set breakpoints everywhere)
Then I found another creating a windows form inside the project but that Solution is kind of dirty (but a solution).Testing a Windows Service From Within Visual Studio
So the real question is, is there any possible way to create a test project to test the service? (I don't have experience with testing, but I know is a good practice)
Do you want to debug the service or code that service runs?
In the past I would create one project for a service, one project for a library that contains the logic, and one project for a console app that would be used to test and debug the logic locally. That setup covered most of the debugging needs.
Hope this helps!

Creating a standalone .exe for a windows application in visual studio 2008?

I have created a windows based application in C# using visual studio 2008 which basically scans for the registry and then fixes the resulting errors. Now using the msi installer i have made a setup and it works fine. However i have met with a new requirement.
Usually after providing the setup to the user/client has to install the setup and when installed, in the installed folder there are lots of .dlls that i had used to create the project. But my requirememt is to create a single standalone .exe using which i wouldnt have to provide my users with the setup file. All i need to do is that using this single .exe file my whole project should execute and perform the same process of scanning and fixing the registry.
I also tried "ClickOnce Deployment in .NET Framework 2.0" and got the error "ClickOnce does not support the request execution level 'requireAdministrator'". and also have gone through the link
"ClickOnce does not support the request execution level 'requireAdministrator.'"
But still i feel that i would be comfortable if i can get a single standalone exe which can execute my windows forms application.
Is there any way to do it?
Any hint with this thing will be really helpful to me.
Thanks in advance
~Viknesh

Is it possible to edit files in one project while running another project in the same solution in VS2010?

Almost all of our Windows projects consist of a WCF windows hosted service and then a WPF client application. All of these have usually been split into two different solutions, one for the service, one for the client. This was done for various reasons, but we recently were looking at possibly putting them all together on a new project, which we did. This would mean not having to run two copies of Visual Studio and make it easier for various other things.
Our concern now is being able to edit the WPF client while debuging the service. Many of the developers will keep the service running a large part of the day when making changes in the client. But it looks like with this setup, when you start debuging the service, Visual Studio will not let you edit any of the other code in the solution.
Is there a way around this, so that you could have the service running whenever you want, and still be able to edit the WPF and CS files in the other project? Or should these two parts stay in two separate solutions?
You'll want two instances of Visual Studio: one doing the debugging of the service and the other one for coding.
You could also imagine having the service running without the debugger attached, and only attach it manually when you're ready to launch/debug the client you were working on.

Resources