title: AccessViolationException - Attempted to read or write protected memory. This is often an indication that other memory is corrupt
body: <p>Installed Os - Windows 10 64 bit</p>
  <p>Installed sqlxml_x64.msi and using Microsoft.Data.Sql.Xml in my application</p>
  <p>Created console application - Framework 4.5.2</p>
  <p>Here is my logic to get data from SQL database.</p>
  <pre><code>SqlXmlCommand cmd = new SqlXmlCommand(&quot;My SQL connection string&quot;);
  cmd.CommandText = &quot;/Tbl_Name[@Column_Name='SomeValue']&quot;;
  cmd.CommandType = SqlXmlCommandType.XPath;
  cmd.SchemaPath = &quot;My xsd file path&quot;;
  string strResult;
      try
      {
          strm = cmd.ExecuteStream();
          strm.Position = 0;
          using (StreamReader sr = new StreamReader(strm))
          {
              Console.WriteLine(sr.ReadToEnd());
          }
      }
  </code></pre>
  <p>When executing my application in x64 (Platform target) getting &quot;Attempted to read or write protected memory. This is often an indication that other memory is corrupt&quot; in cmd.ExecuteStream() line. Incase if i run the application in Any CPU option with enabled preferred 32 bit option, application working fine.</p>
  <p>I am not sure why its not working in Platform target as x64 and why its working in x86 and Any CPU with preferred 32-bit enabled option. Because i am installing Sqlxmlx64.msi and referring 64 bit Microsoft.Data.Sql.Xml.dll in my 64 bit console application.</p>