Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I choose the "Startup object" in project properties while the listbox is empty?

I have a WPF project which I try to make it a single instance app using the recipe with Microsoft.VisualBasic dll described by Dale Ragan here at StackOverflow

Doing so in Visual Studio 2013 with Framework 4.5 give me 2x the same error while compiling: "... has more than one entry point defined..." for each entry point. Then I though that I would see both entry points in the comboBox choices of my "Startup Object" item of "Application" tab of my project properties. But it is empty. Why the "StartUp object" comboBox is empty and how to set the entry point? Could it be a Microsoft bug?

Additional information: - The 2 files with entry points are "App.g.cs" (auto generated) and my newly defined class with entry point - main : "EntryPoint.cs"

like image 954
Eric Ouellet Avatar asked Dec 09 '22 08:12

Eric Ouellet


2 Answers

I've solved the problem by hacking the csproj file:

<PropertyGroup>
  <StartupObject>Test.Program</StartupObject>
</PropertyGroup>
like image 183
Kai Neugebauer Avatar answered Dec 11 '22 09:12

Kai Neugebauer


Sorry folks,

The problem disappeared. I restarted Visual Studio but I had same behavior. I made a new project to send to Microsoft as a bug but it was working fine. I then copied my startup class from my test project and the bug disappeared ????????? I don't understand.

like image 27
Eric Ouellet Avatar answered Dec 11 '22 07:12

Eric Ouellet