Solved

Running 2 instances of solutions/projects of C# in VS 2010.

Posted on 2011-03-08
6
523 Views
Last Modified: 2012-05-11
Hi there;

I need to run 2 instances of the same solution of C# in VS 2010. When I try for it, it fails as the related file is already in use. Is there a workaround?

Kind regards.
0
Comment
Question by:jazzIIIlove
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 35069637
You could try setting one build to Release and the other to Debug. That way they will run from two different output folders.
0
 
LVL 12

Author Comment

by:jazzIIIlove
ID: 35070334
ok, then I don't want to exagerrate but what about more than 2? (curiousity?)

Kind regards.
0
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 35070682
You should be able to browse to the bin/Debug or bin/Release and run directly from there. You won't get debugger support but it should run.
0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
LVL 12

Author Comment

by:jazzIIIlove
ID: 35075113
I need that debugger support, as I have to check both executions whether they interact/block/lock each other.

No way?

Kind regards.
0
 
LVL 33

Accepted Solution

by:
Todd Gerbert earned 500 total points
ID: 35079958
You can start the processes manually, and then attach a debugger from Visual Studio separately.  Put something in your Program.cs to pause program execution so you have time to attach the debugger before anything interesting happens in your program, for example:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
#if DEBUG
            MessageBox.Show(String.Format("Attach debugger to process ID {0} now, then click OK to continue.",
                System.Diagnostics.Process.GetCurrentProcess().Id));
#endif
            Application.Run(new Form1());
        }
    }
}

Open in new window


Start two instances of Visual Studio, open the same project in each.

Navigate to the "Bin\Debug" folder of your application in Windows, and manually run the .EXE.

In Visual Studio instance #1 click on the Debug menu, and select Attach to Process...  Select the appropriate process.

Go back to the Bin\Debug folder in Windows, and run your .EXE a second time.

In Visual Studio instance #2, attach to the process of the second .EXE.

I don't think you can do this with Express editions of Visual Studio.
Untitled1.png
Untitled.png
0
 
LVL 12

Author Comment

by:jazzIIIlove
ID: 35089274
>>carl_tawn:
You solve it but:

>>tgerbert:
Astonishing and breathtaking. I will try for it before concluding this question.

Kind regards.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.
Suggested Courses

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question