Reputation: 6549
I have a web site type project in visual studio and I have included a reference to my silverlight 5 library project. In the SL5 project, I am including the System.Runtime.Serialization assembly. When I try to access one of the pages of my web site that uses the SL5 library, I am getting the following error:
Could not load file or assembly 'System.Runtime.Serialization, Version=5.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' or one of its dependencies. The system cannot find the file specified.
I have installed the SL5 SDK on the box I am publishing the website on, but it seems it is unable to find that assembly. Any ideas on what is going on? I have already restarted IIS.
Upvotes: 2
Views: 1639
Reputation: 407
You can not use SL5 class library in asp web site project, because they have different runtime. Sometimes it works, when library is simple, but in your case library has dependency on System.Runtime.Serialization.
If you need share your code between SL and ASP projects, you can create simple .Net class library (not SL5) and add all you files from SL5 library as link to .Net library (Add/ Existing item... / Add as Link). Add reference to new library for your asp web project and remove old (SL5) library.
It's one way to share code between different libraries types. Probably you can not build new library if you have SL specific dependency in your code. I hope my idea will help you.
Upvotes: 1