How to solve "Adding Application Insights to the project failed" during integration of Application Insights? - asp.net

I tried to install Application Insights to my existing project. But getting the following error each time:
Steps I followed:
Created an Application Insights in Azure Portal
Right click and choose Add Application Insights Telemetry ... from
visual studio 2015
Put my Azure id and pass and choose the Telemetry which I create on step 1.
Clicked on Add button
And finally getting the above error.
Also tried to add the SDK manually. And then repeated the same steps.
Till now no luck! Can anybody point out the things which might solve the issue.
Thanks

Sorry, we broke this the other day when we released 5.209, and just deployed a hotfix for it.
To work around it, you can disable a new feature by creating a registry entry:
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\VisualStudio\14.0\AppInsightsGettingStarted]
"ConfigurationWindow"="Disabled"
and restart VS and things should go back to normal.
Edit: this was fixed today (6/14/2016) and deployed to the VS gallery as version 5.209.60613.1
https://visualstudiogallery.msdn.microsoft.com/82367b81-3f97-4de1-bbf1-eaf52ddc635a
If you have auto update enabled in VS, you'll automatically get a new version, otherwise you can manually go to tools -> extensions and updates to update the extension.

Related

You do not have permission to access the IIS configuration file - Web app error

I am trying to load existing c# web applications and getting below errors while loading any web project:
Creation of the virtual directory http://localhost:/ failed with the
error: You do not have permission to access the IIS configuration
file. Opening and creating web sites on IIS requires running Visual
Studio under an Administrator account.. You will need to manually
create this virtual directory in IIS before you can open this
project.
The following error occurred when trying to configure IIS Express for
project xxx.WebApi. You do not have permission to access the IIS
configuration file. Opening and creating web sites on IIS requires
running Visual Studio under an Administrator account.
I tried following, but in vain:
Running VS 2017 pro as an administrator.
I ensured that I have access to %systemroot%\System32\inetsrv\ and C:\Windows\System32\inetsrv\Config folders.
I have installed all IIS compatibility windows features through control panel.
Restarted IIS manager.
Created virtual directories.
Changed registry path of HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Personal from u:\ to C:\Users\MyUser\Documents.
Uninstalled IIS Express 10.0 from control panel and reinstalled it through VS2017 installer by clicking – Individual components – cloud, database server – IIS Express.
Repaired VS 2017.
Got admin access on machine.
Created new empty web project but getting same error while new console app runs without errors.
Restarted machine after every installation related change.
All the solutions tried are mentioned on stackoverflow but are not working for me. Is there something trivial that I am missing? Please guide me to crack these IIS errors.
I was able to solve this issue doing the following:
1- Go to C:\Windows\System32\inetsrv and double click on directory config and accept the warning message.
2- Go to C:\Windows\System32\inetsrv\config directory and double click on directory Export and accept the warning message.
Then you will be able to run the app in your local IIS without being an administrator. You can follow the path in the given Image.
This solved the problem for me with Visual Studio 2017, .Net Core 2.2 and IIS Express 10.
You need to ensure devenv.exe has sufficient permissions. You can find it at:
C:\Program Files OR Program Files (x86)\Microsoft Visual Studio nn.n\Common7\IDE
Right click on the exe, select Properties, Security. I gave Administrators full control as I'm running VS under admin.
My Simple solution was to right click on Visual Studio and click Run as Administrator. But a solution above tells you how to have Visual Studio always run without having to run as an administrator.
All these solutions could not work for me. The issue was, I have accidently uninstall IIS from control panel even it was install and showing me. but was removed from control panel. I reinstall IIS latest version and able to fixed the problem. This might help for others.
This link help me
VS2017 RC - The following error occurred when trying to configure IIS Express
The issue for me was caused when I modified my project to override application root URL. After a push/merge and new branch my project would not load any longer. reverted the changes and all is well again.
Open an elevated command prompt and enter the following command to substitute a drive path for U drive.
c:\windows:\system32> Subst u: C:\Users\MyUser\Documents
I had replaced ‘U:’ path in registry with ‘C:\Users\MyUser\Documents’ previously. I think that was not sufficient. Some references of u:\ might have been hindering IIS.
The total substitute command must have replaced all references and the IIS config error got resolved. Hopefully, now I’ll be able to load my web apps.
I had the same issue, but instead of the workarounds (such as first double-clicking certain directories each time or running the security risk of always having to always run my VS as administrator), was able to permanently resolve the issue by deleting the "ProjectName.csproj.user" file and that fixed it. I guess there was some incompatible setting in the user file that VS couldn't deal with.
For older versions, change the option from IIS to your solution name, before clicking on the green play like run button, to build and run the application.
We resolved this by removing the project and adding it back.
If you're used to run your Visual Studio via shortcut with 'Run as administrator' checkbox marked, double check it is indeed still selected. For some reason mine had unchecked itself resulting in inability to load an IIS project. I was 100% sure my VS had these administrative privileges as usual, which made me try all the Internet proposed solutions except for the most obvious one.
Restarting Visual Studio worked for me.

Application Insights extension breaking Azure web app

I had Application Insights running smoothly on an Azure Web App via the AI SDK, reporting to an AI instance hosted in Azure.
The only niggle was it didn't show detailed dependancy diagnostics, according to this page this was because I was using the SDK only, I needed to "Instrument your web app on the server", which looking at the docs can't be done if you already have an instance of AI running....helpful!
Reluctantly I deleted the AI instance, stripped the SDK from my code so I was starting fresh, and followed the steps, however as soon as I finished the process in the previous link my website broke and now responds to every single request (MVC5 and Web API) with an empty 404 request
The AI status page is showing green ticks for everything, and I can't discern anything from diagnostic log dump from KUDO or manage to remotely debug the site.
Deleting the AI extension under Web App -> Extensions in the Azure portal and then restarting the web app fixes the problem.
I've run out of ideas on how to fix this, is there anything else I can do to get to the bottom of the problem?
To fix this problem, delete the following 2 files from your web app's (or slot's) filesystem:
D:\home\siteextensions\Microsoft.ApplicationInsights.AzureWebSites\Instrumentation32\ProductionBreakpoints_x86.config
D:\home\siteextensions\Microsoft.ApplicationInsights.AzureWebSites\Instrumentation64\ProductionBreakpoints_x64.config
You can do this easily through Kudu.
Edit: Apparently this is/was an issue with the ProductionBreakpoints interacting with precompiled views. Microsoft has informed me a fix should be out within the next couple days. The version of Application Insights extension I have now that is still broken is 2.4.6 - I will post the "fixed" version when I can confirm it.
Edit 2: Confirmed this is fixed in 2.4.7 which is out now.

Web Deploy - two similar apps 1 works 1 doesn't despite successful deploy reported

I've got a Windows 2012 r2 server with IIS 8.5 running on it.
I am trying to deploy a new web app in a sub folder of the root website. This is my third web app that I will have up there and the prior two are fine, but for some reason this app when I use Web Deploy to push it doesn't fully populate all of the Features for the app.
I had to manually enter Application Settings and Session State is completely greyed out so I can't even fill in what exists on the other web apps I've published.
Recently I upgraded to VS 2017 so I thought it might be a glitch in my setup so I ripped one of the two existing apps out and did a re-deploy on them and they work perfectly.
I'd post more info but I am not sure what someone helping might want to see.
Any ideas on what's going on?
Updated: May Monday 15th,7:50AM Central US --
I went back and looked at the Features view and compared the content from the working app (republished as a test and still worked fine) and this one that I'm having the difficulty with. Here are the results. (this with 100% success reported in Web Deployment publish)
I am able to edit the first two of these feature items to make them identical to the working app but not the third. All options on this are grayed out:

Unable to activiate Windows Store App after failure to install Application Insights

In a project I have tried to install Application Insights, but that failed with an error message and installation of it stopped. I don't remember the exact errormessage, but it was something like "Namespace/_defaultaApplidation was not found" It was not clear to me what it meant.
'
After that the App (Windows 8.1 StoreApp) would not start anymore. Message (and I can repeat that!) sounds: "Unable to activate Windows Store app". This will not go away.
I have uninstalled Aplication Insights via 'Tools | Extensions ad updates' and removed every trace of Application Insights via Nuget Package Manager. I have rebooted my system between every step.
It has come to a situation where now not a single Store App will start. Even if I start with a new Empty App template, the App comes with the same dreaded error message. I have deleted Bin and Obj folders, built, rebuilt and that ends successfully. But the App won't start....
What do I do now?
Grtz
This is a difficult problem to diagnose. Uninstallation of the ApplicationInsights NuGet package, and removal of the ApplicationInsights.config file should remove all changes. And I'm not sure how the AppInsights packages could be impacting other new projects.
It perhaps sounds like you have a broken Visual Studio environment. Trying to reset or repair your Visual Studio environment would be my recommendation.

Debugging ASP.NET in IIS 7

I have searched all the usual but come up empty. I must be doing something silly!
Simply I created a new project, ASP.NET Web App, and wish to use and debug it with the local install of IIS 7.5 on my Windows 7 x64 box.
According to what I have read it should be a simple process; my issue is that Visual Studio will not stop at breakpoints nor at errors etc.
I just don't get it:
Visual Studio is attaching to the w3p process for me automatically.
If I hover over the breakpoints it shows a message saying the same, that it is in the same w3p process.
I am in Administrator context. I manually ran it like so to be sure but in any case if you are an admin it runs like that anyway.
Some notes:
I do not wish to use IIS Express as I require native IIS 7.5 for my tasks, however it does debug in express - no surprise there.
As mentioned above, all this is being done locally.
The path of the virtual directory is pointed towards the project files, as set by Visual Studio 2010. It even set the Network Service as read on the folder structure.
When debugging from VS the web site runs fine, just debugging is the issue.
Maybe it is permissions? The Default App Pool is using the ApplicationPoolIdentity not Network Service... Should it be? I had assumed they we.re one and the same essentially. Although I changed this and no luck unless I didn't do something I should of
Keep in mind here that my issue is semi-unique in that I am not receiving error messages, not even in the event logs... For all intents and purposes it should be working fine, just it isn't.
VS and IIS, and all updates, are applied to date.
Note: I'm familiar with IIS7.5, I run my own public web hosting server. I just never tried to debug
Note: It is Visual Studio 2010 Ultimate
Thanks for your time.
Sigh!
I went back to basics... Uninstalled IISExpress and tested; It worked! Re-installed IISExpress; It worked!.
I guess installing IIS7 native after IISExpress did something screwy? I had ran the register ISS command on IIS7 when I installed it.
Right, so now I have both installed in tandem and they work fine. Thanks for all your help guys, appreciated.
you can try right-click on project in VS go to properties select web from left menu tab. Check if ASP.NET debugger is checked and also you can select Use Local IIS Server and give localhost url there (in project Url textbox) and then Say start debugging from VS and put breakpoints.
I had a similar issue the other day, I attached the debugger to the wrong w3p process, make sure you attach it to the one the app pool identity is running under.
I wanted to write it as comment by I don't think I can add pictures..
Are you sure you are running the same version of dll?
Is your breakpoint filled like this?
or hollow like this?
1st go to ,Program and Feature in control panel and then in that turn on or off windows features. and now check all check boxes(activate features) related to Internet Information server & windows service managers. once this is done run your visual studio as administrator and then attach to right w3p process.

Resources