Search code examples
wcfwcf-bindingwcf-client

WCF, svcutil build proxy with /reference


I have a ClassLib call Id.API. Id.Web references this.

Within Id.API I have an Entity, MyEntity.

When I try to create the call to method SendEcho(MyEntity myentity), Id.Web project complains that it expects a param of

id.web.types.MyEntity

instead of

Id.API.MyEntity

Researching suggests to me that this is fixed using a reference switch on the svcutil command line.

Here is my example command line:

"C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin\x64\SvcUtil.exe" 
http://id.web/Services/EchoService.svc?wsdl 
/config:C:\Projects\Id.Web\Interface\Services\EchoService.svc.config 
/reference:../bin/Id.API.dll

I get the error:

Error: Cannot load reference assembly '../bin/Id.API.dll'

Cannot load file ../bin/Id.API.dll as an Assembly. Check the FusionLogs for more Information.

Could not load file or assembly 'file:///C:\Projects\Id.Web\Interface\bin\Id.API.dll' or one of its dependencies.
This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.

How can i fix this? thanks


Solution

  • What .NET framework version is Id.API.dll, and what .NET framework is the assembly that references it? It sounds like the Id.API.dll is built with a newer framework than the project you're trying to reference it with.