Link a GOA WinForms for Silverlight project to a Web project
Introduction
Since Silverlight 2 Beta 1, you can run your GOA Winforms for Silverlight applications directly as a standalone project. No need to create a web application anymore, Visual Studio will generate a TestPage for you when you hit F5 to run the project.
However, for easy deployment on web server and integration with a web site, you can link a GOA Winforms for Silverlight project to a Web project as described here
Creating a GOA Project Using Visual Studio
- Start Visual Studio 2008.
- On the File menu, click New Project.
- In the Project types tree view on the left of the New Project dialog box, select the Visual C# root node.
- In the Templates list on the right, select GOA WinForms Application.
- Name your application "MySLApp" and click OK.
A new Sliverlight Visual Studio project is created.
Creating an ASP .NET Web Application Using Visual Studio
- In the Solution Explorer, right click the Solution node, in the drop down menu, select the Add New Project item.
- In the Project types tree view on the left of the New Project dialog box, select the Visual C# root node.
- In the Templates list on the right, select ASP .NET Web Application.
- Name your application "MyWebApp" and click OK.
Link the "MySLApp" project and the "MyWebApp" project
- In Solution Explorer, right-click the "MyWebApp" project node you just created, and select Add Silverlight Link from the context menu.
- When prompted to select a project, choose the "MySLApp" project, and then click OK.
- When prompted whether you want to enable Silverlight debugging for this project, click Yes.
- Right-click the "MyWebApp" ASP.NET project node again, and click Set as Startup Project.
- Delete the Default.aspx page from the ASP.NET project.
Compile and run MyWebAppapplication
- Make sure the "MyWebApp" project is the Startup project.
- In the Solution Explorer, right click the MyWebAppTestPage.html file and, in the drop down menu, select the Set As Start Page item.
- On the Debug menu, click Start Debugging.
- When you are prompted to modify the Web.config file to enable debugging, click OK.
- The application starts. A form holding a button is displayed.














