Comments (8)
when I remove the namespace from base.xml ,
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appSettings>
<add key="test20180421" value="1" />
<add key="test20180422" value="2" />
</appSettings>
</configuration>
then the patch generated as following
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<appSettings>
<add key="test20180423" value="3" xdt:Transform="InsertBefore(/configuration/appSettings/add[(@key='test20180422')])" />
</appSettings>
</configuration>
and there is no problem to apply source.
I am not sure if this is a bug in this repository or just bug from Microsoft.Web.Xdt
.
I have opened an issue here.
from fatantelope.
Hi @chucklu
Unfortunately, I wasn't able to reproduce the error you described. It could be related to the version of Microsoft.Web.Xdt
being used.
I did however get a different error when I pasted your example into https://fatantelopetester.apphb.com to generate a patch. The error was related to the XML namespace on the node in base.xml: xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0"
I removed the namespace and generated a patch, and then applied the patch using the FatAntelope.exe command line tool, and it correctly applied the patch.
So I suggest removing the XML namespace and trying again as it might be reason for the issue.
Cheers,
Cameron
from fatantelope.
Hi @CameronWills ,
The version of Microsoft.Web.Xdt I used is latest version 2.1.2. I also tried the version you used 2.1.1 .
Both of them have the same problem.
The workaround about remove the namespace I have found that, but that's weird.
What's the different error you got?
Actually I can encounter the same exception everytime.
When you try with the provide base.xml and target.xml, could you paste the patch.xml generated?
from fatantelope.
I know this is quite old. I've picked up this and I'm encountering the same problem. Though in my case it's
No element in the source document matches '/configuration/runtime/assemblyBinding/dependentAssembly[4]'
I'm not sure why it's occurring since XPath supports this syntax. Changing the index to a lower or higher number doesn't change the error. Updated the XDT nuget to 3.1.1 but no luck there either.
To get around this, instead of calling "InsertAfter(xyz)", I changed it to just "Insert". This solves my problem but means that I have to manually check my transformations to avoid this occurring during deployments.
from fatantelope.
@agility-matth Finally I give up to upgrade the config file through the library, because there are some custom setting in client's config file.
I just upgrade it by linq to xml, operate the xml node one by one programmatically.
from fatantelope.
from fatantelope.
@agility-matth are you able to provide the source & target files? Or at least just the /configuration/runtime/assemblyBinding
sections of both files? Obviously remove anything sensitive from the files. Thanks
from fatantelope.
Sure thing @CameronWills , I'll see what I can do early next week and send it over.
from fatantelope.
Related Issues (11)
- NPE at XdtDiffWriter: line 409 HOT 1
- Use Insert instead of InsertBefore when the delta only exist in target HOT 1
- Error when creating Transformed File HOT 3
- XPath in an InsertBefore transform is using a trait of the parent node that's been transformed into something else HOT 2
- Deploy command line tool with NuGet dist HOT 3
- Case error in generated XDT HOT 1
- the application is erroring out requiring a clear node in the source HOT 24
- Wrong patch file generated when the attribute has xml namespace
- remove namespace xdt did not work HOT 2
- Incorrect condition? HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fatantelope.