Skip to content

Commit ad30cbb

Browse files
committed
updates to .NET 4.7.2 and SF 7.1
1 parent 7d00f95 commit ad30cbb

File tree

9 files changed

+52
-40
lines changed

9 files changed

+52
-40
lines changed

Voting/Voting.sfproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" InitialTargets=";ValidateMSBuildFiles">
3-
<Import Project="..\packages\Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.6.7\build\Microsoft.VisualStudio.Azure.Fabric.Application.props" Condition="Exists('..\packages\Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.6.7\build\Microsoft.VisualStudio.Azure.Fabric.Application.props')" />
3+
<Import Project="..\packages\Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.7.1\build\Microsoft.VisualStudio.Azure.Fabric.Application.props" Condition="Exists('..\packages\Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.7.1\build\Microsoft.VisualStudio.Azure.Fabric.Application.props')" />
44
<PropertyGroup Label="Globals">
55
<ProjectGuid>af958126-cb44-487a-8292-2d27594966de</ProjectGuid>
66
<ProjectVersion>2.0</ProjectVersion>
@@ -39,9 +39,9 @@
3939
<ApplicationProjectTargetsPath>$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Service Fabric Tools\Microsoft.VisualStudio.Azure.Fabric.ApplicationProject.targets</ApplicationProjectTargetsPath>
4040
</PropertyGroup>
4141
<Import Project="$(ApplicationProjectTargetsPath)" Condition="Exists('$(ApplicationProjectTargetsPath)')" />
42-
<Import Project="..\packages\Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.6.7\build\Microsoft.VisualStudio.Azure.Fabric.Application.targets" Condition="Exists('..\packages\Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.6.7\build\Microsoft.VisualStudio.Azure.Fabric.Application.targets')" />
43-
<Target Name="ValidateMSBuildFiles">
44-
<Error Condition="!Exists('..\packages\Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.6.7\build\Microsoft.VisualStudio.Azure.Fabric.Application.props')" Text="Unable to find the '..\packages\Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.6.7\build\Microsoft.VisualStudio.Azure.Fabric.Application.props' file. Please restore the 'Microsoft.VisualStudio.Azure.Fabric.MSBuild' Nuget package." />
45-
<Error Condition="!Exists('..\packages\Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.6.7\build\Microsoft.VisualStudio.Azure.Fabric.Application.targets')" Text="Unable to find the '..\packages\Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.6.7\build\Microsoft.VisualStudio.Azure.Fabric.Application.targets' file. Please restore the 'Microsoft.VisualStudio.Azure.Fabric.MSBuild' Nuget package." />
42+
<Import Project="..\packages\Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.7.1\build\Microsoft.VisualStudio.Azure.Fabric.Application.targets" Condition="Exists('..\packages\Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.7.1\build\Microsoft.VisualStudio.Azure.Fabric.Application.targets')" />
43+
<Target Name="ValidateMSBuildFiles" BeforeTargets="PrepareForBuild">
44+
<Error Condition="!Exists('..\packages\Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.7.1\build\Microsoft.VisualStudio.Azure.Fabric.Application.props')" Text="Unable to find the '..\packages\Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.7.1\build\Microsoft.VisualStudio.Azure.Fabric.Application.props' file. Please restore the 'Microsoft.VisualStudio.Azure.Fabric.MSBuild' Nuget package." />
45+
<Error Condition="!Exists('..\packages\Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.7.1\build\Microsoft.VisualStudio.Azure.Fabric.Application.targets')" Text="Unable to find the '..\packages\Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.7.1\build\Microsoft.VisualStudio.Azure.Fabric.Application.targets' file. Please restore the 'Microsoft.VisualStudio.Azure.Fabric.MSBuild' Nuget package." />
4646
</Target>
4747
</Project>

Voting/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="Microsoft.VisualStudio.Azure.Fabric.MSBuild" version="1.6.7" targetFramework="net40" />
3+
<package id="Microsoft.VisualStudio.Azure.Fabric.MSBuild" version="1.7.1" targetFramework="net40" />
44
</packages>

VotingData/Controllers/VoteDataController.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ public async Task<IActionResult> Get()
3232

