我以前曾单独使用过每种标题技术。将它们结合起来就成了问题。
Web App 在带有 IIS Express (Visual Studio 2019) 的开发机器上完美运行。
当我发布时,没有 SignalR。如果我尝试导航到 webaddress.com/signalr/hubs,我会收到 404 错误。
#1修复: <modules runAllManagedModulesForAllRequests="true">
- 这“修复”了信号器。但是页面上没有引导程序,并且在
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
没有 Default.aspx 的情况下修复 URL 也被破坏了。
所以我猜我必须使用一个“模块”来让 Signalr 再次工作,而“运行 allmanagedmodules”太通用了?
这是我的网络配置。有任何想法吗?
<configuration>
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="XXXXXXXXX.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
</configSections>
<connectionStrings>
<add name="XXXXXXXXXX" connectionString="Data Source=XXXXXXX\SQLEXPRESS;Initial Catalog=XXXXXXX;Integrated Security=false;user=XXXXXXX;password=XXXXXXX" />
</connectionStrings>
<system.web>
<customErrors mode="Off" />
<compilation targetFramework="4.6" debug="true" />
<httpRuntime targetFramework="4.6" />
<authentication mode="Forms">
<forms loginUrl="login.aspx" name=".ASPNETAUTH" protection="None" path="/" defaultUrl="default.aspx" timeout="30" />
</authentication>
<authorization>
<deny users="?" />
<allow users="*" />
</authorization>
</system.web>
<location path="Default.aspx">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
<location path="signalr">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
<location path="Patient.aspx">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
<location path="aboutus.aspx">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
<location path="contact.aspx">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
<location path="iforgot.aspx">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
<location path="test.aspx">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
<location path="api/XXXX">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:default /nowarn:1659;1699;1701" />
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:default /nowarn:41008 /define:_MYTYPE=\"Web\" /optionInfer+" />
</compilers>
</system.codedom>
<applicationSettings>
<XXXXXXX.Properties.Settings>
<setting name="UserID" serializeAs="String">
<value>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</value>
</setting>
<setting name="FromEmail" serializeAs="String">
<value>XXXXXXX@xxxxxxxxxxxxxxxxxxxxxxx.com</value>
</setting>
<setting name="EmailUsername" serializeAs="String">
<value>xxxxxxxxxxxxxxxxxx\xxxxxxxxxxxxxxxx</value>
</setting>
<setting name="EmailPassword" serializeAs="String">
<value>XXXXXXXXXX</value>
</setting>
<setting name="EmailServer" serializeAs="String">
<value>mail.XXXXXXXXXXXXXXXXXXX.com</value>
</setting>
<setting name="Token" serializeAs="String">
<value>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</value>
</setting>
</XXXXXXX.Properties.Settings>
</applicationSettings>
<system.webServer>
<modules >
<remove name="UrlRoutingModule-4.0" />
<add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" preCondition="" />
<!-- any other modules you want to run in MVC e.g. FormsAuthentication, Roles etc. -->
</modules>
<handlers>
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
</handlers>
<rewrite>
<rules>
<rule name="HTTPS force" enabled="true" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="^OFF$" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Permanent" />
</rule>
</rules>
</rewrite>
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>