diff --git a/src/AspNetCoreShiftLeft.Web/AspNetCoreShiftLeft.Web.csproj b/src/AspNetCoreShiftLeft.Web/AspNetCoreShiftLeft.Web.csproj index 8eacdc1..790efa8 100644 --- a/src/AspNetCoreShiftLeft.Web/AspNetCoreShiftLeft.Web.csproj +++ b/src/AspNetCoreShiftLeft.Web/AspNetCoreShiftLeft.Web.csproj @@ -1,11 +1,23 @@ - + netcoreapp3.0 - + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + diff --git a/src/AspNetCoreShiftLeft.Web/Pages/Shared/_Layout.cshtml b/src/AspNetCoreShiftLeft.Web/Pages/Shared/_Layout.cshtml index b39c56c..3d9ab4c 100644 --- a/src/AspNetCoreShiftLeft.Web/Pages/Shared/_Layout.cshtml +++ b/src/AspNetCoreShiftLeft.Web/Pages/Shared/_Layout.cshtml @@ -1,4 +1,5 @@ - +@inject Microsoft.ApplicationInsights.AspNetCore.JavaScriptSnippet JavaScriptSnippet + @@ -6,6 +7,7 @@ @ViewData["Title"] - AspNetCoreShiftLeft.Web + @Html.Raw(JavaScriptSnippet.FullScript)
diff --git a/src/AspNetCoreShiftLeft.Web/Startup.cs b/src/AspNetCoreShiftLeft.Web/Startup.cs index 6527397..e8f30e1 100644 --- a/src/AspNetCoreShiftLeft.Web/Startup.cs +++ b/src/AspNetCoreShiftLeft.Web/Startup.cs @@ -1,10 +1,6 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; +using Microsoft.ApplicationInsights.AspNetCore.Extensions; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.HttpsPolicy; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; @@ -23,6 +19,7 @@ public Startup(IConfiguration configuration) // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { + services.AddApplicationInsightsTelemetry(Configuration); services.AddRazorPages(); } @@ -53,4 +50,4 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env) }); } } -} +} \ No newline at end of file diff --git a/src/AspNetCoreShiftLeft.Web/appsettings.json b/src/AspNetCoreShiftLeft.Web/appsettings.json index d9d9a9b..dbce3d5 100644 --- a/src/AspNetCoreShiftLeft.Web/appsettings.json +++ b/src/AspNetCoreShiftLeft.Web/appsettings.json @@ -1,4 +1,7 @@ { + "ApplicationInsights": { + "InstrumentationKey": "" + }, "Logging": { "LogLevel": { "Default": "Information", diff --git a/test/AspNetCoreShiftLeft.Web.Tests/AspNetCoreShiftLeft.Web.Tests.csproj b/test/AspNetCoreShiftLeft.Web.Tests/AspNetCoreShiftLeft.Web.Tests.csproj index f7ee2f3..4f150a2 100644 --- a/test/AspNetCoreShiftLeft.Web.Tests/AspNetCoreShiftLeft.Web.Tests.csproj +++ b/test/AspNetCoreShiftLeft.Web.Tests/AspNetCoreShiftLeft.Web.Tests.csproj @@ -7,10 +7,13 @@ - - - - + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/test/AspNetCoreShiftLeft.Web.Tests/UnitTest1.cs b/test/AspNetCoreShiftLeft.Web.Tests/UnitTest1.cs deleted file mode 100644 index b593f11..0000000 --- a/test/AspNetCoreShiftLeft.Web.Tests/UnitTest1.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace AspNetCoreShiftLeft.Web.Tests -{ - [TestClass] - public class UnitTest1 - { - [TestMethod] - public void TestMethod1() - { - } - } -}