2017-10-05 12 views
0

나는 구성 파일 (file1.config)이 같은 종류의 찾고 있습니다문어 배포 오류 : 찾을 여러 대상 요소 만이 '교체'만을 변환은 첫 경기에 적용

<?xml version="1.0" encoding="utf-8" ?> 
<configuration> 
    <myelement> 
    oldvalue 
    </myelemetn> 
</configuration> 

내가 "oldvalue"를 대체 할 "newvalue". 이런 이유로 나는 (file1.Development.config) 찾고 뭔가이 같은 파일을 만든 :

Found multiple target elements, but the 'Replace' Transform only applies to the first match

답변

0

나는이 문제를 해결 :

<?xml version="1.0" encoding="utf-8" ?> 
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"> 
    <myelement xdt:Transform="Replace"> 
    newvalue 
    </myelemetn> 
</configuration> 

문제는 내가 다음과 같은 오류가 문어 배포와 패키지를 배포 할 때이다 xdt : Locator를 추가하십시오. 그래서 지금 내 변환 파일은 다음과 같습니다

<?xml version="1.0" encoding="utf-8" ?> 
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"> 
    <myelement xdt:Transform="Replace" xdt:Locator="XPath(/configuration/myelement)"> 
    newvalue 
    </myelemetn> 
</configuration>