在当前的personal project中,我有一个Core项目,一个DependencyResolution项目和一个UI项目(WPF应用程序)。在UI项目中,我尝试调用DependencyRegistrar
和MainWindow.xaml.cs
中DependencyResolution中的App.xaml.cs
类。引用DependencyResolution项目的UI项目似乎存在问题,因为始终会发生此编译器错误:
The type or namespace name 'DependencyResolution' does not exist in the namespace
'DMTools.InitiativeTracker' (are you missing an assembly reference?)
D:\Dev\InitiativeTracker\src\UI\App.xaml.cs 2 33 UI
using System.Windows;
using DMTools.InitiativeTracker.DependencyResolution;
namespace DMTools.InitiativeTracker.UI
{
public partial class App : Application
{ }
}
using DMTools.InitiativeTracker.Core
),一切都可以编译。此外,我可以在DependencyRegistrar
项目(另一个类库)中引用IntegrationTests
,并且可以编译。最佳答案
提格伦的评论弄清楚了这个谜。在UI项目中,我将Target framework
从“.NET Framework 4客户端配置文件”更改为“.NET Framework 4”,并且一切正常。
我唯一想到的是为什么这是DependencyResolution而不是Core的问题,因为前者引用了第三方实用程序(即Ninject),而后者与Client Profile有关,但是我只是在这里猜测。
关于c# - VS2010 C#WPF应用程序: New WPF Project Cannot Call Static Class Method from Another Project,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6807022/
相关文章:
compiler-errors - 用于MPLAB的示例USB项目上的编译错误
visual-studio-2010 - 为Android编译C++项目时权限被拒绝
iphone - 调试版本工作,发布版本失败-llvm-gcc-4.2失败,退出代码为1
visual-studio-code - 如何更改 VS Code 设置以使用 JetBrains
apache-flex - 将 Flex 从 3.2 升级到 4.5 - 错误和警告
compilation - 在 CentOS 6.0 上编译单声道时 undefined refer