Я использовал каждую из названных технологий отдельно. Их объединение стало проблемой.
Веб-приложение отлично работает на компьютере разработчика с IIS Express (Visual Studio 2019).
Когда я публикую sh, SignalR отсутствует. если я пытаюсь перейти на webaddress.com/signalr/hubs, я получаю ошибку 404.
исправление # 1: <modules runAllManagedModulesForAllRequests="true">
- это "исправляет" Signalr. но тогда на страницах нет bootstrap и
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
, чтобы исправить URL без Default.aspx, также будет поврежден.
Итак, я предполагаю, что есть «модуль», который я должен использовать, чтобы заставить Signalr снова работать, а «запускать все управляемые модули» слишком универсален c?
Вот мой веб-конфиг. Есть идеи?
<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>