New Silverlight app doesn't generate XAP

ⅰ亾dé卋堺 提交于 2019-12-06 06:21:01

问题


I have created a new Silverlight app and it created a XAp file under the CLientBin on the Server side.

However after copying an existing project into the same folder and adding it to the solution, the XAP file is not being generated for the this assembly.

What am I missing?

Many Thanks,


回答1:


Do not attempt to modify your project/solution files manually unless you know exactly what you are doing :)

Adding it to the solution is not enough. You need to make a Silverlight relationship between the website and your Silverlight application.

  • Right-click on your website project and select Properties.
  • Choose the Silverlight Applications tab on the left side
  • Press Add...
  • Leave Use an existing Silverlight project in the solution checked and select the project you want to add from the Project dropdown.
  • Leave Add a test page that references the control checked if you want a separate test page for your application.
  • Press Add and you are done.

The website will now build your Silverlight application and include the output Xap file in its ClientBin folder.




回答2:


You need to update your project files:

The Silverlight project file contains a parameter indicating a server project:

<LinkedServerProject>..\SLClient.Web\SLClient.Web.csproj</LinkedServerProject>

The Web application project file contains a list of the Silverlight application projects:

<SilverlightApplicationList>{97E56891-B97D-4588-8262-BFB7DC5FD6D2}|..\SLClient\SLClient.csproj|ClientBin|False</SilverlightApplicationList>

This value tells MSBuild to copy the XAP in the clientBin directory.

Take note of the supplied GUID. It can be obtained from the Silverlight app csproj file:

<ProjectGuid>{97E56891-B97D-4588-8262-BFB7DC5FD6D2}</ProjectGuid>

You can open the project files in Visual Studio by first unloading the project in the context menu.



来源:https://stackoverflow.com/questions/6981069/new-silverlight-app-doesnt-generate-xap

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!