3333
using (ITransaction tx = this.stateManager.CreateTransaction())
3434
{
35-
IAsyncEnumerable<KeyValuePair<string, int>> list = await votesDictionary.CreateEnumerableAsync(tx);
35+
var list = await votesDictionary.CreateEnumerableAsync(tx);
3636

37-
IAsyncEnumerator<KeyValuePair<string, int>> enumerator = list.GetAsyncEnumerator();
37+
var enumerator = list.GetAsyncEnumerator();
3838

3939
List<KeyValuePair<string, int>> result = new List<KeyValuePair<string, int>>();
4040

VotingData/Startup.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,16 @@ public void ConfigureServices(IServiceCollection services)
3333
}
3434

3535
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
36-
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
36+
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
3737
{
38-
loggerFactory.AddConsole(this.Configuration.GetSection("Logging"));
39-
loggerFactory.AddDebug();
38+
if (env.IsDevelopment())
39+
{
40+
app.UseDeveloperExceptionPage();
41+
}
42+
else
43+
{
44+
app.UseExceptionHandler("/Home/Error");
45+
}
4046

4147
app.UseMvc();
4248
}

VotingData/VotingData.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ namespace VotingData
99
using System.Fabric;
1010
using System.IO;
1111
using Microsoft.AspNetCore.Hosting;
12+
using Microsoft.Extensions.Logging;
1213
using Microsoft.Extensions.DependencyInjection;
1314
using Microsoft.ServiceFabric.Data;
1415
using Microsoft.ServiceFabric.Services.Communication.AspNetCore;
@@ -43,13 +44,17 @@ protected override IEnumerable<ServiceReplicaListener> CreateServiceReplicaListe
4344

4445
return new WebHostBuilder()
4546
.UseKestrel()
47+
.ConfigureLogging(logging =>
48+
{
49+
logging.ClearProviders();
50+
logging.AddApplicationInsights();
51+
})
4652
.ConfigureServices(
4753
services => services
4854
.AddSingleton<StatefulServiceContext>(serviceContext)
4955
.AddSingleton<IReliableStateManager>(this.StateManager))
5056
.UseContentRoot(Directory.GetCurrentDirectory())
5157
.UseStartup<Startup>()
52-
.UseApplicationInsights()
5358
.UseServiceFabricIntegration(listener, ServiceFabricIntegrationOptions.UseUniqueServiceUrl)
5459
.UseUrls(url)
5560
.Build();

VotingData/VotingData.csproj

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net461</TargetFramework>
4+
<TargetFramework>net472</TargetFramework>
55
<RuntimeIdentifier>win7-x64</RuntimeIdentifier>
66
<IsServiceFabricServiceProject>True</IsServiceFabricServiceProject>
77
</PropertyGroup>
@@ -10,14 +10,14 @@
1010
<Folder Include="wwwroot\" />
1111
</ItemGroup>
1212
<ItemGroup>
13-
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.2.1" />
14-
<PackageReference Include="Microsoft.AspNetCore" Version="2.0.3" />
15-
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.0.4" />
16-
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="2.0.2" />
17-
<PackageReference Include="Microsoft.ServiceFabric" Version="6.4.617" />
18-
<PackageReference Include="Microsoft.ServiceFabric.AspNetCore.Kestrel" Version="3.3.617" />
19-
<PackageReference Include="Microsoft.ServiceFabric.Data" Version="3.3.617" />
20-
<PackageReference Include="Microsoft.ServiceFabric.Services" Version="3.3.617" />
13+
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.15.0" />
14+
<PackageReference Include="Microsoft.AspNetCore" Version="2.2.0" />
15+
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.2.0" />
16+
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="3.1.8" />
17+
<PackageReference Include="Microsoft.ServiceFabric" Version="7.1.458" />
18+
<PackageReference Include="Microsoft.ServiceFabric.AspNetCore.Kestrel" Version="4.1.458" />
19+
<PackageReference Include="Microsoft.ServiceFabric.Data" Version="4.1.458" />
20+
<PackageReference Include="Microsoft.ServiceFabric.Services" Version="4.1.458" />
2121
</ItemGroup>
2222
<ItemGroup>
2323
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="1.0.1" />

