Could not load file or assembly System.Windows

Nov 4, 2010 at 6:33 PM

I just came across SMF today and decided to give it a try.  Since there is still no setup MSI for 2.2, I downloaded the bin files and extracted them manually to the same location it says the setup file would have.  I then followed the video tutorial on adding SMFPlayer to an existing solution.

1. I created a new Silverlight Application, including web site and targetted Silverlight 4.0 in VS 2010.

2. If I build the empty Silverlight project at this time, everything is fine.

3. I then added references to Microsoft.SilverlightMediaFramework.Core.dll, Plugins.dll, Plugins.SmoothStreaming.dll and Utilities.dll.

4. Now when I compile the Silverlight project it gives me the following error.

"Could not load file or assembly 'System.Windows, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' or one of its dependencies. The system cannot find the file specified."

This file is indeed a reference in the project, so I can only assume this has something to do with the SMF dlls that I added.  Perhaps the setup file does something that is necessary to make this work.

Can anyone help me to get this working?  Also, how long is it going to take before the MSI is ready for 2.2 (it was released an entire month ago)?

Thanks!

Dan

Coordinator
Nov 9, 2010 at 8:15 PM

Dan, apologies for the belated response.  Also, we are actively working on getting the MSI live and will update the forum when that happens.  To address your challenges, first, there is no reason to put the SMF libraries under "%Program Files%" I recommend storing them instead, in your solution.  If, after doing this, you are still having challenges please .zip up your solution (including the referenced libraries) and post it somewhere I can download it.  Respond to this thread with the link and I'll take a look.

Thanks, Kevin.

Nov 9, 2010 at 10:09 PM

Kevin,

Thanks for the response...better late than never.  :)

As for the SMF libraries, I only extracted them to "%Program Files%" for initial storage.  For my project, they actually live within the bin folder.  I'll zip my project later and attach it to my next post.

Dan

Nov 11, 2010 at 2:43 PM
Edited Nov 11, 2010 at 2:44 PM

Kevin,

Here's is the solution that I created.  As you can see, all I have done is create a new Silverlight Application (and have the website built for me), and then add the references to SMF 2.2.  If you remove the SMF 2.2 references, the project builds fine, but with the references in, the project fails with the error I initially posted above.

Hope this helps and you can figure out what's going on!

Thanks,

Dan

https://docs.google.com/leaf?id=0B2gJmmkajwgwNTQxNDgzZmQtOTgwOC00MTRiLWJhYzItYWFhZDBmOWI2Y2Ez&hl=en&authkey=CMPn_e4F

Nov 11, 2010 at 4:43 PM

Dan,

I downloaded and ran your project and it worked fine for me. The reason being, I have proper 2.2 dlls. I had a similar compile error when I first got started with SMF. It was a problem in the version of source code I built to get the dlls. I originally went to the Source Code tab and used the download link to get the source and build the latest version. This source turned out to not be the latest (at least at the time I did it). I had to use the Downloads tab for 2.2 and get the source from there. If you did not already use this section, be sure to download the binaries from http://smf.codeplex.com/releases/view/53438#DownloadId=154961.

If you already used that link check the version of the dll you are using. Does it say 2.2010.1001.1? Also, you may run into trust (blocking) issues with any binaries you download from the web. You can unblock by right clicking the binary, goto properties and click unblock.

-Steve

Nov 11, 2010 at 5:25 PM

Steve,

The dll versions that I downloaded and referenced in the project are 2.2010.1001.1.  I already unblocked the files (you can't add them as references if you don't).

I wonder why it builds for you and not me?  It is a Silverlight 4 Application with nothing in it except the default files and the 4 SMF 2.2010.1001.1 dll references.

Is there anything else you can think of?  I did download the previous version also and those build just fine, although there are other issues with those that have already been fixed in this latest version.

I'll keep poking around.  Let me know if you can think of any other reason that this would not build for me, even though it does for you.

Thanks,

Dan

P.S.  Are you using VS 2010 or 2008?

Nov 11, 2010 at 7:35 PM

Dan,

I changed my SMF binaries to the binaries you had in the bin of your project. I didn't realize you had those in there. I then referenced those new binaries instead of the ones I have on my machine. It still worked. That tells me it's definitely not an incorrect DLL version that I had originally hoped.

Yes, I'm using latest and greatest of everything. VS2010, SL4. Have you pulled down the source and built from there? If so, do you still get the System.Windows error?

-Steve