Search code examples
c#visual-studio-2012visual-studio-project

Open Visual Studio project using c# Process.Start()


In my situation, I have a zip file which contains Visual Studio Project (the csproj file, bin and obj folder,...). This zip is exported from a database and unzipped in custom temporaly directory using .NET C#. The problem appears when I start the csproj file using Process.Start() method. VS loads the project but the project files are not found and are marked with exclamation mark. After I checked, it appeared that the csproj file is loaded from the default Temporaly Internet Files folder. If I open Windows Explorer and go to my custom directory and double_click the file, the project is loaded correctly. Does anyone know how can I tell Visual Studio to load my project using C# code?


Solution

  • It looks like you need to specify the correct working directory for the Process.Start() command.

    I believe this question will help you out with this: Open Program from C# - also specifying the working directory