I have a WCF service. now, I need to create a client that consumes my service. when I try to add a service reference from Visual Studio, this is what I get an error message :
"Could not load type 'System.Data.Design.TypedDataSetSchemaImporterExtensionFS35'
from assembly 'System.Design,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a'".
here's the signature of my service :
public void SaveBookInDB(byte[] bytesToSave,bool append,Guid guid,String bookname,String contenttype)
I tried using the svcutil.exe at the command-line and I get this :
"Error : An error occured in the tool. Error : 开发者_StackOverflow中文版The type initializer for
'OptionProcessingHelper' threw an exception.
Could not load type 'System.DateTimeOffset' from assembly 'mscorlin, Version=2.0.0.0,
Culture=neutral,PublickKeyToken=b77a5c561934e089'."
I don't know how to solve this. can anyone help me please ?
even after reinstalling Visual Studio, I still get the same problem.
Thanks.
With the question update; if that is the only method in the service (and assuming you don't have any exotic base-classes etc), then I conclude that your VS install is borked. Do you have another machine you can try from? Also, check that your method has the appropriate attributes etc, but that shouldn't cause the problem shown.
Have you tried using svcutil.exe
at the command-line? It is very easy, and hopefully won't have this problem.
I solved the problem by reinstalling my System and then reinstalling Visual Studio. and it now Works ! Great !
This also happens when Interface declaration differs to the implementation of the Service. For example, a function is declared in the Interface and it is implemented, but there is a parameter type discrepancy between the declaration and implementation. Then there can be no error in building the project, but attempt to Update Service Reference would fail.
精彩评论