2012-10-26 80 views
1

我有一個.NET應用程序,它與.NET 4.0效果很好 - 雖然應用暴露了其的app.config.NET 4.5打破應用程序

但我沒有它的來源。

我已經安裝在Visual Studio 2012和.NET 4.5。突然間,.NET 4.0應用程序在某些地方拋出異常 - 我用Reflector分析了在應用程序的WPF部分的InitializeComponent()中拋出了異常。

Uri resourceLocator = new Uri("/Some.Assembly;someuri/someuri/somefile.xaml", UriKind.Relative); 

,異常是:

The invocation of the constructor on type 'DevExpress.Xpf.Grid.GridControl' that matches the specified binding constraints threw an exception. 

at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri) 
at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri) 
at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream) 
at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator) 

不幸的是,我無法分辨,如果有任何內部異常。

如果我卸載.NET 4.5和安裝.NET 4.0中,異常沒有拋出,但我不能用VS 2012年工作

我試圖將這些行添加到的app.config,但沒有成功。

<startup useLegacyV2RuntimeActivationPolicy="true" > 
    <supportedRuntime version="v4.0.30319" sku=".NETFramework,Version=v4.0" /> 
    <requiredRuntime version="v4.0.30319" /> 
</startup> 

怎樣才能力的應用程序只使用4.0和4.0?它甚至有可能嗎? .NET 4.5以某種方式與4.0程序集混合在一起?

+3

不幸的是,我相信4.5取代4.0,所以我不認爲你可以安裝4.5,但是使用4.0運行該應用程序。 – Gabe

+0

@加貝 - 儘管如此,你仍然可以** ** 4.0的框架。 – slugster

+0

@slugster:您可以定位任何框架,但是在安裝4.5框架時,定位到4.0框架並沒有幫助。 – Gabe

回答

相關問題