Question: I had my PC re-imaged for me. I have Visual Studio Version 14.0.25123.00 Update 2 installed on my computer. I'm getting this error when I try to use VS intellisense to reference another project. 

> 
> CSharpAddImportCodeFixProvider encountered an error and has been disabled
> 
> 
> 

I have two projects. One of them using namespace `ProjectName.Web`. And the other project using `ProjectName.Web.Controllers`. The provider crashes when I reference `ProjectName.Web.Controllers`, I believe because it is setup as a project. Any idea how to fix this?

Answer: 
Happened to me when chose `Add using System.Data.SqlClient` automatically after typing `using (SqlConnection...){}` in DataLayer, in one of Repository classes.

Nothing helped (except creating new project), but I saw that the problem was with loading `System.Data.SqlClient.dll` file, although it existed in appropriate folder.

Found by trial and error that after removing `Dependencies->Assemblies->System.Data.SqlClient` from DataLayer (right click -> Remove, or just press Delete key when selected), I can Add `System.Data.SqlClient` without any errors.

Didn't try for other cases where `CSharpAddImportCodeFixProvider encountered an error and has been disabled` message appears, but the solution might be similar.

In my case the problem appeared probably due to `.net` Core version conflict or something like that, because the project was on external drive and created on another computer.

Edit: Also, some errors might be caused by .vs folder (hidden by default) inside Solution folder, especially if the project is moved between different computers. I know from experience that IntelliSense can seem to be broken and classes from other namespace would be unavailable although `using namespace_name` statement is present. The solution is to delete .vs folder or just avoid copying it with the project, as suggested here: <https://weblog.west-wind.com/posts/2018/Aug/07/Fixing-Visual-Studio-Intellisense-Errors>
Judging from the label you were given, "CSharpAddImportCodeFixProvider", I'd guess your problem was due to Visual Studio trying to identify and/or correct a missing "using" statement at the top of your C# source code file in which you made reference to a class that needed it. The Visual Studio components that usually deal with this type of problem are Intellisense, or third-party syntax highlighting/correction plugins like JetBrains' ReSharper.

On second thought, I'm not quite sure it's Intellisense's fault as opposed to the plugin ReSharper's. That's to be determined.

I did file a similar bug report with Microsoft. The error in my case seemed to be a result of the Intellisense not knowing how to deal with a logic error in my own code (see <https://connect.microsoft.com/VisualStudio/feedback/details/3133049>). 

In my case, I had inadvertently placed code for a method outside its class definition, though inside its similarly named namespace. Visual Studio 2015 Update 3 complained, 

> 
> 'GenerateVariableCodeFixProvider' encountered an error and has been
>  disabled.
> 
> 
> 

The fix was to move my method back into its corresponding class definition, but it definitely brought a Visual Studio bug up to the surface. 

Specifically, Visual Studio Intellisense had seen the line of code, 

```
    Response.Write("I did something"); 

```

placed in a method that was declared outside a class definition (i.e., inside a namespace, but inadvertently not inside its class). The "'FeatureLabel' encountered an error and has been disabled" error was then displayed in a yellow bar across the top of my editor window and an "Enable" button and an "Enable and ignore future errors" button were displayed next to it.

I believe that Intellisense (or ReSharper?) tried to automatically deal with the situation and attempted to generate a variable for the keyword, "Response", but it tripped trying to do so--which in turn caused the error that was displayed.