Wrong Startup Project
To fix this issue, simply right-click on either the .Browser project or the .Simulator project, and then click 'Set as startup project'. Then start the execution by pressing F5.
Why?
Let’s assume that your application is called “ProjectName“.
An OpenSilver Application solution contains 3 projects:
- ProjectName: this is the project where you should put your C# (or VB.NET) and XAML files. It has the name that you defined when creating the project. You can write your code in this project, but you cannot directly run it, because you have to choose between the 2 other projects below.
- ProjectName.Browser: this project lets you test your application in the web browser. You can select it as your startup project and start it.
- ProjectName.Simulator: this project lets you test your application in the Simulator, which is a powerful tool that lets you debug in C# using Visual Studio. You can select it as your startup project and start it.