Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/unit-testing/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net 停止EPiServer尝试向我的虚拟目录提供请求_Asp.net_Iis 7_Episerver - Fatal编程技术网

Asp.net 停止EPiServer尝试向我的虚拟目录提供请求

Asp.net 停止EPiServer尝试向我的虚拟目录提供请求,asp.net,iis-7,episerver,Asp.net,Iis 7,Episerver,我们有一个内置于EPiServer的网站,正在www.mysite.com上运行 现在我们已经构建了一个小型的.NET微站点,它不是我们希望作为IIS虚拟目录www.mysite.com/microsite运行的EPiServer项目的一部分 目前,我们看到微站点上的所有资产都返回了404,因此www.mysite.com/microsite/assets/js/myjs.js或www.mysite.com/microsite/assets/img/myimg.jpg 微站点的主页已提供服务,但

我们有一个内置于EPiServer的网站,正在www.mysite.com上运行

现在我们已经构建了一个小型的.NET微站点,它不是我们希望作为IIS虚拟目录www.mysite.com/microsite运行的EPiServer项目的一部分

目前,我们看到微站点上的所有资产都返回了404,因此www.mysite.com/microsite/assets/js/myjs.js或www.mysite.com/microsite/assets/img/myimg.jpg


微站点的主页已提供服务,但缺少资源。是否有办法配置主EPiServer项目以忽略对我的微站点文件夹结构的所有请求。

经过一段时间的斗争,我们现在有了一个可重复的解决方案

在父应用程序(EPiServer解决方案)中,我们需要在web.config中添加以下location元素

  <location path="MY-IIS-APPLICATION-NAME">
    <system.webServer>
      <handlers>
        <clear />
        <add name="wildcard" path="*" verb="*" type="System.Web.StaticFileHandler" />
      </handlers>
    </system.webServer>
  </location>

然后,在相同的web.config中,我们用这个元素将
部分包装起来

最后,我们需要修改IIS应用程序中的web.config,以卸载EPiServer处理程序和库

因此,在
部分中,我们添加了这些元素

<httpModules>
  <clear />
</httpModules>

<httpHandlers>
  <clear />
</httpHandlers>

然后在
中进行这些更改/删除

<handlers>
  <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
</handlers>
<modules>
  <remove name="InitializationModule" />
  <remove name="FirstBeginRequestModule" />
  <remove name="Initializer" />
  <remove name="WorkflowRuntime" />
  <remove name="UrlRewriteModule" />
  <remove name="ShellRoutingModule" />
  <remove name="ContainerDisposal" />
  <remove name="PropertyInjection" />
  <remove name="AttributedInjection" />
</modules>


很有可能这不是解决方案,但在过去几天中,我们已将其推广到6个不同的项目中,每次都达到了预期效果

MVC,我相信我们已经解决了这个问题,我将在下面回答,如果你发现了,请添加答案。