I'm trying to write a utility that automatically sets the ProviderManifestToken
attribute in an EDMX document Schema element, but even my basic XPath is not working. What am I doing wrong?
The XML:
<?xml version="1.0" encoding="utf-8"?>
<edmx:Edmx Version="1.0" xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx">
<!-- EF Runtime content -->
<edmx:Runtime>
<!-- SSDL content -->
<edmx:StorageModels>
<Schema Namespace="PvmmsModel.Store" Alias="Self" Provider="System.Data.SqlClient" ProviderManifestToken="2005
My attempt:
var edmx = new XmlDocument();
edmx.Load(@"C:\Development\Provantage\PvmmsApp\Model.edmx");
var nsm = new XmlNamespaceManager(edmx.NameTable);
nsm.AddNamespace("edmx", "http://schemas.microsoft.com/ado/2007/06/edmx");
var x = edmx.SelectSingleNode("//edmx:Edmx/edmx:Runtime/edmx:StorageModels", nsm);
This works, but as soon as I append Schema
to the query. Then I get a null result.