Share via


CSharpAddImportCodeFixProvider encountered an error and has been disabled

Question

Thursday, April 28, 2016 3:43 PM | 1 vote

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. This is also preventing me from building my solution because it can't find the correct name space.

Any idea how to fix this? 

All replies (1)

Friday, April 29, 2016 7:09 AM âś…Answered

Hi EugeneQilo,

Do you reference another project in Visual Studio 2015 Update with the steps of References -> Add Reference -> Projects tab -> select your project into your current project?

Please try create two sample project without any custom code and then reference with above steps to check whether it also has this issue.

If the new project works fine, the problem is related to your current project. Please try with following steps to confirm which project causes this issue.

  1. Create a new default project.
  2. Reference this new project into your current project.
  3. If it also get this message, the problem is mostly related to your current project. If it works fine, please go to step 4.
  4. Use the new created project to reference the existing referenced project. If get error, the problem is caused by this referenced project.

After confirm which project causes this problem, please move the original project files to new project one by one to confirm which file causes this issue.

And please remove the provider to check whether the problem is related to the provider itself.

If all steps in above get this error, please try following steps to troubleshoot Visual Studio.

  1. Run Visual Studio as administrator to make sure it has enough permission to do any operations.
  2. Run Visual Studio in safe mode to prevents all third-party VSPackages from loading when Visual Studio starts, thus ensuring stable execution.
  3. Close all third part software when running Visual Studio, such as antivirus.
  4. Please check the ActiveLog.xml under the path of %AppData%\Microsoft\VisualStudio\14.0. This file will log all operations when you operate Visual Studio.

If you don't find the ActiveLog.xml in that path, please turn on the /Log switch and re-operate again to generate operations log.

Best Regards,
Weiwei

We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.