Dynamics CRM-从MSBUILD中删除所有新的组织,构建/部署插件-问题 [英] Dynamics CRM - Stamp out new Org, Build / Deploy Plugins all from MSBUILD - Issues
问题描述
我在部署,导出然后导入到另一个框中时遇到了运行时异常... CRM解决方案。异常是:
I'm getting a run time exception in my deployed, exported, and then imported to another box... CRM Solution. The Exception is:
System.TypeLoadException:无法从程序集 mscorlib,版本= 4.0中加载类型 System.Runtime.CompilerServices.ExtensionAttribute .0.0,Culture = neutral,PublicKeyToken = b77a5c561934e089'
仅当我使用MSBUILD脚本执行此操作时才会发生。当我手动使用VS(2010)进行此操作时,一切都很好。所以,首先怀疑的是我的剧本。我的脚本使用了受 http:// fczaja启发的MSBUILD自定义任务.blogspot.com / 2012/07 / continuous-integration-with-crm.html 。
It only occurs when I use a MSBUILD script to do this. When I use VS (2010) by hand to do this, all is well. So, first suspect is my script. My script uses a MSBUILD custom task, inspired by http://fczaja.blogspot.com/2012/07/continuous-integration-with-crm.html.
我的感觉是问题可能出在导出步骤上-使用 Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy
,向上投射到 IOrganizationService.Execute
,并传递 ExportSolutionRequest
对象。我们仅设置 SolutionName
和 Managed
属性。
My sense is the issue could be on the Export step - which uses the Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy
, up-cast to IOrganizationService.Execute
, passing an ExportSolutionRequest
object. We set the SolutionName
and Managed
properties only. Perhaps we're missing another property?
我正在尝试缩小其根本原因。
I'm trying to narrow it's root cause.
推荐答案
您是否有可能在插件程序集上使用ILMerge?
Are you by any chance using ILMerge on your plugin assembly?
如果是这样,我怀疑您的参考程序集存在问题,也许.NET 4.5在构建服务器上,而不是在手动构建它的机器上。
If so I suspect it is an issue with your reference assemblies, perhaps having .NET 4.5 on the build server but not on the machine where you build it manually.
如果确实如此,这些链接将进一步说明:
< a href = http://www.mattwrock.com/post/2012/02/29/What-you-should-know-about-running-ILMerge-on-Net-45-Beta-assemblies-targeting-Net- 40.aspx rel = nofollow> http://www.mattwrock.com/post/2012/02/29/What-you-should-know-about-running-ILMerge-on-Net-45-Beta- assembly-targeting-Net-40.aspx
These links will explain futher if this is indeed the case: http://www.mattwrock.com/post/2012/02/29/What-you-should-know-about-running-ILMerge-on-Net-45-Beta-assemblies-targeting-Net-40.aspx
基本解决方案是将ILMerge参考程序集更改为-/ targetplatform: v4,C:\ \程序文件(x86)\参考程序集\Microsoft\Framework.NETFramework\v4.0
The fundamental fix is to change your ILMerge reference assemblies to be -/targetplatform:"v4,C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0"
这篇关于Dynamics CRM-从MSBUILD中删除所有新的组织,构建/部署插件-问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!