2016-08-04 56 views
1

Iam在客戶端機器上部署sharpshell時遇到了一些問題,如果有人可以幫我解決問題,那麼這個問題真的很重要。構成如下在部署時面臨的破殼問題

  1. Sharpshell 2.2.0
  2. 64位操作系統
  3. 框架4.5.1
  4. VC++ 2010可再發行
  5. 部署包是建立在x86架構

一旦我檢查錯誤日誌發現錯誤「無法初始化Nativebridge」正在發生這是一個很棒的圖書館工作,如Dev中的魅力 環境。

Machine Config Error Log

回答

0

最後..我發現周圍的工作,對此我正面臨:)問題。

  1. 首先把主分支表格GET並將Nativebridge項目設置爲x64 Compactable。 thanks to the ref

  2. 對文件SharpShell \ NativeBridge \ NativeBridge.cs,函數Initialise(),nativeBridge庫試圖加載的行進行了一些細微更改。在我編輯期間,函數如下所示我正在寫這篇文章。

     public bool Initialise() 
    { 
        // Get the manifest resource name. 
        var resouceName = GetBridgeManifestResourceName(); 
    
        // We'll now try and get the bridge library path. 
        string bridgeLibraryPath = string.Empty; 
    
        try 
        { 
         int index = resouceName.LastIndexOf('.') > 0 ? resouceName.LastIndexOf('.', resouceName.LastIndexOf('.') - 1) : -1; 
         string resouceNameTrimed = resouceName.Substring(index+1,resouceName.Length - (index+1)); 
         string ResourcePath = String.Format(@"{0}\{1}", System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location),resouceNameTrimed); 
    
         using (var resourceStream = File.OpenRead(ResourcePath)) 
         { 
          // Set the temporary path.. 
          bridgeLibraryPath = Path.GetTempPath() + Guid.NewGuid().ToString() + ".dll"; 
          using (var tempStream = File.Create(bridgeLibraryPath)) 
          { 
           resourceStream.CopyTo(tempStream); 
          } 
         } 
        } 
        catch (Exception exception) 
        { 
         // Log the exception. 
         Logging.Error("NativeBridge: Failed to extract the bridge library. The manifest path is '" + 
             bridgeLibraryPath + "'", exception); 
         return false; 
        } 
    
        // Load the bridge library. 
        try 
        { 
         libraryHandle = Kernel32.LoadLibrary(bridgeLibraryPath); 
    
        } 
        catch (Exception exception) 
        { 
         // Log the exception. 
         Logging.Error("NativeBridge: Exception loading the bridge library.", exception); 
        } 
    
        // If the library hasn't been loaded, log the last windows error. 
        if (libraryHandle == IntPtr.Zero) 
        { 
         Logging.Error("NativeBridge: Failure to load the brige library.", 
             new Win32Exception(Marshal.GetLastWin32Error())); 
         return false; 
        } 
    
        Logging.Log("Bridge Initialised"); 
    
        // We've successfully loaded the bridge library. 
        return true; 
    } 
    
  3. 所作的sharpshell,ServerManager的項目等於X64的可壓縮,只是改變了目標幀的工作x64和重建。

  4. 在我的項目中用上面的替換sharpshell dll引用。

  5. 將文件「SharpShellNativeBridge32.dll」和「SharpShellNativeBridge64.dll」添加到我的項目的工作文件夾中。

是的,對我般的魅力情況下工作是不夠事後