Template 10 error during installation Insight application does not exist in namespace

I followed the instructions to start and run Template 10, but I am launching a single build error CS0234

Error CS0234 The type or namespace name "ApplicationInsights" does not exist in the namespace "Microsoft" (do you miss the assembly reference?) WindowsApp1 C: \ Users \ Keshi \ AppData \ Local \ Temporary Projects \ WindowsApp1 \ App. xaml.cs

Any idea why this assembly is missing. I installed the entire VS package. Why is this assembly missing.

Microsoft.ApplicationInsights.WindowsAppInitializer.InitializeAsync( Microsoft.ApplicationInsights.WindowsCollectors.Metadata | Microsoft.ApplicationInsights.WindowsCollectors.Session); 

thanks

+5
source share
2 answers

I had to add a few lines to the project.json file to solve this problem. I believe that the lines I added were (in the dependencies):

 "Microsoft.ApplicationInsights": "1.0.0", "Microsoft.ApplicationInsights.PersistenceChannel": "1.0.0", "Microsoft.ApplicationInsights.WindowsApps": "1.0.0", 

My full project.json file looks like this:

 { "dependencies": { "Microsoft.ApplicationInsights": "1.0.0", "Microsoft.ApplicationInsights.PersistenceChannel": "1.0.0", "Microsoft.ApplicationInsights.WindowsApps": "1.0.0", "Microsoft.NETCore.UniversalWindowsPlatform": "5.0.0", "Microsoft.NETCore.UniversalWindowsPlatform": "5.0.0", "Microsoft.Xaml.Behaviors.Uwp.Managed": "1.0.3", "Newtonsoft.Json": "8.0.2", "Template10": "1.1.*" }, "frameworks": { "uap10.0": {} }, "runtimes": { "win10-arm": {}, "win10-arm-aot": {}, "win10-x86": {}, "win10-x86-aot": {}, "win10-x64": {}, "win10-x64-aot": {} } } 

And I can create and run a hamburger menu project (this is just an empty template, as I am just starting).

+5
source

Yes, from 5/18/2016 Template10 cannot collect all its project types from the box (Blank, Hamburger, Minimal) for all combinations of UW target / min versions due to the lack of a link to application knowledge.

Direct change to project.json works fine, as @CodingGorilla suggested.

Alternatively, in VS.Net, you can add the ApplicationInsights link to the Template10 project using the NuGet console or in the project dropdown menu> Manage NuGet Packages... in the solution explorer.

In the NuGet console:

 Install-Package Microsoft.ApplicationInsights.WindowsApps 

or

  • Open NuGet Manager Project
  • Go to the Overview tab
  • Search Microsoft.ApplicationInsights.WindowsApps
  • Install package

NuGet will notify you that it installs the target and related packages, for example:

  Microsoft.ApplicationInsights.1.2.3 Microsoft.ApplicationInsights.PersistenceChannel.1.2.3 Microsoft.ApplicationInsights.WindowsApps.1.1.1 

The dependencies section in project.json will be modified accordingly:

  "dependencies": { "Microsoft.ApplicationInsights.WindowsApps": "1.1.1", "Microsoft.NETCore.UniversalWindowsPlatform": "5.1.0", "Microsoft.Xaml.Behaviors.Uwp.Managed": "1.1.0", "Newtonsoft.Json": "8.0.3", "Template10": "1.1.*" }, ... 
+1
source

Source: https://habr.com/ru/post/1244540/


All Articles