Home: Package 'Microsoft.ApplicationInsights.AzureWebSites' installing failing with ASP.NET project

Created on 2 May 2018  路  12Comments  路  Source: NuGet/Home

Steps to repro:

  1. Create ASP.NET web application (.NET framework)
  2. Try installing 'Microsoft.ApplicationInsights.AzureWebSites' version 2.5.6
  3. It will fail with following error:
Error downloading 'Microsoft.ApplicationInsights.AzureWebSites.2.5.6' from 'https://api.nuget.org/v3-flatcontainer/microsoft.applicationinsights.azurewebsites/2.5.6/microsoft.applicationinsights.azurewebsites.2.5.6.nupkg'.
The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.

Another case, if you try "dotnet add package " then it works fine and is able to get this package on disk in global packages folder.

So there are multiple issues here:

  1. Package signing verification is failing as part of VS which throws this error so needs better error handing
  2. Package signing verification succeed with dotnet add package so which indicates there might be different verification behavior... needs to confirm.
  3. Package itself is very weird, lot of data have been just dumped into /content folder so should discuss the purpose of this package with the authors.
  4. PackageType for this package is defined as "AzureSiteExtension" which is again wrong.

Work with AppInsight team to fix the package as well as error handing in NuGet.

2 Duplicate Investigate Bug

All 12 comments

We should remove the signing tag because -

  1. @zhili1208 confirmed that signing verification succeeds in VS
  2. dotnet add does not run signing verification. That is cross platform work that is yet to be done.

Based on Zhi's response the issue is a long file path problem during extraction.

@zhili1208 Can you add some details from the investigation here?
It's boils down to a long file path problem.

Zhi - as we mentioned in person, please work with this package author to help them understand how to better support users.
Also, please go write a validation rule that helps warn package authors when their packages longfilepath is too long. (we need to decide what too long is...) This should be one of the validations we run in pack, and in nuget.org ingestion (eventually) -- talk with @rohit21agrawal & @nkolev92 about those validation rules.

@nkolev92 dupe it out to search by tfm issue

Duplicate of #4071.

I have my project in the drive root and still get this exception. I can't find any way to install it. Suggestions?

@gckeller-ps Microsoft.ApplicationInsights.AzureWebSites is not meant to enable monitoring from visual studio. Its a site extension for Azure App Service, and has no value installing from visual studio.

To enable application insights from Visual Studio, please install Microsoft.ApplicationInsights.Web - this is the right package.

Thanks for you feedback @cijothomas Sorry, I responded previously believing this was an internal comment. I actually really dug into this one and found the problem last week. I was not looking to do VS in app insights. This package is actually screwed up. I used the process monitors to identifying the problematic files and observing the file system activity. They were numerous. If you open the actual nuget and explore the contents the paths within the nuget actually go beyond the maximum length before even making it to your local drive. Really difficult to identify without using process explorer. The only way I could get this to work was thru App Service Site Extensions. It is not possible to add a reference to this library at all. The package needs to be fixed or Nuget needs to support long filenames. SPECIFICALLY, I did need to use this when deploying to Linux (.NET Core) as Linux doesn't support site extensions. This is the only way. I'm hoping that I can convince the client to go with a Windows deployment as they will not be able to use App Insights without this package. BTW, this is a very large client having this problem. 2K hits/second. Microsoft should view this as a priority as they may lose a big customer using app insights. This package is a required dependency if you are using Core and deploying on Linux.

This ticket should also be re-opened now that I've identified the problem. It is a problem with the package and not Nuget and that it actually precludes the use of App Insights if you're deploying .NET Core to Linux.

@gckeller-ps For .net core, we have a package Microsoft.ApplicationInsights.AspNetCore which can be installed via nuget from visual studio and enable application insights in code. This should allow usage of application insights in linux.
Microsoft.ApplicationInsights.AzureWebSites is not going to be supported in future.

That is correct; however, once deployed it throws an exception on startup that requires a class in Microsoft.ApplicationInsights.AzureWebSites. It has to do with the .NET Core bootstrapping of the Microsoft.ApplicationInsights.AspNetCore library. This problem also occurs on windows, but I can confirm that it can be resolved by installing the site extension. It cannot be resolved on Linux because Linux does not support site extensions.

@gckeller-ps https://github.com/Microsoft/ApplicationInsights-aspnetcore/issues - Pleaese an issue in this repo with the issue you are having with linux+ .net core. We can definitely investigate more there.

Was this page helpful?
0 / 5 - 0 ratings