简体   繁体   English

Microsoft名称空间中不存在ApplicationInsight

[英]ApplicationInsight does not exist in the namespace Microsoft

I've been working my way through video training series on Microsoft's Virtual Academy. 我一直在研究Microsoft虚拟学院的视频培训系列。 The series I'm watching is titled "Windows 10 Development for Absolute Beginners" I'm at the penultimate video when I ran into a problem. 我正在观看的系列的标题为“绝对入门的Windows 10开发”。遇到问题时,我正在倒数第二次观看视频。 Bob Tabor put the following into the constructor of the App class (in App.xaml.cs): Bob Tabor将以下内容放入App类的构造函数中(在App.xaml.cs中):

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

However, this line doesn't work at all for me. 但是,这条线对我根本不起作用。 I'm getting red squiggly lines under Microsoft.ApplicationInsights. 我在Microsoft.ApplicationInsights下出现红色的波浪线。 And when I compile I get the following error message: 当我编译时,出现以下错误信息:

The type or namespace name 'ApplicationInsights' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) 类型或名称空间名称“ ApplicationInsights”在名称空间“ Microsoft”中不存在(您是否缺少程序集引用?)

I have tried to add a reference to that, but it didn't work. 我试图添加对此的引用,但是没有用。 In fact VS 2017 told me outright that it was impossible to add the reference I'd found. 实际上,VS 2017彻底告诉了我,无法添加我找到的参考。

I'm thinking that the problem is because I'm using VS 2017, whereas when Bob Tabor did the videos he was using VS 2015. Something has changed in the configuration, but I don't understand what. 我认为问题是因为我使用的是VS 2017,而Bob Bobor制作视频时,他使用的是VS2015。配置发生了某些变化,但是我不知道是什么。 I'm sure the issue is that I need to include some sort of NuGet package. 我确定问题是我需要包括某种NuGet软件包。 I'd be delighted to do so, only I've no idea what NuGet package to install. 我很高兴这样做,只是我不知道要安装什么NuGet软件包。

I'm developing for Windows 10, using Visual Studio 2017 Community Edition. 我正在使用Visual Studio 2017 Community Edition为Windows 10开发。

For the "Windows 10 Development for Absolute Beginners" series videos,there is a correspondent sample here . 对于“视窗10开发初学者”系列影片,有记者样品在这里 If you opened one project you are referenced and build, you will find there are three ApplicationInsights relative Nuget packages referenced, and one ApplicationInsights.config file in the project. 如果打开了一个引用并构建的项目 ,则将发现该项目中引用了三个与ApplicationInsights相关的Nuget包和一个ApplicationInsights.config文件。 This should caused by when OS build is 10240, you create a new Windows 10 universal application in Visual Studio that a reference to Microsoft.ApplicationInsights is added to the references folder automatically. 这可能是由于当操作系统内部版本为10240时,您在Visual Studio中创建了一个新的Windows 10通用应用程序,该应用程序将对Microsoft.ApplicationInsights的引用自动添加到references文件夹中。 And after that, new builds coming without adding this package automatically. 之后,新版本将自动添加,而无需自动添加该软件包。

So that if you just need the error gone you may add the same three Nuget packages: Microsoft.ApplicationInsights 1.0.0 , Microsoft.ApplicationInsights.WindowsApps 1.0.0 , Microsoft.ApplicationInsights.PersistenceChannel 1.0.0 manually. 因此,如果您只需要消除错误,则可以手动添加三个相同的Nuget包: Microsoft.ApplicationInsights 1.0.0Microsoft.ApplicationInsights.WindowsApps 1.0.0Microsoft.ApplicationInsights.PersistenceChannel 1.0.0

But actually, Microsoft.ApplicationInsights is not supported UWP app starting 2.0.0 . 但是实际上, 不支持从2.0.0开始的UWP app Microsoft.ApplicationInsights Currently you should not use ApplicationInsights for UWP app which may be deprecated, but use HockeyApp SDK instead. 目前,您不应该使用可能不推荐使用的UWP应用的ApplicationInsights ,而应使用HockeyApp SDK

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 EntityFrameworkCore 在命名空间 Microsoft 中不存在 - EntityFrameworkCore does not exist in the namespace Microsoft 命名空间“Microsoft”中不存在“EntityFrameworkCore” - 'EntityFrameworkCore' does not exist in the namespace 'Microsoft' 命名空间“SharePoint”在命名空间“Microsoft”中不存在 - Namespace 'SharePoint' does not exist in the namespace 'Microsoft' Microsoft.Reporting 在命名空间中不存在 - Microsoft.Reporting does not exist in namespace 命名空间“Microsoft.EntityFrameworkCore”中不存在“迁移” - 'Migrations' does not exist in the namespace 'Microsoft.EntityFrameworkCore' 类型或名称空间名称“ Kinect”在名称空间“ Microsoft”中不存在 - The type or namespace name `Kinect' does not exist in the namespace `Microsoft' 命名空间'microsoft'中不存在类型或命名空间名称'directx' - the type or namespace name 'directx' does not exist in the namespace 'microsoft' 命名空间“Microsoft”中不存在类型或命名空间名称“EntityFrameworkCore” - The type or namespace name 'EntityFrameworkCore' does not exist in the namespace 'Microsoft 类型或名称空间名称“ Membership”在名称空间“ Microsoft.AspNet”中不存在 - The type or namespace name 'Membership' does not exist in the namespace 'Microsoft.AspNet' Azure 内部版本 - 名称空间“Microsoft”中不存在类型或名称空间名称“OpenApi” - Azure Builds - The type or namespace name 'OpenApi' does not exist in the namespace 'Microsoft'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM