Run multiple copies of an app from Visual Studio - visual-studio

How can I run multiple copies of the same app in Debug with Visual Studio? For instance, how do I run app.exe /option1 and app.exe /option2 and still debug both? I know I can run them manually and then attach, but I want an automated solution.
I have tried writing a small console app just to run 2 processes, but obviously they are not being run under debugger. Any ideas?

The debugger sometimes seems to lock out other apps a bit so I'd be wary of running two debugging instances at the same time on the same machine in case they affect each other. Instead, unless the apps need to run on the same machine, I'd suggest installing some kind of VM software and then running each debugger in a separate Virtual Machine or similar.

I ended up creating a separate project and calling application's Program.Main() from there :)

Related

How to set up Visual Studio for debugging C#/.NET5 solution with multiple projects launching each other?

I have a .NET5 solution that is made up of several applications that communicate with each other using named pipes. In particular, there is a central service application (implemented using BackgroundService from Microsoft.Extensions.Hosting) and also an "Agent" that is responsible for launching the main service if it isn't running already, monitoring its status and relaying user commands to it. There are also a number of class libraries shared between the applications.
I've already configured the projects in the solution so they all build to the same output directory and I've set <UseCommonOutputDirectory>true</UseCommonOutputDirectory>.
After I launch the Agent in the debugger, it launches the service.exe using Process.Start() (it is not a Windows service). I can then (manually) attach to that process to debug it, too.
However, I'm wondering if this experience could be made smoother somehow:
Is there a way to set this up so the debugger would automatically attach to the child-process when it launches rather than me having to do it manually?
Is there a way to tell VS that it should also automatically rebuild the service and its dependencies when I launch the agent with F5? I keep forgetting this after making changes to the service...
I am aware that I can set up multiple startup projects so they all launch in the debugger simultaneously and that works for some debugging scenarios but I'm currently looking at a case where I really need the service to be launched by the agent and not separately before.

How to enable Hyper-V on a Windows machine?

I'm new to Visual Studio, and I just downloaded the Xamarin package over the weekend. The very first time I ran the Android Emulator, it seemed to work fine. (This was simply running the "Hello World" base-script. Then when I opened the emulator again, it began having Deployment errors.
Deploy Failed
Pressing Yes, yields no results. After some research of my own, I believe that the issue may be because Hyper-V is not running. Enabling it should be simple, but i have tried a few different methods and cannot seem to get it to run. One way I tried was via Powershell: Powershell Feature Name Unknown
Having tried that, I tried to enable it manually via settings: Settings
To my understanding, there should be a few different folders here called "Hyper-V" or something to that effect on top of Hypervision Platform folder. Is this why my emulator isn't running, because I don't have access to the Hyper-V folders, or could something be wrong in Vis Studio itself? Like I said, I'm very new to this software and workflow so any trouble shooting ideas would be appreciated.

Run two projects with different data sources in Visual Studio

I am trying to run two different projects from different instances in Visual studio. The idea is that in one, based on a virtual machine, I want to test some long running processes. But so that I can continue with other work I want to run another project on my local machine connecting to a local instance of SQL Server.
Both projects run fine by themselves, the problem occurs when one is run before the other, then the second gets an econn error both are running on localhost, one is set to run on part 2060, the other port 2070
Anyone know a way around this?
Thanks
Found the problem. The issue was with Java debugging. It seems that with it enabled it will not run the two simultaneously. With each on a different port and Java debugging disabled, it runs perfectly.

Is there a way to debug installer executable created using installshield universal?

I have created a windows executable with some custom actions and some UI stuffs.
I am facing a strange behavior with the installable.
I tried probing through the code and kracking the installer as much as I can, but I did not find any idea why the strange behavior is available.
So, I wanted to debug the installer at every point of code execution in the Custom Action for which I tried writing those values I require to a logger. But unfortunately my logger will get created after the installation at which point I will not be in a position to run it again.
So, can anyone suggest how to debug it while the installable is under execution?
I've tried but couldn't get a debugger working with Installshield universal.
My workaround was to add a lot of debugging messages and to use VMware. Install VMware and create the test machine as a virtual server. I configured the virtual server with all the prerequisites, rebooted it and then ran a snapshot.
After the snap shot I'd run the install script, wait for the errors and the log files. Then I'd use the VMware 'revert to snapshot' function to go back to a clean instance of the test server and start investigating the error messages from the logs.

Visual Studio 2005 Setup project install crashes over Terminal Server

I have a setup project created by Visual Studio 2005, and consists of both a C# .NET 2.0 project and C++ MFC project, and the C++ run time. It works properly when run from the main console, but when run over a Terminal Server session on a Windows XP target, the install fails in the following way -
When the Setup.exe is invoked, it immediately crashes before the first welcome screen is displayed. When invoked over a physical console, the setup runs normally.
I figured I could go back to a lab machine to debug, but it runs fine on a lab machine over Terminal Server.
I see other descriptions of setup problems over Terminal Server sessions, but I don't see a definite solution. Both machines have a nearly identical configuration except that the one that is failing also has the GoToMyPC Host installed.
Has anyone else seen these problems, and how can I troubleshoot this?
Thanks,
I had LOTS of issues with developing installers (and software in general) for terminal server. I hate that damn thing.
Anyway, VS Setup Projects are just .msi files, and run using the Windows installer framework.
This will drop a log file when it errors out, they're called MSIc183.LOG (swap the c183 for some random numbers and letters), and they go in your logged-in-user account's temp directory.
The easiest way to find that is to type %TEMP% into the windows explorer address bar - once you're there have a look for these log files, they might give you a clue.
Note - Under terminal server, sometimes the logs don't go directly into %TEMP%, but under numbered subdirectories. If you can't find any MSIXYZ.LOG files in there, look for directories called 1, 2, and so on, and look in those.
If you find a log file, but can't get any clues from it, post it here. I've looked at more than I care to thing about, so I may be able to help
Before installing, drop to a command prompt and type
CHANGE USER /INSTALL
Then install your software. Once the install has completed, drop back to the command prompt and type:
CHANGE USER /EXECUTE
Alternatively, don't start the installation by a double click but instead go to Add/Remove Programs and select "install software" from there.
Good luck!

Resources