首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >部署时面临的Sharpshell问题

部署时面临的Sharpshell问题
EN

Stack Overflow用户
提问于 2016-08-04 22:08:47
回答 1查看 248关注 0票数 1

当我在客户端机器上部署锐器时,我面临一些问题,如果有人能帮我的话,我真的同意了。配置如下

  1. Sharpshell 2.2.0
  2. 64位操作系统
  3. 框架4.5.1
  4. Vc++ 2010可再发行
  5. 部署包构建在x86体系结构上。

一旦我查看错误日志,发现“初始化Nativebridge失败”的错误正在发生,这是一个非常棒的库工作,就像Dev环境中的魅力一样。

机器Config 错误日志

EN

回答 1

Stack Overflow用户

发布于 2016-08-08 05:21:43

终于..。我为我所面临的问题找到了一份工作:)。

  1. 首先,采用主分支形式GET,并将Nativebridge项目转化为x64可压缩。多亏了裁判
  2. 在文件SharpShell\NativeBridge\NativeBridge.cs下做了一些微小的更改,函数初始化(),在我撰写这篇文章时,nativeBridge库尝试load.The函数的行在编辑后如下所示。 公共bool初始化(){ //获取清单资源名称。var resouceName = GetBridgeManifestResourceName();//我们现在尝试获取桥库路径。字符串bridgeLibraryPath = string.Empty;尝试{ index = resouceName.LastIndexOf('.') >0?System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location),resouceName.LastIndexOf('.',resouceName.LastIndexOf('.') - 1):-1;字符串resouceNameTrimed = resouceName.Substring(index+1,resouceName.Length - (index+1));字符串ResourcePath = String.Format(@"{0}{1}",resouceName.LastIndexOf resouceNameTrimed);使用(var resourceStream = File.OpenRead(ResourcePath)) { //设置临时路径。bridgeLibraryPath = Path.GetTempPath() + Guid.NewGuid().ToString() + ".dll";使用(var tempStream = File.Create(bridgeLibraryPath)) { resourceStream.CopyTo(tempStream);}}捕捉(异常){ //记录异常。Logging.Error("NativeBridge:未能提取桥库。清单路径为‘+ bridgeLibraryPath +“,异常);返回false;} //加载桥库。尝试{ libraryHandle = Kernel32.LoadLibrary(bridgeLibraryPath);}捕捉(异常){ //记录异常。Logging.Error("NativeBridge:加载桥库的异常“,异常);} //如果没有加载库,记录最后一个窗口错误。if (libraryHandle == IntPtr.Zero) { Logging.Error("NativeBridge:未能加载桥库“),新Win32Exception(Marshal.GetLastWin32Error());返回false;}Logging.Log(”桥初始化“);//我们已成功加载桥接库。返回true;}
代码语言:javascript
复制
1. Made the sharpshell, servermanager projects etc to x64 compactable, just Changed the target frame work to x64 and rebuilt.
2. Replace the sharpshell dll reference with the above in my project. 
3. Added files "SharpShellNativeBridge32.dll" and "SharpShellNativeBridge64.dll" to the working folder of my project.

是的,这对我的案子来说已经足够了,就像后来的魅力一样。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/38778205

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档