2

I get error "Object reference not set to an instance of an object" as soon as I try to access solution properties in Visual Studio 2012. It can be temporally solved by uninstalling Nuget, which is described here: Visual Studio - Error when clicking on Solution -> Properties (Object reference not set to an instance of an object)

If I uninstall NuGet it starts working fine, but as soon as I add NuGet back again same issue occurs again immediately. Nuget update to new version did not help. I wonder if anybody knows reliable solution for this problem.

I have Ver.2012.3.41009 of VS, other than NuGet package I have the following installed packages: MS ASP.NET Web Tools, VS 2012 Color Theme Editor, VS Extensions for Windows Library for JavaScript

UPDATE: Full info about the exception (Not too much: inner exception is null, stack trace consists of single line):

System.NullReferenceException occurred

HResult=-2147467261

Message=Object reference not set to an instance of an object.

Source=Microsoft.VisualStudio.CodeAnalysis.Sdk.UI

StackTrace: at Microsoft.VisualStudio.CodeAnalysis.SdkUiUtilities.GetService[S,T]

(IServiceProvider provider) InnerException:

UPDATE 2: I've just found out this error is solution-dependant. On some solutions it persists while on others does not

Community
  • 1
  • 1
YMC
  • 4,925
  • 7
  • 53
  • 83
  • Can you attach a debugger to VS, go through the repro and post the stack trace of the exception? That's probably the only way this issue is going to get resolved – JaredPar Mar 04 '14 at 17:57
  • how to attach debugger to VS? what is repo? – YMC Mar 04 '14 at 18:13
  • Open up another VS instance, Tools -> Attach to Process and choose the other VS (devenv.exe). Make sure you disable Just My Code and Enable break on NullReferenceException. Then right click in the other VS and it should give you the stack trace of the problem – JaredPar Mar 04 '14 at 19:15
  • Full exception info added, that's all I get from other instance of VS under debugger – YMC Mar 06 '14 at 02:47
  • As per the second answer in the question you linked, did you check the NuGet package manager console for errors? It's possible that a particular package (rather than NuGet itself) is causing the issue. – Nacimota Mar 07 '14 at 16:43
  • Looks like a bug in Visual Studio's Code Analysis. You should make sure you have all the latest patches and fixes and then report it to connect.microsoft.com. – Simon Mourier Mar 07 '14 at 17:39
  • I do have latest VS patches and fixes: MS VS Professional 2012 Ver 11.0.61030.00 Update 4 – YMC Mar 07 '14 at 20:05
  • @Nacimota, I do not see any errors in NuGet manager console – YMC Mar 07 '14 at 20:08
  • @YMC have you tried to disable code analysis on your project(s), that is your "project" properties, not your "solution" properties? I've had similar problems where settings need to be disabled, close down VS then re-opened and enabled. – wf4 Mar 14 '14 at 15:54
  • It does not help me, but even if it does, I need Code Analysis turned on anyway – YMC Mar 15 '14 at 16:47
  • How would one disable the code analysis? Can you maybe post the XML snippet since editing the project properties via VS does not work – x29a Apr 14 '15 at 11:18

2 Answers2

1

Looks like a known issue of visual studio. SeeMicrosoft Connect issue for the status of the issue. As mentionned by others, disabling the NuGet package manager seems to be the only known workaround for the moment.

  • I cannot work without NuGet package, I need it daily, it's not a workaround for me unfortunately – YMC Mar 14 '14 at 16:52
  • I found that after disabling NuGet, I had to re-start VS before I could open the properties dialogue. – user489998 May 26 '17 at 11:27
0

Nuget is a extension and "Properties access in a solution" should have nothing to do with Nuget theoretically. How do you access the properties in the soultion. Can you post some sample code ? Is it through the Automation model or VSSDK ?

Soundararajan
  • 2,000
  • 21
  • 23