Dynamics CRM ISV文件夹禁用后的解决方案

      众所周知微软在CRM2011的12补丁后取消了对ISV文件夹的支持,那我们自定义开发的一些web应用或者是想部署个服务该怎么办,有的选择了另开一个站点发布。我们以服务为例这样的另开站点的发布方式会导致访问产生跨域的问题,下面介绍另一种方式也许有人也在采用,但我在网上并未找到有类似的分享,故在此分享给大家。

     我要分享的发布方式是在CRM的默认站点下以"Add Application"的方式增加一个应用程序,有人会说我也用这种方式发布过啊但是报错啊,是的报错了但这种报错是可以解决的。很多人通常使用的方式是把CRM根目录下的bin里面的DLL全部拷贝一份到发布文件夹的bin目录下,但最近有同事试了在2013下不好使了,而这次要分享的方法在2013中依旧好用(该方法从4.0到2011到现在的2013都有用),当然本身这种方式不受官方支持,如果要上纲上线的朋友就别看了。说了那么多废话言归正传,唯一要修改的东西就是发布程序的配置文件webconfig,代码如下:

<span style="font-size:14px;"><compilation debug="true" targetFramework="4.0">
    <assemblies>
      <remove assembly="Microsoft.Crm, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
      <remove assembly="Microsoft.Crm.Sdk, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
      <remove assembly="Microsoft.Crm.Platform.Sdk, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
      <remove assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
      <remove assembly="Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    </assemblies>
</compilation>
<httpModules>
	<remove name="MapOrg"/>
        <remove name="CrmFederatedAuthenticationModule" />
      	<remove name="CrmSessionAuthenticationManager"/>
      	<remove name="CrmAuthentication"  />	
</httpModules>
<httpRuntime executionTimeout="300" maxRequestLength="32768" requestValidationMode="4.0" encoderType="System.Web.Util.HttpEncoder"/></span>

在system.web节点下加如上代码(上述代码是针对2013的如果是在2011甚至4.0中使用修改下CRM的Version)。

再在configuration节点内加入以下代码,再刷新下网页发现OK能正常访问了。

<span style="font-size:14px;"><system.diagnostics>
	<sources>
      <source name="System.ServiceModel" switchValue="Error" propagateActivity="true">
        <listeners>
          <remove name="ServiceModelRedirect" />
        </listeners>
      </source>
      <source name="System.ServiceModel.Activation" switchValue="Error" propagateActivity="true">
        <listeners>
          <remove name="ServiceModelRedirect" />
        </listeners>
      </source>
      <source name="System.IdentityModel" switchValue="Error">
        <listeners>
          <remove name="ServiceModelRedirect" />
        </listeners>
      </source>
      <source name="Microsoft.IdentityModel" switchValue="Error">
        <listeners>
          <remove name="ServiceModelRedirect" />
        </listeners>
      </source>
    </sources>
</system.diagnostics></span>

转载于:https://www.cnblogs.com/VicTang/p/3808998.html

猜你喜欢

转载自blog.csdn.net/weixin_33883178/article/details/93808965