title: XAMLParseException was unhandled at InitializeComponent()
body: <p>I am developing my project in .net framework 4.0 using wpf.
  Following is the  XAML code for crystal report viewer.</p>
  
  <pre><code>&lt;Window x:Class="KhataBahi.GenerateReports"
          xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
          xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml
          xmlns:my="clr-namespace:SAPBusinessObjects.WPF.Viewer;assembly=SAPBusinessObjects.WPF.Viewer"
          Title="GenerateReports" Height="600" Width="550"&gt;
      &lt;Grid Margin="0,0,2,-1"&gt;
          &lt;Button x:Name="Back" Content="Back" HorizontalAlignment="Left" Height="38" Margin="198,522,0,0" VerticalAlignment="Top" Width="115" Click="Back_Click"/&gt;
          &lt;my:CrystalReportsViewer x:Name="KhataBahiAMReportsViewer" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Height="490"/&gt;
  
      &lt;/Grid&gt;
  </code></pre>
  
  <p></p>
  
  <p>However, its giving following exception at InitializeComponent();</p>
  
  <p>On looking for a solution to this problem it was suggested that this happens because you have to explicity tell the compiler to support old .Net dll’s into the .Net 4.0 runtime.So, I added the following to my app.config file</p>
  
  <pre><code>&lt;startup useLegacyV2RuntimeActivationPolicy="true" &gt;
      &lt;supportedRuntime version= "v4.0" sku=".NETFramework,Version=v4.0"/&gt;
    &lt;/startup&gt;
  </code></pre>
  
  <p>but the compiler always show message like this</p>
  
  <p>So, further I went to the properties of dotnetconfig40.xsd and edited the startup as</p>
  
  <pre><code>&lt;xs:element name="startup" vs:help="configuration/startup"&gt;
      &lt;xs:complexType&gt;
          &lt;xs:choice minOccurs="1" maxOccurs="1"&gt;
              &lt;xs:element name="requiredRuntime" vs:help="configuration/startup/requiredRuntime"&gt;
                  &lt;xs:complexType&gt;
                      &lt;xs:attribute name="version" type="xs:string" use="optional" /&gt;
                      &lt;xs:attribute name="safemode" type="xs:boolean" use="optional" /&gt;
                  &lt;/xs:complexType&gt;
              &lt;/xs:element&gt;
              &lt;xs:element name="supportedRuntime" minOccurs="1" maxOccurs="unbounded" vs:help="configuration/startup/supportedRuntime"&gt;
                  &lt;xs:complexType&gt;
                      &lt;xs:attribute name="version" type="xs:string" use="optional" /&gt;
                      &lt;xs:attribute name="sku" type="xs:string" use="optional" /&gt;
                  &lt;/xs:complexType&gt;
              &lt;/xs:element&gt;
          &lt;/xs:choice&gt;
          &lt;xs:attribute name="useLegacyV2RuntimeActivationPolicy" type="xs:boolean" use="optional" /&gt;
          &lt;!-- see http://msdn.microsoft.com/en-us/library/bbx34a2h.aspx --&gt;
      &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;
  </code></pre>
  
  <p>This removed the warnings but the exception till persists.
  I even tried to bind the assemblies explicitly in app.config </p>
  
  <pre><code>&lt;runtime&gt;
      &lt;assemblyBinding xmlns ="clr-namespace:SAPBusinessObjects.WPF.Viewer;assembly=SAPBusinessObjects.WPF.Viewer"&gt;
        &lt;probing privatePath="C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86"/&gt;
      &lt;/assemblyBinding&gt;
    &lt;/runtime&gt;
  </code></pre>
  
  <p>But, no luck. Please suggest a solution.</p>