首页 > 代码库 > DevExpress Components16.2.6 Source Code 重编译教程
DevExpress Components16.2.6 Source Code 重编译教程
http://www.cnblogs.com/Soar1991/p/6669862.html
DevExpress 是一个比较有名的界面控件套件,提供了一系列优秀的界面控件。这篇文章将展示如何在拥有源代码的情况下,对 DevExpress 的程序集进行重新编译。
特别提示:重编译后,已安装好的 DevExpress Demo 项目都将无法正常运行,需要将 Demo 也进行重编译操作后,方可恢复正常,新手请注意。
系统必备
- Windows 7 SP1 以上操作系统
- Visual Studio 2010 SP1
- .Net Framework 4.5 [ 下载 .Net Framework 4.5 ]
- Silverlight 5.0 SDK [ 下载 Silverlight 5.0 SDK ]
- ASP.NET MVC 3 [ 下载 ASP.NET MVC 3 ] (下载 AspNetMVC3ToolsUpdateSetup.exe 即可。)
编译前准备
- 准备好 DevExpress 安装文件。
- 准备好 DevExpress 对应版本的源代码文件并解压好。
- 下载 Source Code Builder Tool 到本机解压好拿到 SourceBuilderTool.exe 。
- 下载 DevExpress 编译过程中需要用到的dll 到本机并解压好。
- 使用 DevExpress 安装文件安装好 DevExpress 。
重编译 DevExpress 程序集
- 以下操作可能需要管理员权限才能正常运行。
- 如果编译过程中提示未联网(Machine does not have Internet connection.),说明您可能需要扶墙才能继续继续。
- 将解压好的源代码文件全部复制至 DevExpress 安装目录下的 Components\Sources 文件夹(如:C:\Program Files (x86)\DevExpress 16.2\Components\Sources)。如果有重名文件,选择合并、替换。
- 将 SourceBuilderTool.exe 同样复制到 Sources 文件夹。
- 在 DevExpress 安装目录下建立 libs 目录,并将解压好的“DevExpress 编译过程中需要用到的dll”复制进去。
- 以管理员身份打开 Visual Studio 命令提示(2010) 。
- <iframe id="iframe_0.5147263911716355" src="data:text/html;charset=utf8,%3Cstyle%3Ebody%7Bmargin:0;padding:0%7D%3C/style%3E%3Cimg%20id=%22img%22%20src=%22https://www.coderbusy.com/wp-content/uploads/2017/04/1491380837_3191669428.png?_=6669862%22%20style=%22border:none;max-width:848px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById(‘img‘);%20window.parent.postMessage(%7BiframeId:‘iframe_0.5147263911716355‘,width:img.width,height:img.height%7D,%20‘http://www.cnblogs.com‘);%7D%3C/script%3E" frameborder="0" scrolling="no" width="320" height="240"></iframe>
- 切换至刚才新建好的 libs 目录。
- <iframe id="iframe_0.02801757441197017" src="data:text/html;charset=utf8,%3Cstyle%3Ebody%7Bmargin:0;padding:0%7D%3C/style%3E%3Cimg%20id=%22img%22%20src=%22https://www.coderbusy.com/wp-content/uploads/2017/04/1491381995_79795102.png?_=6669862%22%20style=%22border:none;max-width:848px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById(‘img‘);%20window.parent.postMessage(%7BiframeId:‘iframe_0.02801757441197017‘,width:img.width,height:img.height%7D,%20‘http://www.cnblogs.com‘);%7D%3C/script%3E" frameborder="0" scrolling="no" width="320" height="240"></iframe>
- 使用 gacinstall.bat 将目录中的程序集注册至 GAC 。
- <iframe id="iframe_0.4309339627494928" src="data:text/html;charset=utf8,%3Cstyle%3Ebody%7Bmargin:0;padding:0%7D%3C/style%3E%3Cimg%20id=%22img%22%20src=%22https://www.coderbusy.com/wp-content/uploads/2017/04/1491382012_4150824483.png?_=6669862%22%20style=%22border:none;max-width:848px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById(‘img‘);%20window.parent.postMessage(%7BiframeId:‘iframe_0.4309339627494928‘,width:img.width,height:img.height%7D,%20‘http://www.cnblogs.com‘);%7D%3C/script%3E" frameborder="0" scrolling="no" width="320" height="240"></iframe>
- 等待注册完成。
- <iframe id="iframe_0.7102484433209701" src="data:text/html;charset=utf8,%3Cstyle%3Ebody%7Bmargin:0;padding:0%7D%3C/style%3E%3Cimg%20id=%22img%22%20src=%22https://www.coderbusy.com/wp-content/uploads/2017/04/1491382043_3346808381.png?_=6669862%22%20style=%22border:none;max-width:848px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById(‘img‘);%20window.parent.postMessage(%7BiframeId:‘iframe_0.7102484433209701‘,width:img.width,height:img.height%7D,%20‘http://www.cnblogs.com‘);%7D%3C/script%3E" frameborder="0" scrolling="no" width="320" height="240"></iframe>
- 打开 Sources 目录下的 SourceBuilderTool.exe ,应无错误输出。<iframe id="iframe_0.8974452523015573" src="data:text/html;charset=utf8,%3Cstyle%3Ebody%7Bmargin:0;padding:0%7D%3C/style%3E%3Cimg%20id=%22img%22%20src=%22https://www.coderbusy.com/wp-content/uploads/2017/04/1491382688_3217971681.png?_=6669862%22%20style=%22border:none;max-width:848px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById(‘img‘);%20window.parent.postMessage(%7BiframeId:‘iframe_0.8974452523015573‘,width:img.width,height:img.height%7D,%20‘http://www.cnblogs.com‘);%7D%3C/script%3E" frameborder="0" scrolling="no" width="320" height="240"></iframe>
- 点击 Build 按钮,开始编译。
- <iframe id="iframe_0.7014389635146256" src="data:text/html;charset=utf8,%3Cstyle%3Ebody%7Bmargin:0;padding:0%7D%3C/style%3E%3Cimg%20id=%22img%22%20src=%22https://www.coderbusy.com/wp-content/uploads/2017/04/1491382704_650578011.png?_=6669862%22%20style=%22border:none;max-width:848px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById(‘img‘);%20window.parent.postMessage(%7BiframeId:‘iframe_0.7014389635146256‘,width:img.width,height:img.height%7D,%20‘http://www.cnblogs.com‘);%7D%3C/script%3E" frameborder="0" scrolling="no" width="320" height="240"></iframe>
- 如果弹出“StrongKey Selection Form”,说明源码中暂时没有强签名,选择第一项即可继续。如果未弹出,忽略该步骤。<iframe id="iframe_0.1659829329029272" src="data:text/html;charset=utf8,%3Cstyle%3Ebody%7Bmargin:0;padding:0%7D%3C/style%3E%3Cimg%20id=%22img%22%20src=%22https://www.coderbusy.com/wp-content/uploads/2017/04/1491382720_618894033.png?_=6669862%22%20style=%22border:none;max-width:848px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById(‘img‘);%20window.parent.postMessage(%7BiframeId:‘iframe_0.1659829329029272‘,width:img.width,height:img.height%7D,%20‘http://www.cnblogs.com‘);%7D%3C/script%3E" frameborder="0" scrolling="no" width="320" height="240"></iframe>
- 等待编译完成(时间会根据PC配置不同而差异。20分钟以内都为正常)。<iframe id="iframe_0.33398131446127555" src="data:text/html;charset=utf8,%3Cstyle%3Ebody%7Bmargin:0;padding:0%7D%3C/style%3E%3Cimg%20id=%22img%22%20src=%22https://www.coderbusy.com/wp-content/uploads/2017/04/1491382744_2375688112.png?_=6669862%22%20style=%22border:none;max-width:848px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById(‘img‘);%20window.parent.postMessage(%7BiframeId:‘iframe_0.33398131446127555‘,width:img.width,height:img.height%7D,%20‘http://www.cnblogs.com‘);%7D%3C/script%3E" frameborder="0" scrolling="no" width="320" height="240"></iframe>
- 编译完毕。
- <iframe id="iframe_0.9357808505055347" src="data:text/html;charset=utf8,%3Cstyle%3Ebody%7Bmargin:0;padding:0%7D%3C/style%3E%3Cimg%20id=%22img%22%20src=%22https://www.coderbusy.com/wp-content/uploads/2017/04/1491383428_178332447.png?_=6669862%22%20style=%22border:none;max-width:848px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById(‘img‘);%20window.parent.postMessage(%7BiframeId:‘iframe_0.9357808505055347‘,width:img.width,height:img.height%7D,%20‘http://www.cnblogs.com‘);%7D%3C/script%3E" frameborder="0" scrolling="no" width="320" height="240"></iframe>
- 查看 Sources 目录下是否含有 build_errors.log 文件,如果没有或者内容为空,说明编译是成功的。
- 如果编译过程中有错误,可以查看 build.log 文件,找到错误原因并修正。
验证编译结果
重编译后,DevExpress 程序集的签名信息发生了改变,已安装好的 DevExpress Demo 项目都将无法正常运行,我们需要通过打开 Demo 源代码重新编译的形式来运行 Demo ,并验证重编译结果。 打开 MDIDemo.sln 解决方案(路径:C:\Users\Public\Documents\DevExpress Demos 16.2\Components\WinForms\CS\MDIDemo\MDIDemo.sln)并运行项目。如果无生成错误信息且点击“ Help -> About ”菜单弹出如下信息,则表示重编译已经成功。
<iframe id="iframe_0.4424502942198021" src="data:text/html;charset=utf8,%3Cstyle%3Ebody%7Bmargin:0;padding:0%7D%3C/style%3E%3Cimg%20id=%22img%22%20src=%22https://www.coderbusy.com/wp-content/uploads/2017/04/1491384425_2976598406.png?_=6669862%22%20style=%22border:none;max-width:848px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById(‘img‘);%20window.parent.postMessage(%7BiframeId:‘iframe_0.4424502942198021‘,width:img.width,height:img.height%7D,%20‘http://www.cnblogs.com‘);%7D%3C/script%3E" frameborder="0" scrolling="no" width="320" height="240"></iframe>
转载
DevExpress Components16.2.6 Source Code 重编译教程