none
older website project cannot consume newly created web service (needs a 2.0 reference) RRS feed

  • Question

  • Hello,

    I have an old website project that complains this when adding a newly created WCF web service:

    App_WebReferences/VideoService/(1): Build (web): Reference.svcmap: Could not load file or assembly 'System.Xml, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' or one of its dependencies. The system cannot find the file specified.

    Both the website project and WCF web service use .NET Framework 4.6.1.

    The WCF web service does not include System.Xml as a reference.

    Any suggestions?


    williamj

    Monday, December 14, 2015 7:47 PM

Answers

  • Why don't you just find the needed DLL, put it in a location like the Bin and point to it at runtime putting the information in the app or Web.config?

    https://support.microsoft.com/en-us/kb/837908

    It is telling you what 2.0 DLL is needed right down to the publickeytoken. So go find the DLL and put in a spot and point to it in the config file.

    Could not load file or assembly 'System.Xml, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' or one of its dependencies. The system cannot find the file specified.

    • Marked as answer by williamj8 Monday, December 28, 2015 2:32 PM
    Thursday, December 24, 2015 8:43 AM

All replies

  • I could not find any other WCF MSDN forums.


    williamj

    Monday, December 14, 2015 7:49 PM
  • Hi williamj8,

    According to this case,  what does  the 'needs a 2.0 reference' means.

    To tell the truth, I can't understand it very well. There are too many new words.

    That means your older website used the  .Net Framewok 2.0 version?  

    If so, as far as I know, we need to add some assemblies to older website project by manually.

    In general, we need to add the System.Runtime.Serialization and System.ServiceModel to the

    client which  .Net Framework version is 2.0.

    For more information, please refer to the following articles:

    1.How to expose WCF service to .NET 2.0 client

    http://blogs.msdn.com/b/stcheng/archive/2009/01/22/wcf-how-to-expose-wcf-service-to-net-2-0-client.aspx

    Best Regards,

    Wanjun Dong


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate the survey.

    Tuesday, December 15, 2015 7:19 AM
    Moderator
  • Wanjun:

    Why is this error occurring?

    The website project is older, but now runs .NET Framework 4.6.1.  The WCF Web service is also 4.6.1.

    Thanks.


    williamj

    Tuesday, December 15, 2015 6:57 PM
  • Hi,

    May be you can  try add the system.xml to your WCF service. As far as I know, when we used

    xml serialization to WCF Service, we need to add the system.xml  assemble.

    Best Regards,

    Wanjun Dong  


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate the survey.


    Thursday, December 17, 2015 12:26 PM
    Moderator
  • Wanjun:

    Thanks for your email.

    Could you give specific instructions on how to add the 2.0 assembly in Visual Studio?

    Thanks.


    williamj

    Friday, December 18, 2015 4:58 PM
  • Hi williamj8,

    Ok, please right click your project->properties->target framework. Like below:

    Then chose which framework version do you want.

    Best Regards,

    Wanjun Dong


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate the survey.

    Thursday, December 24, 2015 7:31 AM
    Moderator
  • Why don't you just find the needed DLL, put it in a location like the Bin and point to it at runtime putting the information in the app or Web.config?

    https://support.microsoft.com/en-us/kb/837908

    It is telling you what 2.0 DLL is needed right down to the publickeytoken. So go find the DLL and put in a spot and point to it in the config file.

    Could not load file or assembly 'System.Xml, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' or one of its dependencies. The system cannot find the file specified.

    • Marked as answer by williamj8 Monday, December 28, 2015 2:32 PM
    Thursday, December 24, 2015 8:43 AM