Dan*_*tro 5 c# wpf visual-studio-2010
基本上我遇到了与此(未答复)问题相同的问题:IOException未处理 - 无法找到资源app.xaml
当我在Visual Studio 2010中打开我的项目并开始调试时,我得到"IOException未处理:找不到资源app.xaml".重建解决方案不起作用,我必须以某种方式修改我的app.xaml文件(例如添加一个空行),以便成功运行我的项目.
额外细节:
[assembly: InternalsVisibleTo("MyOtherProject")])我的App.xaml包含其他三个xaml资源文件.我在这里包含我的App.xaml:
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Resources/StyleDictionary.xaml" />
<ResourceDictionary Source="Resources/CommonResources.xaml" />
<ResourceDictionary Source="Resources/ViewModelMappings.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
Run Code Online (Sandbox Code Playgroud)
如果重要的话,我会从我的App类重写OnStartup方法来手动处理启动逻辑.我还在那里写了一个静态构造函数来从MVVM Light初始化DispatcherHelper:
public partial class App : Application
{
static App()
{
GalaSoft.MvvmLight.Threading.DispatcherHelper.Initialize();
}
...
}
Run Code Online (Sandbox Code Playgroud)任何帮助将不胜感激.如果您需要更多详细信息,请告诉我.
我不知道这是否是一个最终的解决方案,但到目前为止似乎有效:
以前我有过这样的事情:
<Compile Include="app.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
Run Code Online (Sandbox Code Playgroud)
所以我修改了它,现在是:
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
Run Code Online (Sandbox Code Playgroud)
我做的另一件事是寻找 BootstrapperPackage 并从那里删除旧版本的 .Net Framework,但如果您的项目使用依赖于旧版本 .Net 的库,我认为这不是一个好主意。我不确定这也是导致问题的原因。