none
wcf test client problem

    Question

  • I am attempting to run the WCF Test Client (from VS2010) on my Win2008R2 server.  I enter the correct service url for my http service endpoint and get the following error:

    Failed to add a service. Service metadata may not be accessible. Make sure your service is running and exposing metadata.

    Error: Cannot load reference assembly 'C:\Windows\Microsoft.Net\assembly\GAC_32\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll'    Cannot load file C:\Windows\Microsoft.Net\assembly\GAC_32\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll as an Assembly. Check the FusionLogs for more Information.    Could not load file or assembly 'file:///C:\Windows\Microsoft.Net\assembly\GAC_32\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.

    My service is hosted in IIS 7.5 WAS / .NET 4.0 (http binding).

    Note , I had to manually copy the Wcf Test Client and svcutil from my workstation up to my Windows 2008 server.  Anyone else run into this error?

     

    thanks

    Sunday, November 7, 2010 2:08 AM

Answers

  • Hi Eduardo,

    As Ido mentioned, you can try using webbrowser to access the metadata/wsdl page to see whether it works.

    Also, the error message indicate that the .NET 4.0 built-in assemblies cannot be found, I'm wondering if you have incorrectly configure the IIS 7 application pool(used for your WCF service) to other .NET framework version(such as .NET 2.0). You can check the application pool to make sure the .NET framework version of it is set to 4.0:

    #Specify a .NET Framework Version for an Application Pool (IIS 7)
    http://technet.microsoft.com/en-us/library/cc754523(WS.10).aspx


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    • Marked as answer by Mog Liang Monday, November 15, 2010 9:05 AM
    Tuesday, November 9, 2010 3:43 AM
    Moderator

