Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8002133
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T16:16:25+00:00 2026-06-04T16:16:25+00:00

In Form1 i did this: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using

  • 0

In Form1 i did this:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Diagnostics;



namespace test
{
    public partial class Form1 : Form
    {

        WindowsFormsApplication1.Form1 f1;

        public Form1()
        {
            InitializeComponent();


                    MessageBox.Show("Oops something went wrong sorry");
                    f1 = new WindowsFormsApplication1.Form1();



        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }
    }
}

Where f1 is the second project i just added.

Now i added the seocnd project as a reference.

In the second project i did:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Net;
using System.Diagnostics;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        string[] hardDrivedInfo;
        string applicationFileName; 

        public Form1()
        {
            InitializeComponent();

            applicationFileName = Path.GetDirectoryName(Application.ExecutablePath);

But the applicatioFileName show me the path of the exe file of the first project while i need to get the directory + file name of the second project wich is in directory: D:\C-Sharp\test\test\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.exe

The directory of the first project is: D:\C-Sharp\test\test\test\bin\Debug\test.exe

But i need to make that applicationFileName will show: D:\C-Sharp\test\test\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.exe

EDIT **

What i want to do is to run the first main project then after the messagebox is popup and i close it it will run the second project will copy the second project exe file to another location like D: and will run the exe file of the second project. So if i delete the first project exe file the second one on D: will keep running.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T16:16:25+00:00Added an answer on June 4, 2026 at 4:16 pm

    Your text is a bit unclear, but I’m guessing you’re trying to get the name of the referenced assembly, rather than the one that started the process, right?

    Try using Assembly.GetExecutingAssembly(). Then you can get the full path from the Location property.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text;
public class Form1 : System.Windows.Forms.Form { private void eachCornerPix (object sender, PaintEventArgs e, out
When using the System.Windows.Forms.TableLayoutPanel control on a windows form, it sets the background color
I am currently using the control System.Windows.Forms.WebBrowser to create an Wysiwyg editor in a
I'm studying this book (Addison Wesley Windows System Programming 4th Edition) and I think
I did this example using the pluralsight video but the date picker is just
I'm a beginner learning Windows Forms Applications in C# and I want to write
Using: .NET 3.5SP1, VS2008 I was editting someone else asp.net script, he did the
using richtextbox control programatically i'm appending text to the richtextbox . richTextBox1.AppendText(hello); somehow the
I am trying to better understand how validation works in a Windows Forms application.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.