2015-01-30 2 views
3

웹 구성에 다음 XML이 포함되어 있고 릴리스 모드에서 자식의 이름 특성 인 assemblyIdentity에 따라 dependentAssembly 섹션을 제거해야합니다. 나는 대답을 여기에서 시도했다 : xdt transform locator that matches subnode content 그러나 운 없음. 내 Web.config의이 같은 것입니다 : 나는 자식 요소하지만 성공에 따라 삭제에 대한 두 번째 dependentAssembly 요소를 선택 내 web.release.config에 다음과 같은 시도릴리스 용 웹 구성 변환

<?xml version="1.0" encoding="utf-8"?> 
<configuration> 
<runtime> 
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> 
     <dependentAssembly> 
     <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" /> 
     <bindingRedirect oldVersion="1.0.0.0" newVersion="2.0.0.0" /> 
     </dependentAssembly> 
     <dependentAssembly> 
     <assemblyIdentity name="Microsoft.VisualStudio.QualityTools.Resource" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> 
     <codeBase version="10.0.0.0" href="file:///c:/Program%20Files%20(x86)/Microsoft%20Visual%20Studio%2010.0/Common7/IDE/PrivateAssemblies/Microsoft.VisualStudio.QualityTools.HostAdapters.ASPNETAdapter.DLL" /> 
     </dependentAssembly> 
    </assemblyBinding> 
    </runtime> 
</configuration> 

.

<runtime> 
     <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1" > 
      <dependentAssembly> 
<!-- Attempt 1 --> 
      <assemblyIdentity xdt:Transform="RemoveAll" 
      xdt:Locator="Condition(@name='Microsoft.VisualStudio.QualityTools.Resource')"/> 
      </dependentAssembly> 
     </assemblyBinding> 
<!-- Attempt 2 --> 
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> 
     <dependentAssembly xdt:Transform="Remove" 
     xdt:Locator="Condition(assemblyIdentity/@name='Microsoft.VisualStudio.QualityTools.Resource')"> 
     </dependentAssembly> 
    </assemblyBinding> 
     </runtime> 
+0

https://webconfigtransformationtester.apphb.com/은 변환을 가져 오는 데 유용합니다. 또한 dependentAssembly 이름이 제공된 config와 일치하지 않으며 locator에있는 이름이 일치하지 않습니다. – BenM

+0

어셈블리 이름에 대한 저의 실수였습니다. 나는 포스트를 편집했습니다. 고맙습니다. 귀하가 제공 한 sitee는 도움이되지만 여전히 파악할 수 없습니다. –

답변

5

이 코드는 저에게 적합합니다. 이 post

<runtime> 
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> 
    <dependentAssembly xdt:Transform="Replace" xdt:Locator="Condition(./_defaultNamespace:assemblyIdentity/@name='System.Web.Mvc')"> 
     <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35"/> 
     <bindingRedirect oldVersion="1.0.0.0-5.2.3.0" newVersion="5.2.3.0"/> 
    </dependentAssembly>  
    </assemblyBinding> 
</runtime> 

모든 신용

@Thommy에 's의 유래 대답.