locked
Problem on The system cannot find the path specified ... after I publish the VB.Net Code RRS feed

  • 問題

  • 你好

    我嘗試 用另一間公司 provide 既api 入面有一張cert 同 key
    我試過係我部 development 既電腦度 develop 同 run 個published 既program
    個program run 到無error

    但唔知點解當我係另一部電腦度run 時 我load 到個program 同run 到其他 function
    當我run 同果個library 有關的function 時
    我有下面的error

    佢話
    <<System.Security.Cryptography.CryptographicException: The system cannot find the path specified.>>
    之後仲跟住好大段 o野

    我想知呢
    其實個program 只係找唔到 System.Security.Cryptography.CryptographicException:
    還是下面所有有關的 namespace呢?

    譞有一個問題...
    我可以點樣解決呢個
    system cannot find the path呢個問題
    我個program publish o左係 個central server 度 同選了 avaliable online only
    (其實咁做會唔會有乜o野問題?) or 選 online 同offline 果個option 會好d?

    唔好意思好多問題添

    謝謝大家

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

    ************** Exception Text **************
    System.Security.Cryptography.CryptographicException: The system cannot find the path specified.

       at System.Security.Cryptography.CryptographicException.ThrowCryptogaphicException(Int32 hr)
       at System.Security.Cryptography.X509Certificates.X509Utils._QueryCertFileType(String fileName)
       at System.Security.Cryptography.X509Certificates.X509Certificate.LoadCertificateFromFile(String fileName, Object password, X509KeyStorageFlags keyStorageFlags)
       at System.Security.Cryptography.X509Certificates.X509Certificate2..ctor(String fileName, String password)
       at BT.Sdk.Core.CertificateHelper.DeriveAndRetrieveCertFromAppConfigSettings(Boolean isServerCert)
       at BT.Sdk.Core.CertificateHelper.get_ApplicationClientCert()
       at BT.Sdk.Core.Web21cSoapExtension.ProcessMessage(SoapMessage message)
       at System.Web.Services.Protocols.SoapMessage.RunExtensions(SoapExtension[] extensions, Boolean throwOnException)
       at System.Web.Services.Protocols.SoapHttpClientProtocol.Serialize(SoapClientMessage message)
       at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
       at BT.Sdk.Messaging.OneWayCapability.MessagingOneWayService.sendMessage(Collection`1 recipientUris, String from, String messageText)
       at BT.Sdk.Messaging.OneWayCapability.MessagingOneWayManager.SendMessage(String recipient, String from, String messageText)
       at MonitoringTools.frm_ApplicationMonitorTools.btn_RestartProcess_Click(Object sender, EventArgs e)
       at System.Windows.Forms.Control.OnClick(EventArgs e)
       at System.Windows.Forms.Button.OnClick(EventArgs e)
       at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
       at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ButtonBase.WndProc(Message& m)
       at System.Windows.Forms.Button.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


    ************** Loaded Assemblies **************
    mscorlib
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
        CodeBase: file:///c:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
    ----------------------------------------
    MonitoringTools
        Assembly Version: 1.0.0.0
        Win32 Version: 1.0.0.0
        CodeBase: file:///C:/Documents%20and%20Settings/Administrator/Local%20Settings/Apps/2.0/8KPWHH20.VE1/8PTXZYN6.A48/moni..tion_46f6954facd3b529_0001.0000_4df1f80f2a8de84b/MonitoringTools.exe
    ----------------------------------------
    Microsoft.VisualBasic
        Assembly Version: 8.0.0.0
        Win32 Version: 8.0.50727.1433 (REDBITS.050727-1400)
        CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualBasic/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
    ----------------------------------------
    System
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
        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.1433 (REDBITS.050727-1400)
        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.1433 (REDBITS.050727-1400)
        CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
    ----------------------------------------
    System.Runtime.Remoting
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
        CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Runtime.Remoting/2.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll
    ----------------------------------------
    System.Configuration
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
        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.1433 (REDBITS.050727-1400)
        CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
    ----------------------------------------
    System.Data
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
        CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll
    ----------------------------------------
    System.Transactions
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
        CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Transactions/2.0.0.0__b77a5c561934e089/System.Transactions.dll
    ----------------------------------------
    System.EnterpriseServices
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
        CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.EnterpriseServices/2.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll
    ----------------------------------------
    BT.Sdk.MessagingOneWayCapability
        Assembly Version: 5.2.2.0
        Win32 Version: 5.2.2.0
        CodeBase: file:///C:/Documents%20and%20Settings/Administrator/Local%20Settings/Apps/2.0/8KPWHH20.VE1/8PTXZYN6.A48/moni..tion_46f6954facd3b529_0001.0000_4df1f80f2a8de84b/BT.Sdk.MessagingOneWayCapability.DLL
    ----------------------------------------
    System.Web.Services
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
        CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Web.Services/2.0.0.0__b03f5f7f11d50a3a/System.Web.Services.dll
    ----------------------------------------
    BT.Sdk.Core
        Assembly Version: 5.2.2.0
        Win32 Version: 5.2.2.0
        CodeBase: file:///C:/Documents%20and%20Settings/Administrator/Local%20Settings/Apps/2.0/8KPWHH20.VE1/8PTXZYN6.A48/moni..tion_46f6954facd3b529_0001.0000_4df1f80f2a8de84b/BT.Sdk.Core.DLL
    ----------------------------------------
    07ttu9ei
        Assembly Version: 5.2.2.0
        Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
        CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
    ----------------------------------------
    System.Security
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
        CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Security/2.0.0.0__b03f5f7f11d50a3a/System.Security.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.



    2008年7月28日 8:58

解答

  • Dear ChiYau,

     

    From the error

    Code Snippet

    System.Security.Cryptography.CryptographicException: The system cannot find the path specified.

       at System.Security.Cryptography.CryptographicException.ThrowCryptogaphicException(Int32 hr)
       at System.Security.Cryptography.X509Certificates.X509Utils._QueryCertFileType(String fileName)
       at System.Security.Cryptography.X509Certificates.X509Certificate.LoadCertificateFromFile(String fileName, Object password, X509KeyStorageFlags keyStorageFlags)

     

     

     

    I think that the program is generating the error when it is trying to load the certificate from a file, please make sure the second development machine also get the certificate from the same path as your primary development machine.

     

    2008年7月30日 2:21

所有回覆

  • Dear ChiYau,

     

    From the error

    Code Snippet

    System.Security.Cryptography.CryptographicException: The system cannot find the path specified.

       at System.Security.Cryptography.CryptographicException.ThrowCryptogaphicException(Int32 hr)
       at System.Security.Cryptography.X509Certificates.X509Utils._QueryCertFileType(String fileName)
       at System.Security.Cryptography.X509Certificates.X509Certificate.LoadCertificateFromFile(String fileName, Object password, X509KeyStorageFlags keyStorageFlags)

     

     

     

    I think that the program is generating the error when it is trying to load the certificate from a file, please make sure the second development machine also get the certificate from the same path as your primary development machine.

     

    2008年7月30日 2:21
  • Hi Ken,

    Thanks very much for your help. Your assumption is correct, I have forgotten to change one of the cert's path. How could you know that is the line of exception that cause the error from the though exception text?  I have no idea how to know which exception is relevant to it . You are amazing!

    Thanks a lot
    2008年7月30日 7:49