Answered WCF Test Client: Failed adding service

  • Monday, July 30, 2007 8:46 AM
     
     

     

    Hi,

     

    I installed the VS2008 beta 2 on a pretty clean WINXP PRO SP2 and when trying to run the defauld WCF service library, I get error messages:

     

    svcutil.exe has encountered a problem and needs to close....

    WCF Test Client: Failed adding service./
    Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly 'svcutil, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Strong name validation failed. (Exception from HRESULT: 0x8013141A)
    File name: 'svcutil, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' ---> System.Security.SecurityException: Strong name validation failed. (Exception from HRESULT: 0x8013141A)
    The Zone of the assembly that failed was:
    MyComputer


     

    What can it be?

     

    Thanks,

    Nuno

All Replies

  • Monday, July 30, 2007 5:34 PM
     
     Answered

     

    This is a known issue in Beta2. Svcutil.exe is not signed correctly.

    1.       Open the VS command prompt.

    2.       Browse to the bin directory of the windows SDK

    3.       Type: sn –Vr svcutil.exe

    You only need to do this once. The test client will work.

  • Wednesday, August 29, 2007 8:17 PM
     
     

    This fixed my problem. But I got another one right after the fix. Here is what I did:

    1) Create a new WF Service Library

    2) Added a Code activity inside the Receive Activity that looked like this:

     

    private void codeActivity1_ExecuteCode(object sender, EventArgs e)

    {

         returnValue = "Hello " + inputMessage;

    }

     

    3) Hit F5 to run it.

     

    The WCF Test Client Starts, and when "Adding service..." I get the error below. I tried the following fixes (unsuccessfully)

    a) disable the firewall

    b) changing the port to make sure I use a free one in my machine

    c) start VS as admin.

     

    I'm using Orcas beta 2, on Vista.

    Regards,

     

    Nestor

     

    See the end of this message for details on invoking
    just-in-time (JIT) debugging instead of this dialog box.

    ************** Exception Text **************
    System.NullReferenceException: Object reference not set to an instance of an object.
       at Microsoft.Tools.TestClient.DataContractAnalyzer.ExtractContractTypes(Type contractType, String& clientTypeName)
       at Microsoft.Tools.TestClient.DataContractAnalyzer.AnalyzeDataContract(ClientEndpointInfo endpoint)
       at Microsoft.Tools.TestClient.DataContractAnalyzer.AnalyzeDataContract(ClientEndpointInfo endpoint)
       at Microsoft.Tools.TestClient.ServiceAnalyzer.AnalyzeProxy(IDictionary`2 services, String projectPath, String proxyPath, ServiceModelSectionGroup configObject, String configPath, String& errorMessage)
       at Microsoft.Tools.TestClient.ServiceAnalyzer.AnalyzeService(Workspace workspace, String address, String& errorMessage)
       at Microsoft.Tools.TestClient.Workspace.AddServiceProject(String endpoint, String& error)
       at Microsoft.Tools.TestClient.AddServiceExecutor.Execute(AddServiceInputs inputs, Workspace workspace)
       at Microsoft.Tools.TestClient.UI.MainForm.addServiceWorker_DoWork(Object sender, DoWorkEventArgs e)
       at System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs e)
       at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)


    ************** Loaded Assemblies **************
    mscorlib
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.1378 (REDBITSB2.050727-1300)
        CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
    ----------------------------------------
    WcfTestClient
        Assembly Version: 9.0.0.0
        Win32 Version: 9.0.0431.0
        CodeBase: file:///C:/Program%20Files/Microsoft%20Visual%20Studio%209.0/Common7/IDE/WcfTestClient.exe
    ----------------------------------------
    System
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.1378 (REDBITSB2.050727-1300)
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
    ----------------------------------------
    System.Windows.Forms
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.1378 (REDBITSB2.050727-1300)
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
    ----------------------------------------
    System.Drawing
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.1378 (REDBITSB2.050727-1300)
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
    ----------------------------------------
    System.ServiceModel
        Assembly Version: 3.0.0.0
        Win32 Version: 3.0.4506.590 (winfxredb2.004506-0590)
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.ServiceModel/3.0.0.0__b77a5c561934e089/System.ServiceModel.dll
    ----------------------------------------
    System.Configuration
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.1378 (REDBITSB2.050727-1300)
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
    ----------------------------------------
    System.Xml
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.1378 (REDBITSB2.050727-1300)
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
    ----------------------------------------
    SMDiagnostics
        Assembly Version: 3.0.0.0
        Win32 Version: 3.0.4506.590 (winfxredb2.004506-0590)
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/SMDiagnostics/3.0.0.0__b77a5c561934e089/SMDiagnostics.dll
    ----------------------------------------
    System.ServiceBus
        Assembly Version: 0.9.0.8
        Win32 Version: 0.9.0.8
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.ServiceBus/0.9.0.8__31bf3856ad364e35/System.ServiceBus.dll
    ----------------------------------------
    System.WorkflowServices
        Assembly Version: 3.5.0.0
        Win32 Version: 3.5.0431.0
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.WorkflowServices/3.5.0.0__31bf3856ad364e35/System.WorkflowServices.dll
    ----------------------------------------
    System.ServiceModel.Web
        Assembly Version: 3.5.0.0
        Win32 Version: 3.5.0431.0
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.ServiceModel.Web/3.5.0.0__31bf3856ad364e35/System.ServiceModel.Web.dll
    ----------------------------------------
    Microsoft.VisualStudio.Diagnostics.ServiceModelSink
        Assembly Version: 3.0.0.0
        Win32 Version: 9.0.20706.1
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Microsoft.VisualStudio.Diagnostics.ServiceModelSink/3.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.Diagnostics.ServiceModelSink.dll
    ----------------------------------------
    System.Runtime.Serialization
        Assembly Version: 3.0.0.0
        Win32 Version: 3.0.4506.590 (winfxredb2.004506-0590)
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Runtime.Serialization/3.0.0.0__b77a5c561934e089/System.Runtime.Serialization.dll
    ----------------------------------------
    System.Data
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.1378 (REDBITSB2.050727-1300)
        CodeBase: file:///C:/Windows/assembly/GAC_32/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll
    ----------------------------------------

    ************** JIT Debugging **************
    To enable just-in-time (JIT) debugging, the .config file for this
    application or computer (machine.config) must have the
    jitDebugging value set in the system.windows.forms section.
    The application must also be compiled with debugging
    enabled.

    For example:

    <configuration>
        <system.windows.forms jitDebugging="true" />
    </configuration>

    When JIT debugging is enabled, any unhandled exception
    will be sent to the JIT debugger registered on the computer
    rather than be handled by this dialog box.


     

     

     

  • Tuesday, September 11, 2007 8:06 PM
     
     Answered

    Are you shure you've specified not null input parameter? It works fine on my PC.

     

    Regards,

    Sergey Smirnov

     

     

  • Wednesday, September 26, 2007 3:42 AM
     
     

    In Vista we have to give the rights to edit registry before executing this command. Otherwise this is what you will get.


    C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin>sn -Vr svcutil.exe

    Microsoft (R) .NET Framework Strong Name Utility  Version 3.5.20706.1
    Copyright (c) Microsoft Corporation.  All rights reserved.

    Failed to open registry key -- Access is denied.

     

     

  • Tuesday, October 23, 2007 2:24 AM
     
     
    Well This exact thing happened to me.  I have XP service Pack2 using vs 2008 ... I went as far as deleting version 2 and service packs, 3 and 3.5.  When I was removing version 3.5 it took over 30 minutes and the same for replacing it.  My error was trying to create the classes using the "SvcUtil.exe

    "".

    I get the "strong name ...." error and the utility exits with an unknown erreor.  I have tried to go around using the "snremove" utility and it can identified the .net framework as having the strong name ...." however it can not open the dll to remove it.

    I have been having a lot of odd problems such as at time not being able to debug.  Components not being recognized or Master files having unknown error...

    I could really use some help........the PC has been sending the errors to microsoft so by now they probably have a good 60, 70 of them ...

    Thanks

  • Tuesday, October 23, 2007 7:49 AM
     
     

    Here is some intresting reading....

    http://support.microsoft.com/kb/907487

    I do have a sql2005 on my PC and I did try some services through it.  Can an export help now...I am really not that good in undrestanding the system; however loking at the log errors it seems like they have a lot in common with sql services.

     

  • Sunday, November 18, 2007 9:19 PM
     
     

     

    In Vista, you can also right-click the VS 2008 command prompt and choose 'Run as Administrator' and run the sn -Vr svcutil.exe command.

     

    Cheers

  • Saturday, April 25, 2009 5:03 AM
     
     
    Or you could use a better tool, something like WCFStorm, http://www.wcfstorm.com .  I've been using it for some time and I'm impressed.  I used to use WcfTestClient and WCF Load Test, but now I only use WCFStorm.  You should check it out.