Error: add assembly reference 'System.ServiceModel, Version = 3.0.0.0'

I can create a silverlight 4.0 application in Win xp (IIS 5.1). But when I try to create the same application in Win Server 2008 R2 (IIS 7), I get an error message,

"error CS0012: type 'System.ServiceModel.ClientBase`1' is defined in an assembly that is not referenced. You must add a reference to the assembly 'System.ServiceModel, Version = 3.0.0.0, Culture = neutral, PublicKeyToken = b77a5c561934e089'" .

The path actually refers to the dll on both machines, "C: \ Program Files \ Reference Assemblies \ Microsoft \ Framework \ Silverlight \ v4.0 \ System.ServiceModel.dll".

What could be the problem?

Thanx in advance

+6
source share
3 answers

Make sure you see System.ServiceModel in the help folder of your project.

+5
source

This problem may occur if you move the solution from one higher-level environment to another. ex: my colleague created it on VS2015, which automatically generates this dll. then when I tried to run it in my environment. he shows this error. because my environment does not automatically create such a library.

Hope you just need to add "System.ServiceModel.ClientBase" manually via "Add Link"

+2
source

Whether it is a 64-bit environment, and the other is a 32-bit environment, I have seen cases before when the assembly decides that it will work only on certain platforms, so the build option β€œAny processor” says that it does not build platforms correctly.

+1
source

Source: https://habr.com/ru/post/900493/


All Articles