2014-12-04 3 views
0

전 구내 CRM 2013 (PreCreateOpportunityProduct - 별다른 기능 없음) 용 단일 플러그인을 개발했습니다. Visual Studio CRM 솔루션에서 생성 된 Entities.cs뿐만 아니라 각 엔티티의 부분 클래스를 포함하는 프로젝트 (BusinessLogic)를 추가했습니다. 따라서 하나의 별도 클래스에 하나의 특별한 엔티티에 대한 로직을 캡슐화 할 수 있습니다. 지금까지 별거 아니야. 이제 이러한 로직을 사용하고자하므로 플러그인 프로젝트에 프로젝트 참조를 추가합니다. 필요한 모든 DLL을 하나로 병합해야하므로 모든 DLL을 ILMerge와 병합하기위한 빌드 후 이벤트를 추가했습니다. 사용 된 DLL과 솔루션/프로젝트의ILMerge가 포함 된 MS CRM 2013의 플러그인 배포가 실패했습니다

개요 : 다음과 같이 빌드 후 명령을 보이는

solution overview

:

mkdir "$(TargetDir)Merged" 
"$(SolutionDir)Libs/ilmerge.exe" /keyfile:"$(ProjectDir)keypair.snk" /target:library /copyattrs /targetplatform:v4,"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0" /out:"$(TargetDir)Merged\Flag.Plugins.dll" "$(TargetDir)Flag.Plugins.dll" "$(TargetDir)BusinessLogic.dll" "$(TargetDir)Microsoft.Crm.Sdk.Proxy.dll" "$(TargetDir)Microsoft.Xrm.Sdk.dll" 
del "$(TargetDir)*.*" /Q 
move "$(TargetDir)Merged\*.*" "$(TargetDir)" 

RegisterFile.crmregister :

<?xml version="1.0" encoding="utf-8"?> 
<Register xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/crm/2011/tools/pluginregistration"> 
    <Solutions> 
    <Solution Assembly="Flag.Plugins.dll" Id="f4dff197-5b7a-e411-80c3-005056ba5a51" IsolationMode="None" SourceType="Database"> 
     <PluginTypes> 
     <Plugin Description="Plug-in to PreOpportunityProductCreate" FriendlyName="PreOpportunityProductCreate" Name="Flag.Plugins.PreOpportunityProductCreate" Id="0f7bd0bc-2b7b-e411-80c3-005056ba5a51" TypeName="Flag.Plugins.PreOpportunityProductCreate"> 
      <Steps> 
      <clear /> 
      <Step CustomConfiguration="" Name="PreOpportunityProductCreate" Description="Pre-Operation of Opportunity Product Create" Id="107bd0bc-2b7b-e411-80c3-005056ba5a51" MessageName="Create" Mode="Synchronous" PrimaryEntityName="opportunityproduct" Rank="1" SecureConfiguration="" Stage="PreInsideTransaction" SupportedDeployment="ServerOnly"> 
       <Images /> 
      </Step> 
      </Steps> 
     </Plugin> 
     </PluginTypes> 
    </Solution> 
    </Solutions> 
    <XamlWorkflows /> 
</Register> 

참고 : Deployment Manager + 시스템 관리자 - > 모든 권한

나는 CrmPackage 프로젝트 오류에 배포를 클릭하면

Error registering plugins and/or workflows. Plug-in assembly does not contain the required types or assembly content cannot be updated. C:\Program Files (x86)\MSBuild\Microsoft\CRM\Microsoft.CrmDeveloperTools.CrmClient.targets 

주 2 : 나는 전개가 매력처럼 작동 다른 모든 DLL을 병합하지 않고 plugin.dll하지만, 플러그인 던져 배포 할 때 예외는 BusinessLogic.dll을 알 수 없기 때문입니다.

누구든지이 문제를 해결할 수 있습니까?

미리 감사드립니다.

답변

2

발견 : 너무 많은 파일을 병합 중입니다! 자세히 : Microsoft.Crm.Sdk.Proxy.dll 및 Microsoft.Xrm.Sdk.dll입니다. 이러한 libs는 이미 crm 서버 GAC에 있습니다. 내 ilmerge 명령에서 해당 파일을 제거하면 배포가 마침내 작동합니다. https://community.dynamics.com/crm/f/117/p/146347/326928.aspx#326928

: 여기

은 나에게 중요한 힌트를 준 링크입니다
관련 문제