File tree Expand file tree Collapse file tree 4 files changed +32
-3
lines changed
AbpCompanyName.AbpProjectName.Application
AbpCompanyName.AbpProjectName.Web.Mvc
wwwroot/lib/signalr-client Expand file tree Collapse file tree 4 files changed +32
-3
lines changed Original file line number Diff line number Diff line change 1111 <GenerateAssemblyProductAttribute >false</GenerateAssemblyProductAttribute >
1212 <RootNamespace >AbpCompanyName.AbpProjectName</RootNamespace >
1313 </PropertyGroup >
14+
15+ <PropertyGroup Condition =" '$(TargetFramework)' == 'net461' " >
16+ <DefineConstants >FEATURE_SIGNALR</DefineConstants >
17+ </PropertyGroup >
18+
19+ <PropertyGroup Condition =" '$(TargetFramework)' == 'netcoreapp2.0' " >
20+ <DefineConstants >FEATURE_SIGNALR;FEATURE_SIGNALR_ASPNETCORE</DefineConstants >
21+ </PropertyGroup >
1422
1523 <ItemGroup >
1624 <ProjectReference Include =" ..\AbpCompanyName.AbpProjectName.Core\AbpCompanyName.AbpProjectName.Core.csproj" />
Original file line number Diff line number Diff line change @@ -10,6 +10,18 @@ public static bool IsAvailable
1010 return true ;
1111#else
1212 return false ;
13+ #endif
14+ }
15+ }
16+
17+ public static bool IsAspNetCore
18+ {
19+ get
20+ {
21+ #if FEATURE_SIGNALR_ASPNETCORE
22+ return true ;
23+ #else
24+ return false ;
1325#endif
1426 }
1527 }
Original file line number Diff line number Diff line change 173173 <script src =" ~/js/main.js" asp-append-version =" true" ></script >
174174 <script src =" ~/view-resources/Views/Shared/_Layout.js" asp-append-version =" true" ></script >
175175
176- @if (SignalRFeature .IsAvailable )
176+ @if (SignalRFeature .IsAvailable && ! SignalRFeature . IsAspNetCore )
177177 {
178178 <script src =" ~/lib/signalr/jquery.signalR.js" asp-append-version =" true" ></script >
179179 }
195195 @if (SignalRFeature .IsAvailable )
196196 {
197197 <!-- SignalR scripts -->
198- <script src =" ~/signalr/hubs" ></script >
199- <script src =" ~/lib/abp-web-resources/Abp/Framework/scripts/libs/abp.signalr.js" type =" text/javascript" ></script >
198+ if (SignalRFeature .IsAspNetCore )
199+ {
200+ < script src = " ~/lib/signalr-client/signalr-client.min.js" asp - append - version = " true" >< / script >
201+ < script src = " ~/lib/abp-web-resources/Abp/Framework/scripts/libs/abp.signalr-client.js" asp - append - version = " true" >< / script >
202+ }
203+ else
204+ {
205+ <script src =" ~/signalr/hubs" ></script >
206+ <script src =" ~/lib/abp-web-resources/Abp/Framework/scripts/libs/abp.signalr.js" type =" text/javascript" ></script >
207+ }
200208 }
201209
202210 @WebResourceManager.RenderScripts() ;
You can’t perform that action at this time.
0 commit comments