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 11
11
<GenerateAssemblyProductAttribute >false</GenerateAssemblyProductAttribute >
12
12
<RootNamespace >AbpCompanyName.AbpProjectName</RootNamespace >
13
13
</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 >
14
22
15
23
<ItemGroup >
16
24
<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
10
10
return true ;
11
11
#else
12
12
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 ;
13
25
#endif
14
26
}
15
27
}
Original file line number Diff line number Diff line change 173
173
<script src =" ~/js/main.js" asp-append-version =" true" ></script >
174
174
<script src =" ~/view-resources/Views/Shared/_Layout.js" asp-append-version =" true" ></script >
175
175
176
- @if (SignalRFeature .IsAvailable )
176
+ @if (SignalRFeature .IsAvailable && ! SignalRFeature . IsAspNetCore )
177
177
{
178
178
<script src =" ~/lib/signalr/jquery.signalR.js" asp-append-version =" true" ></script >
179
179
}
195
195
@if (SignalRFeature .IsAvailable )
196
196
{
197
197
<!-- 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
+ }
200
208
}
201
209
202
210
@WebResourceManager.RenderScripts() ;
You can’t perform that action at this time.
0 commit comments