使用 Sitecore 6.4.1 运行 Asp.net 应用程序错误

发布于 2024-12-03 10:13:08 字数 898 浏览 1 评论 0原文

我将 Sitecore 作为站点根目录(运行正常),在它下面我需要运行一堆 asp.net 应用程序。

到目前为止,为子应用程序创建了一个虚拟目录,将其变成了一个应用程序。但是当我浏览子应用程序时,它就会出现此错误消息。

Compilation Error 
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. 

Compiler Error Message: CS0246: The type or namespace name 'Sitecore' could not be found (are you missing a using directive or an assembly reference?)

Source Error:



Line 3264:          </providers>
Line 3265:      </roleManager>
Line 3266:      <profile defaultProvider="sql" enabled="true" inherits="Sitecore.Security.UserProfile, Sitecore.Kernel">
Line 3267:          <providers>
Line 3268:              <clear/>

子 asp.net 应用程序似乎继承了来自 Sitecore web.config 的 Sitecore 设置。

有什么想法吗?

I have Sitecore as site root (which is running ok) and under it I need to have a bunch of asp.net applications running.

So far, created a virtual directory for the child application, turned it into an app. But as soon as I browse the child app it comes with this error message.

Compilation Error 
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. 

Compiler Error Message: CS0246: The type or namespace name 'Sitecore' could not be found (are you missing a using directive or an assembly reference?)

Source Error:



Line 3264:          </providers>
Line 3265:      </roleManager>
Line 3266:      <profile defaultProvider="sql" enabled="true" inherits="Sitecore.Security.UserProfile, Sitecore.Kernel">
Line 3267:          <providers>
Line 3268:              <clear/>

It seems that the child asp.net app is inheriting Sitecore settings which are coming from Sitecore web.config.

Any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

情栀口红 2024-12-10 10:13:08

这应该是可能的。您必须在虚拟目录中为该非 Sitecore 应用程序编写 web.config,并覆盖 引用 Sitecore 类。这包括:

  • httpModules / httpHandlers(对于这些,您应该“删除所有”并添加该 Web 应用程序的安全部分)
  • 安全部分(放回默认的 ASP.NET 提供程序类)
  • 在 Sitecore 主 web.config 添加此 Web 应用程序到 IgnoreUrlPrefixes 设置的路径,让 Sitecore 知道它不应处理对这些请求的请求。

它可能是其他内容,但您应该了解总体思路。

This should be possible. You'll have to author a web.config for that non-Sitecore application in virtual directory, and overwrite the sections under <system.web> and <system.webserver> which reference Sitecore classes. This includes:

  • httpModules / httpHandlers (for these you should "remove all" and add those of that web app)
  • security section (put the default ASP.NET provider classes back)
  • in Sitecore main web.config add the path of this web app to IgnoreUrlPrefixes setting to let Sitecore know it should not handle requests to those

It might be something else, but you should get the general idea.

戏剧牡丹亭 2024-12-10 10:13:08

这个答案与 Yan 类似,但足够不同,可以作为单独的答案。希望它有帮助。

进入 IIS 并选择子应用程序。选择模块。删除所有存在的 Sitecore 相关模块。不用担心,父 Sitecore 应用程序仍将保留这些模块。 IIS 中的 Sitecore 模块

当您执行此操作时,您实际上正在更改子应用程序 web.config,因此您将看到这些元素像这样在 web.config 文件中删除。

<remove name="SitecoreConfigWatcher" />
<remove name="SitecoreHttpModule" />

您可能还必须清除一些其他继承的设置。

<profile enabled="false"><providers><clear/></providers></profile>
<roleManager enabled="false"><providers><clear /></providers></roleManager>

This answer is similar to Yan, but is different enough for a separate answer. Hope it helps.

Go into IIS and select the Child Application. Select Modules. Remove all the Sitecore related modules that are present. Don't worry, the parent Sitecore app will still retain these modules. Sitecore modules in IIS

When you do this, you are actually changing the child app web.config, so you will see the elements removed in the web.config file like so.

<remove name="SitecoreConfigWatcher" />
<remove name="SitecoreHttpModule" />

You also may have to clear out some other inherited settings.

<profile enabled="false"><providers><clear/></providers></profile>
<roleManager enabled="false"><providers><clear /></providers></roleManager>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文