All replies

  • If your service is hosted in IIS, first try to open a browser and browse to the service's address.

    Try to open the service's WSDL file and check if you still get that error.

    According to the error it seems you have a problem with one of your references. Any chance you project is set to a .net 4 client profile? Check you project's references to see if there's any exclamation mark on any of the references.


    Please mark posts as answers/helpful if it answers your question
    Sunday, November 7, 2010 7:45 AM
  • The error message tells: "This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded" which means the System.Data DLL in folder v4.0 is too new to this version of WcfTestClient.

    Could you please use the ILDASM or Reflector to see the manifest of the WcfTestClient.exe and make sure it is with version: v4.0?

     Also, you may copy the Test Client to other servers and see if the same problem will occur or not. Does this problem happen on your workstation?

    Monday, November 8, 2010 7:13 AM
  • Hi Eduardo,

    As Ido mentioned, you can try using webbrowser to access the metadata/wsdl page to see whether it works.

    Also, the error message indicate that the .NET 4.0 built-in assemblies cannot be found, I'm wondering if you have incorrectly configure the IIS 7 application pool(used for your WCF service) to other .NET framework version(such as .NET 2.0). You can check the application pool to make sure the .NET framework version of it is set to 4.0:

    #Specify a .NET Framework Version for an Application Pool (IIS 7)
    http://technet.microsoft.com/en-us/library/cc754523(WS.10).aspx


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    • Marked as answer by Mog Liang Monday, November 15, 2010 9:05 AM
    Tuesday, November 9, 2010 3:43 AM
    Moderator
  • This is happening to me as well. We copied the WcfTestClient.exe, WcfTestClient.exe.config, SvcUtil.exe, and SvcUtil.exe.config to a folder on another developer's Windows XP SP3 machine without Visual Studio installed. I had him install .NET Framework 4.0 from MS downloads and we are getting this same error. I checked the manifest and the assembly cache and everything matches up. Any other ideas? This also pertains to the WcfTestClient running locally and has nothing to do with the services at all as presented by other posts in this topic.
    Friday, December 3, 2010 1:58 PM
  • @CBeers,

    Did you find a solution to this?  I'm just starting to test WCF and I'm having the same problem.  Running windows 7 64 bit.

    Monday, February 14, 2011 10:08 PM
  • Unfortunately, I have not. We ended up caving in and installing VS 2010 Professional on the other developer's machine. I would still like to know what is really needed for this to work as installing VS 2010 is really extreme just to do simple web service testing. Sorry I couldn't be of more help as I too am still waiting or an answer and have not found it yet.
    Tuesday, February 15, 2011 2:07 AM
  • Hello,

    To run WCFTestClient.exe as a standalone appplication (without install a full version of Visual Studio 2010):

    1. Create a directory in the dest. machine and copy wcftestclient.exe there (only that file).

    2. Copy Microsoft.VisualStudio.VirtualTreeGrid.dll (version 10)  from C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.VisualStudio.VirtualTreeGrid\v4.0_10.0.0.0__b03f5f7f11d50a3a to same directory of wcftestclient.exe in the dest. machine.

    3. You would create in your destination machine the following two registry keys:

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A\WinSDK-NetFx40Tools-x64]
    "InstallationFolder"="\"

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A\WinSDK-NetFx40Tools-x86]
    "InstallationFolder"="\"

    STEP NOTE: You could export them from your development machine (maybe you could find another version, but please try with v7.0A first).

    4. Then you will need copy from: C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\NETFX 4.0 Tools\svcutil.exe
     to your destination machine (same directory as wcftestclient.exe)

    STEP NOTE: Is important this version of svcutil.exe

    5. Run wcftestclient.exe

    FINAL NOTES: You will need only two .exe files and one .dll (wcftestclient.exe, svcutil.exe and Microsoft.VisualStudio.VirtualTreeGrid.dll) to run the application.

    I hope I have helped.
    Best regards.

     
    Monday, September 30, 2013 12:53 PM
  • I had the same error.

    Sebastians solution worked for me.  As described it is important to use the right version of the svcutil. With the wrong version you will get the error.


    • Edited by denyo85 Tuesday, April 8, 2014 9:16 AM
    Tuesday, April 8, 2014 9:15 AM
  • I still had registry issues - I even exported\imported the registry keys.  I installed the Windows Software Development Kit (SDK) for Windows 8 and it started working.

    Hope it helps someone.

    Saturday, April 12, 2014 10:15 PM
  • Nice solution! Thank you!

    But as I right click "Config File" and choose "Edit with SvcConfigEditor", it shows an error:

    Failed to start Service Configuration Editor. Please make sure Microsoft Windows SDK is correctly installed.

    It looks like a simple problem, and I guess it's connected with register again, but i can't get it through. I can run SvcConfigEditor standalone but if 2 tools can connect, it'll be cool! I appreciate any suggestions from you!

    Wednesday, August 27, 2014 1:30 AM
  • SvcConfigEditor.exe needs to be put in the same directory as WcfTestClient.exe and the rest of required files.

    Here is a list of all needed files and the registry key names for all recent versions of Visual Studio. Put all the files in one directory and create the registry key.

    Registry note: only the respective key must exist, it may be empty (i.e. there is no need to create the InstallationFolder value).

    VS 2012 (11.0):
    C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\WcfTestClient.exe
    C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.VisualStudio.VirtualTreeGrid\v4.0_11.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.VirtualTreeGrid.dll
    C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\SvcUtil.exe
    C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\SvcConfigEditor*.*

    Registry key: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v8.0A\WinSDK-NetFx40Tools-x86

    VS 2013 (12.0):
    C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\WcfTestClient.exe
    C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.VisualStudio.VirtualTreeGrid\v4.0_12.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.VirtualTreeGrid.dll
    C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\SvcUtil.exe
    C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\SvcConfigEditor*.*

    Registry key: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v8.1A\WinSDK-NetFx40Tools-x86

    VS 2015 (14.0):
    C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\WcfTestClient.exe
    C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.VisualStudio.VirtualTreeGrid\v4.0_14.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.VirtualTreeGrid.dll
    C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6 Tools\SvcUtil.exe
    C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6 Tools\SvcConfigEditor*.*

    Registry key: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\NETFXSDK\4.6\WinSDK-NetFx40Tools-x86

    VS "15" Preview (15.0):
    C:\Program Files (x86)\Microsoft Visual Studio 15.0\Common7\IDE\WcfTestClient.exe
    C:\Program Files (x86)\Microsoft Visual Studio 15.0\Common7\IDE\PrivateAssemblies\Microsoft.VisualStudio.VirtualTreeGrid.dll
    C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6 Tools\SvcUtil.exe
    C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6 Tools\SvcConfigEditor*.*

    Registry key: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\NETFXSDK\4.6\WinSDK-NetFx40Tools-x86

    (All of the above is valid for 64-bit OSes; on a 32-bit OS it would be "Program Files" (no " (x86)") and no Wow6432Node in the registry key paths.)


    Monday, April 25, 2016 10:47 AM