私は.NET 4.0でうまく動作する.NETアプリを持っています - アプリはそのapp.configを公開していますが、そのソースはありません
しかし。
Visual Studio 2012 と .NET 4.5 をインストールしました。突然、.NET 4.0 アプリケーションがいくつかの場所で例外をスローしています。アプリケーションの WPF 部分の InitializeComponent() で例外がスローされることを Reflector で分析しました。
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 アセンブリと混ざっていますか?