Ash
Ash

Reputation: 3246

How would I add a static Main() method to this example?

I have recently tried to start learning C# after previously working with PowerShell quite a lot. I have been trying to look at examples of wrapping PowerShell functions within a Visual Studio package.

I was particularly looking at the example from SimonWahlin here. However when I try and build it, it says that the Program does not contain a static 'Main' method suitable for an entry point. I knew that a program requires a Main() method and have read some of the documentation from Microsoft, but cannot understand how to introduce the method in to this example.

I appreciate this is not a great question, but hopefully someone can help me. Please let me know if I need to add anything, I am a newbie with this language.

Upvotes: 0

Views: 40

Answers (1)

TheHvidsten
TheHvidsten

Reputation: 4418

The example from SimonWahlin is a WPF project, which doesn't need a Main method.

However, he has an error in his example. If you look at App.xaml it has <Application x:Class="Example2.App" at the top, but there is no class with that name. I should instead refer to Example3.App.

Try to change that and see if that helps.

Upvotes: 2

Related Questions