wpf를 사용하여 .net 프레임 워크 4.0에서 프로젝트를 개발 중입니다. 다음은 Crystal Report Viewer 용 XAML 코드입니다. InitializeComponent()에서 XAMLParseException 처리되지 않았습니다.
<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">
<Grid Margin="0,0,2,-1">
<Button x:Name="Back" Content="Back" HorizontalAlignment="Left" Height="38" Margin="198,522,0,0" VerticalAlignment="Top" Width="115" Click="Back_Click"/>
<my:CrystalReportsViewer x:Name="KhataBahiAMReportsViewer" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Height="490"/>
</Grid>
그러나 InitializeComponent를 제외한 다음에 그 기부();
이 문제에 대한 해결책을 찾고있는 경우, .Net 4.0 런타임에 오래된 .Net dll을 지원하도록 컴파일러에게 명시해야하기 때문에 이러한 문제가 발생했음을 제안했습니다. 다음으로 app.config에 다음을 추가했습니다.
<startup useLegacyV2RuntimeActivationPolicy="true" >
<supportedRuntime version= "v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
을 제기하지만 컴파일러는 항상 그래서이
같은 메시지를 표시, 더 나는 dotnetconfig40.xsd의 속성에 가서
<xs:element name="startup" vs:help="configuration/startup">
<xs:complexType>
<xs:choice minOccurs="1" maxOccurs="1">
<xs:element name="requiredRuntime" vs:help="configuration/startup/requiredRuntime">
<xs:complexType>
<xs:attribute name="version" type="xs:string" use="optional" />
<xs:attribute name="safemode" type="xs:boolean" use="optional" />
</xs:complexType>
</xs:element>
<xs:element name="supportedRuntime" minOccurs="1" maxOccurs="unbounded" vs:help="configuration/startup/supportedRuntime">
<xs:complexType>
<xs:attribute name="version" type="xs:string" use="optional" />
<xs:attribute name="sku" type="xs:string" use="optional" />
</xs:complexType>
</xs:element>
</xs:choice>
<xs:attribute name="useLegacyV2RuntimeActivationPolicy" type="xs:boolean" use="optional" />
<!-- see http://msdn.microsoft.com/en-us/library/bbx34a2h.aspx -->
</xs:complexType>
</xs:element>
로 시작을 편집
경고가 제거되었지만 예외가 지속될 때까지 예외가 발생했습니다. 난 명시 적으로의 app.config
<runtime>
<assemblyBinding xmlns ="clr-namespace:SAPBusinessObjects.WPF.Viewer;assembly=SAPBusinessObjects.WPF.Viewer">
<probing privatePath="C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86"/>
</assemblyBinding>
</runtime>
하지만, 행운의 어셈블리를 결합하려고 노력했다. 해결책을 제안하십시오.
예외는 무엇입니까? – JeffRSon
'xmlns : x = http : // schemas.microsoft.com/winfx/2006/xaml'에서 따옴표가 누락 되었기 때문일 수 있습니까? – Sjeijoet
나는 그것도 시도했지만 여전히 동일한 예외를 제공합니다. – Naina