0
我有以下簡單的XML文件:的SelectNodes()調用返回沒什麼
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
by editing this MSBuild file. In order to learn more about this please visit http://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>FileSystem</WebPublishMethod>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish />
<LaunchSiteAfterPublish>False</LaunchSiteAfterPublish>
<ExcludeApp_Data>False</ExcludeApp_Data>
<publishUrl>E:\PublishTest</publishUrl>
<DeleteExistingFiles>True</DeleteExistingFiles>
</PropertyGroup>
</Project>
,我試圖做更改的元素之一的值如下:
但它總是爆炸。我已經刪除了XML文件頂部的註釋,我只嘗試了/Project
,只是Project
,我似乎無法理解發生了什麼問題。我看過其他帖子,但沒有看到我的問題。任何想法?謝謝!
丟失斜線使其成爲/ Project/PropertyGroup或實際選擇子項:'/ Project/PropertyGroup/*' – Kris
對不起,我應該提到我試過「xDoc.SelectNodes(」/ Project「)as好吧,甚至沒有任何回退 – skaz
你是否在手錶中檢查過xDoc?它是否包含你期望的內容? – Kris