【问题标题】:Error "The type or namespace name 'ProfileCommon' could not be found"错误“找不到类型或命名空间名称‘ProfileCommon’”
【发布时间】:2010-09-18 21:56:05
【问题描述】:

我正在尝试设置 YAF 论坛 1.9.4,但配置中的配置文件部分有问题:

<profile enabled="true" defaultProvider="YafProfileProvider"
         inherits="YAF.Classes.Utils.YafUserProfile">
<providers>
<clear/>
<add connectionStringName="ConfettiSQL" name="YafProfileProvider" 
     type="YAF.Providers.Profile.YafProfileProvider"/>
</providers>
</profile>

当我在本地测试时,一切正常,但在我的网络服务器上,我收到以下错误:

The type or namespace name 'ProfileCommon' could not be found

我已经上传了所有文件,我可以在我的 bin 文件夹中看到一个名为“YAF.Providers.dll”的文件。

有人知道如何解决这个错误吗?

【问题讨论】:

标签: asp.net web-config


【解决方案1】:

您使用的是网站项目还是 Web 应用程序项目?如果您使用的是 ASP.NET 网站项目模板,那么您可以使用开箱即用的配置文件。如果您使用的是 ASP.NET Web 应用程序项目模板,则可以使用 Web Profile Builder 来设置配置文件:

http://weblogs.asp.net/joewrobel/archive/2008/02/03/web-profile-builder-for-web-application-projects.aspx

【讨论】:

  • 嗨,这是一个网站项目,这就是我不明白的地方。有没有办法注册dll?
  • 注册 DLL 不是问题。在 Web 应用项目中,没有 ProfileCommon 类;您需要生成强类型代理类来访问配置文件。如果您使用的是 VS2005,请使用第一个链接,否则请尝试第二个链接 :-)
  • 嗨,IrishCheiftain,这不是一个 Web 应用程序项目,而是一个网站项目? -感谢您的回复-融化
  • 你配置它在2.0下运行吗?
  • 嗨,在视图下 > 属性页 > 构建...我的目标框架设置为 3.5。我的虚拟主机也安装了 3.5。有趣的是,我的开发 PC 上的应用程序运行良好,只是无法在我的网络主机上运行。
猜你喜欢
  • 2012-06-19
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-07-14
  • 2019-09-14
  • 2013-10-23
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多