奇怪的网络服务错误
服务器无法处理请求。 --->尝试获取数据库类型实例时发生激活错误,键“” --->解析依赖项失败,类型 =“Microsoft.Practices.EnterpriseLibrary.Data.Database”,名称 =“(无)”。 while:解决时发生异常。
例外是: InvalidOperationException - 无法构造数据库类型。您必须配置容器以提供该值。
发生异常时,容器为:
Resolving Microsoft.Practices.EnterpriseLibrary.Data.Database,(无) --->无法构造数据库类型。您必须配置容器以提供该值。
调用函数获取存储过程的名称并在 SQL Server 2008 中运行它并将结果作为数据集返回,我应该考虑什么来解决这个问题?
Server was unable to process request. ---> Activation error occured while trying to get instance of type Database, key "" ---> Resolution of the dependency failed, type = "Microsoft.Practices.EnterpriseLibrary.Data.Database", name = "(none)".
Exception occurred while: while resolving.
Exception is: InvalidOperationException - The type Database cannot be constructed. You must configure the container to supply this value.
At the time of the exception, the container was:
Resolving Microsoft.Practices.EnterpriseLibrary.Data.Database,(none)
---> The type Database cannot be constructed. You must configure the container to supply this value.
The calling function gets a stored proc's name and runs it in SQL Server 2008 and returns the results as a dataset, any ideas what I should be looking at to fix this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
似乎依赖注入存在一些配置问题,并且它与 Web 服务本身无关。如果从其他应用程序(例如 Web 或桌面前端)成功调用相同的函数,您应该将 Web 服务 web.config 与其他应用程序 app.config 进行比较。
更多信息可能会有所帮助。就像 Web 服务的 web.config 和失败方法的实际代码一样。
Seems that there are some configuration problems with dependency injection and it is not related with web service as such. If same function is successfuly called from some other application (like web or desktop frontend), you should compare web services web.config with other applications app.config.
And more info could be beneficial. Like web.config for web service and actual code of failing method.