我正在尝试跟随入门OpenRasta应用程序。 https://github.com/openrasta/openrasta-stable/wiki/Building-Your-First-OpenRasta-Website
我在Windows 7 64位下使用.Net4,我的目标是IIS 7.5。我已将Active Configuration设置为Debug,将我的Platform设置为Any CPU。我使用的OpenRasta版本是2.0.3。
以下是我得到的错误:“无法加载文件或程序集'OpenRasta.Hosting.AspNet'或其依赖项之一。系统无法找到指定的文件。”
我怀疑它与为.net35而不是4编译的OpenRasta有关? 我已经尝试了许多不同的方法来解决这个问题,但我仍然陷入困境。
我更改了应用程序池设置以设置启用32位Applications = true,这是我正在使用的web.config:
<?xml version="1.0"?>
<configuration>
<system.diagnostics>
<switches>
<add name="ShowErrors" value="4"/>
</switches>
<!-- log to debug output -->
<sources>
<source name="OpenRasta" switchValue="All">
<listeners>
<add name="TextWriterListener" type="System.Diagnostics.TextWriterTraceListener" initializeData="Logs\OpenRasta.txt"/>
</listeners>
</source>
</sources>
</system.diagnostics>
<system.web>
<compilation debug="true" targetFramework="4.0">
</compilation>
<authentication mode="None"/>
<!-- required for WebForms views -->
<pages pageParserFilterType="OpenRasta.Codecs.WebForms.OpenRastaPageParserFilter, OpenRasta.Codecs.WebForms, Version=2.0.1.0, Culture=neutral" controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID">
<namespaces>
<add namespace="OpenRasta.Web"/>
<add namespace="OpenRasta.Web.Markup"/>
<add namespace="OpenRasta.Codecs.WebForms"/>
<add namespace="OpenRasta"/>
<add namespace="System.Collections.Generic"/>
</namespaces>
</pages>
<!-- hook into OpenRasta -->
<httpHandlers>
<add verb="*" path="*.rastahook" type="OpenRasta.Hosting.AspNet.OpenRastaHandler, OpenRasta.Hosting.AspNet, Version=2.0.1.0, Culture=neutral"/>
</httpHandlers>
<httpModules>
<add name="RastaModule" type="OpenRasta.Hosting.AspNet.OpenRastaModule, OpenRasta.Hosting.AspNet, Version=2.0.1.0, Culture=neutral"/>
</httpModules>
</system.web>
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" compilerOptions="/warnaserror-">
<providerOption name="CompilerVersion" value="v4.0"/>
<providerOption name="WarnAsError" value="false"/>
</compiler>
</compilers>
</system.codedom>
<!-- iis7 config -->
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<!-- hook into OpenRasta -->
<modules>
<add name="OpenRastaModule" type="OpenRasta.Hosting.AspNet.OpenRastaModule, OpenRasta.Hosting.AspNet"/>
</modules>
<handlers>
<add name="OpenRastaHandler" verb="*" path="*.rastahook" type="OpenRasta.Hosting.AspNet.OpenRastaHandler, OpenRasta.Hosting.AspNet, Version=2.0.1.0, Culture=neutral"/>
</handlers>
</system.webServer>
</configuration>
任何帮助将不胜感激!也许在那里有一个我无法找到的.net 4版本的openrasta?
答案 0 :(得分:1)
32或64位对此没有影响。您是否已向相关程序集添加项目引用?
答案 1 :(得分:1)
好的,我修好了这个。我按照输出上的调试建议并设置我的注册表来显示程序集绑定失败。 [HKLM \ Software \ Microsoft \ Fusion!EnableLog](DWORD)为1。
这让我可以看到它在哪里寻找装配。原来项目的输出文件夹被设置为一些奇怪的路径而不是bin /一旦我将它设置为bin /我能够通过这个错误。感谢大家花时间阅读本文