在我的应用程序中,我使用了 .net 4.0、iis 7.0 和 Castle Windsor 旧版本。现在我将这个应用程序移动到新机器上,只需将 iis 7.0 更改为 7.5。
但是当我在新服务器上部署应用程序时,它无法正常工作,它给出了应用程序错误。
错误详情。
Error Message :The type name Platform.Data.VisualDao, Platform.Data could not be located
Stack Trace : at Castle.Windsor.Installer.DefaultComponentInstaller.ObtainType(String typeName)
at Castle.Windsor.Installer.DefaultComponentInstaller.SetUpComponents(IConfiguration[] configurations, IWindsorContainer container)
at Castle.Windsor.Installer.DefaultComponentInstaller.SetUp(IWindsorContainer container, IConfigurationStore store)
at Castle.Windsor.WindsorContainer.RunInstaller()
at Castle.Windsor.WindsorContainer..ctor(IConfigurationInterpreter interpreter)
at Platform.Data.DaoFactory..cctor() in D:\DaoFactory.cs:line 21
Base Exception : System.Configuration.ConfigurationErrorsException: The type name Platform.Data.VisualDao, Platform.Data could not be located
at Castle.Windsor.Installer.DefaultComponentInstaller.ObtainType(String typeName)
at Castle.Windsor.Installer.DefaultComponentInstaller.SetUpComponents(IConfiguration[] configurations, IWindsorContainer container)
at Castle.Windsor.Installer.DefaultComponentInstaller.SetUp(IWindsorContainer container, IConfigurationStore store)
at Castle.Windsor.WindsorContainer.RunInstaller()
at Castle.Windsor.WindsorContainer..ctor(IConfigurationInterpreter interpreter)
at Platform.Data.DaoFactory..cctor() in D:DaoFactory.cs:line 21
代码:
internal class DaoFactory : IDaoFactory
{
static ILog _logger = LogManager.GetLogger("DaoFActory");
private readonly static Dictionary<Type, object> _daoRegistry;
static DaoFactory()
{
_logger.Debug("Starting cctor");
// TODO Implement this Dynamically
string daoConfigFile = ConfigurationManager.AppSettings["daoComponents"];
_logger.Debug("Path"+daoConfigFile);
_logger.Debug("Initilizing container");
IWindsorContainer container = new WindsorContainer(new XmlInterpreter(daoConfigFile));
_logger.Debug("Initilized....Creating reg");
_daoRegistry = new Dictionary<Type, object>();
_daoRegistry[typeof(IPMUserDao)] = container.Resolve("pmUserDao");
_daoRegistry[typeof(IPMRoleDao)] = container.Resolve("pmRoleDao");
}
}
初始化容器时出现异常:
IWindsorContainer 容器 = 新 WindsorContainer(new XmlInterpreter(daoConfigFile));
daoConfigfile 是我从中获取 Platform.data 的 xml 文件的路径
platform.data 在 bin 文件夹中可用。
请帮我解决这个问题......