Allan Bredahl

Hi All

I'm trying to build a WCF service to communicate with custom objects. I have placed these classes and contracts in a seperate dll (BaDataDef) that is referenced by the service, but I get this error when trying to generate client metadata with svcutil :

"

Warning: There was an error loading a contract type. This type will not be exported.

Type: MyService

Details:Could not load file or assembly 'BaDataDef, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An operation is not legal in the current state.

"

If I place them in my service projects there are no problems'

Shouldn't it be possible to have DataContracts outside the Service project itself

Thanks in advance

Allan Bredahl



Re: Windows Communication Foundation (Indigo) Placement of DataContracts

Brian McNamara - MSFT

What command-line for svcutil are you using Are you hitting the assembly or the running service If the latter, have you used the /r: option to reference an assembly

http://msdn2.microsoft.com/en-us/library/aa347733.aspx




Re: Windows Communication Foundation (Indigo) Placement of DataContracts

Allan Bredahl

Hi

I'm hitting the Assembly with :

svcutil.exe "D:\UDV\IBiz\BA\IBizRemObjects\obj\Debug\IBizRemObjects.dll" "/directory: D:\UDV\IBiz\BA\IBizRemObjects\\GeneratedClient"

If I try to add the reference with this command

"reference: D:\UDV\IBiz\BA\IBizRemObjects\bin\Debug\IBizDataDef.dll" I get this error:

Error: The input read from 'reference: D:/UDV/InsuBiz/BA/IBizRemObjects/bin/Debug/IBizBaDataDef.dll' is inconsistent with other options.





Re: Windows Communication Foundation (Indigo) Placement of DataContracts

Brian McNamara - MSFT

Did you leave off the '/' with "/reference"

Can you cut-and-paste the full command-line you are using






Re: Windows Communication Foundation (Indigo) Placement of DataContracts

Allan Bredahl

Sorry

Of course I was missing the /

Stupid me

For now I'm using the external tools in VS2005 to build my svcutil command line, and this reference bit forces me to use a physical path which i'm not to happy with. But anyhow it works for now, and I'm sure that the VS guys comes up with some better tool for the next version