【发布时间】:2010-08-26 21:27:16
【问题描述】:
当我的 C# 类库中有以下代码时,它完全破坏了库中的所有其他内容。
namespace DesktopOCA.Infastructure
{
public class NHibernateHelper
{
private static ISessionFactory _sessionFactory;
}
}
例如,这也在那个项目中:
namespace DesktopOCA.Infastructure
{
public static class RegionNames
{
public const string MainRegion = "MainRegion";
}
}
当我不包含时
private static ISessionFactory _sessionFactory;
我的解决方案中的其他所有内容都可以看到 RegionNames.MainRegion。但是,只要我对 ISessionFactory 进行任何引用,它就会中断。那个特定的类库仍然可以正常编译。我可以将它作为参考添加到项目的其他部分,但它就像那里什么都没有。
我得到了错误
Error 40 The name 'RegionNames' does not exist in the current context
任何帮助都会非常感激,这对我来说真的很奇怪。
【问题讨论】:
-
这听起来像是一种奇怪的“清理和重建”类型的情况。您是否尝试过使用 Reflector 查看类库 DLL?
标签: c# nhibernate