开发者

Given a VS solution, how can I add the Silverlight control it implements to my project?

开发者 https://www.devze.com 2023-01-15 12:07 出处:网络
I\'m trying to add this Silverlight 4 control to my project. I went to the downloads page, and it\'s full of VS solutions/projects/.cs files. I\'m new to Silverlight, and I don\'t really know how to g

I'm trying to add this Silverlight 4 control to my project. I went to the downloads page, and it's full of VS solutions/projects/.cs files. I'm new to Silverlight, and I don't really know how to get the control from that. Help?

Update: I tried following roufamatic's instructions. At this point, I was still unsure how to use the control, so I tried the following code:

        mpost.SilverlightSingl开发者_开发问答eFileUpload.MainPage singleFileUpload = new mpost.SilverlightSingleFileUpload.MainPage();
        singleFileUpload.Width = singleFileUpload.Height = 100;

Unfortunately, the app crashes on the first of the above lines:

Could not load file or assembly 'mpost.SilverlightMultiFileUpload.Controls, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

What else can I try?


Assuming your project is a web application, you can add it to your project like so:

  1. Download the full source, including the project file.
  2. Add the Silverlight project to your solution.
  3. Open Properties on your web application and choose "Silverlight Application" on the left side.
  4. Click "Add" and choose the Silverlight project.

This dialog can also generate a test page which will get you some boilerplate HTML to embed the control in your own pages. You may also enable debugging so you can step through the code when the control is loaded in the browser.


  1. Build it.
  2. Take the output dll and put in a directory in your own solution.
  3. Add a reference to the dll.
  4. right click on tool box
  5. click 'choose items'
  6. look on the silverlight tab
  7. mark the appropriate checkbox


Have you tried running the dll against Dependency Walker and see all its dependencies?

0

精彩评论

暂无评论...
验证码 换一张
取 消