Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting debug start external program option to an executable of a class library in visual studio

I have a project that creates a new solution with one class library project. I want Debug Start external Program option of the class library of that solution to get set with an External Executable Application (not manually, should get populated at the time of solution creation).

I am unaware of libraries that do this task.

like image 681
user2728714 Avatar asked Mar 27 '14 10:03

user2728714


1 Answers

Create a .csproj.user file for the generated project. It's XML format. You can read and create XML using the XmlDocument class.

Set <StartAction> to Program and set <StartProgram> to the executable of your choice.

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
    <StartAction>Program</StartAction>
    <StartProgram>myexecutable.exe</StartProgram>
  </PropertyGroup>
</Project>
like image 137
Thomas Weller Avatar answered Oct 04 '22 05:10

Thomas Weller