VotingWeb/Startup.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,11 @@ public void ConfigureServices(IServiceCollection services)
3333
}
3434

3535
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
36-
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
36+
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
3737
{
38-
loggerFactory.AddConsole(this.Configuration.GetSection("Logging"));
39-
loggerFactory.AddDebug();
40-
4138
if (env.IsDevelopment())
4239
{
4340
app.UseDeveloperExceptionPage();
44-
app.UseBrowserLink();
4541
}
4642
else
4743
{

VotingWeb/VotingWeb.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ namespace VotingWeb
1111
using System.IO;
1212
using System.Net.Http;
1313
using Microsoft.AspNetCore.Hosting;
14+
using Microsoft.Extensions.Logging;
1415
using Microsoft.Extensions.DependencyInjection;
1516
using Microsoft.ServiceFabric.Services.Communication.AspNetCore;
1617
using Microsoft.ServiceFabric.Services.Communication.Runtime;
@@ -45,14 +46,18 @@ protected override IEnumerable<ServiceInstanceListener> CreateServiceInstanceLis
4546

4647
return new WebHostBuilder()
4748
.UseKestrel()
49+
.ConfigureLogging(logging =>
50+
{
51+
logging.ClearProviders();
52+
logging.AddApplicationInsights();
53+
})
4854
.ConfigureServices(
4955
services => services
5056
.AddSingleton<HttpClient>(new HttpClient())
5157
.AddSingleton<FabricClient>(new FabricClient())
5258
.AddSingleton<StatelessServiceContext>(serviceContext))
5359
.UseContentRoot(Directory.GetCurrentDirectory())
5460
.UseStartup<Startup>()
55-
.UseApplicationInsights()
5661
.UseServiceFabricIntegration(listener, ServiceFabricIntegrationOptions.None)
5762
.UseUrls(url)
5863
.Build();

VotingWeb/VotingWeb.csproj

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net461</TargetFramework>
4+
<TargetFramework>net472</TargetFramework>
55
<RuntimeIdentifier>win7-x64</RuntimeIdentifier>
66
<IsServiceFabricServiceProject>True</IsServiceFabricServiceProject>
77
</PropertyGroup>
88
<ItemGroup>
9-
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.2.1" />
10-
<PackageReference Include="Microsoft.AspNetCore" Version="2.0.3" />
11-
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.0.4" />
12-
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.0.3" />
13-
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="2.0.2" />
14-
<PackageReference Include="Microsoft.ServiceFabric" Version="6.4.617" />
15-
<PackageReference Include="Microsoft.ServiceFabric.AspNetCore.Kestrel" Version="3.3.617" />
16-
<PackageReference Include="Microsoft.ServiceFabric.Data" Version="3.3.617" />
17-
<PackageReference Include="Microsoft.ServiceFabric.Services" Version="3.3.617" />
18-
<PackageReference Include="Microsoft.ServiceFabric.Services.Remoting" Version="3.3.617" />
19-
<PackageReference Include="Microsoft.VisualStudio.Web.BrowserLink" Version="2.0.3" />
20-
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.0.4" />
9+
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.15.0" />
10+
<PackageReference Include="Microsoft.AspNetCore" Version="2.2.0" />
11+
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.2.0" />
12+
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="2.2.0" />
13+
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.2.0" />
14+
<PackageReference Include="Microsoft.Extensions.Logging" Version="3.1.8" />
15+
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="3.1.8" />
16+
<PackageReference Include="Microsoft.ServiceFabric" Version="7.1.458" />
17+
<PackageReference Include="Microsoft.ServiceFabric.AspNetCore.Kestrel" Version="4.1.458" />
18+
<PackageReference Include="Microsoft.ServiceFabric.Data" Version="4.1.458" />
19+
<PackageReference Include="Microsoft.ServiceFabric.Services" Version="4.1.458" />
20+
<PackageReference Include="Microsoft.ServiceFabric.Services.Remoting" Version="4.1.458" />
2121
</ItemGroup>
2222
<ItemGroup>
2323
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="1.0.1" />

0 commit comments

Comments
 (0)