21

I'm on Visual Studio Premium 2012, Version 11.0.50727.1 RTMREL, Windows 7 Enterprise (SP1).

When I right click on the Solution, and click Properties, I get a popup window showing the the null reference exception (Object reference not set to an instance of an object).

When I try the same in 2010, it works fine, opening up the normal solution properties pages, allowing me to set the startup order etc.

Also, in 2012, View -> Property Pages, gives the same result.

Please advise how to solve this, is this a known bug?

UPDATE 1: Tried running devenv /resetsettings as well as devenv /safemode but the problem persists. Also tried it on a new solution, and the problem persists.

UPDATE 2: Seems that disabling any extension, and trying again, sorts out the issue. Re-enabling extension doesn't bring the bug back.

UPDATE 3: Go vote here if you're still having this issue: https://connect.microsoft.com/VisualStudio/feedback/details/763961/cannot-open-property-pages-for-solution

jamiebarrow
  • 2,473
  • 3
  • 30
  • 51
  • Same problem here, haven't found a solution found yet. – Johann Blais Sep 25 '12 at 13:13
  • If you're also experiencing the problem, I opened an issue on Mircosoft Connect for this, let's hope they find the solution - https://connect.microsoft.com/VisualStudio/feedback/details/763961/cannot-open-property-pages-for-solution – jamiebarrow Sep 27 '12 at 20:53
  • same problem for me, I disabled Resharper and nothing, I wonder why you selected an answer that doesn't work, that prevents someone to come with the answer. – k-dev Nov 09 '12 at 02:02
  • @k-dev because it works for me. Try disabling any extension, then try again. If you still have the error, try restarting Visual Studio after you disable the extension, and try again. Note that it seems to be intermittent as well - re-enabling the extension doesn't cause the error to come back. Also note, it's not ReSharper specific, I also tried it with other extensions on colleagues' computers, and it works. – jamiebarrow Nov 14 '12 at 14:18
  • Might be helpful to have UPDATE 2 as the answer as it doesn't appear to be Resharper specific. – Andrew Rimmer Dec 19 '12 at 10:02
  • @AndrewRimmer added a note to the answer, so hopefully people will be less confused and read the main post instead of just the answer ;) – jamiebarrow Dec 28 '12 at 00:46

4 Answers4

15

This happened to me as well. If you have ReSharper installed, try disabling it (Tools -> Options -> ReSharper -> General -> Suspend and restart VS2012. If you do not have ReSharper installed, I'm afraid I have no idea.

After seeing some comments here, and running into it myself, it appears that disabling Re-Sharper doesn't always fix the issue. However, if you disable, restart, re-enable 'other' add ons, the issue will eventually go away temporarily. The next time visual studio opens, you will likely be in the same spot.

Don Thomas Boyle
  • 3,055
  • 3
  • 32
  • 54
kevin_fitz
  • 837
  • 6
  • 19
  • Thanks Kevin. I'll mark this as an answer. I do have ReSharper installed. I've actually disabled it, restarted VS, and had the same problem. I've then tried disabling other extensions, and restarted, and then it magically works. Then I re-enabled, and still works. But restart machine, and the problem comes back again. I assume it is something to do with a plugin, but what exactly, and why it works until you restart the machine... I dunno. Cheers. – jamiebarrow Oct 08 '12 at 14:54
  • 3
    Wow, I can reproduce that, I just tried to open property pages again, had the null ref error show again. Then went and disabled an extension, and it works again. It appears it's the VS2012 equivalent of 'jiggling the wire' I'll keep this thread up to date if I come across any more (somewhat) useful info. – kevin_fitz Oct 08 '12 at 19:00
  • don't forget to also update the MS connect issue I posted in the original post's comments. – jamiebarrow Oct 08 '12 at 20:28
  • I will make sure to update there as well, should I find anything. – kevin_fitz Oct 09 '12 at 14:04
  • I finally received a response back from a Microsoft Connect ticket I had opened. It appears that the plugin that is causing the problems is T4Scaffolding (MvcScaffolding is dependent on it). Their suggestion was to uninstall and re-install the offending nuget package. If that doesn't work, they suggest disabling that package. It does not seem that uninstalling/re-installing works for me. Good luck. – kevin_fitz May 30 '13 at 15:38
  • I am also having this problem, and no amount of playing around extensions and nuget packages seems to fix it for me. – Andrew Lewis Jun 05 '13 at 16:14
4

In my case, the problem was solution-specific. NuGet was causing this error, but not the extension itself but a NuGet package that generated an error on VS load. When I opened NuGet Package Manager Console I saw a big red text with a description of the error. In my case it was T4Scaffolding.Core package, which in turn is a dependency of MVCMailer.

If this is your case, you will probably see what package generates an error in PM Console.

V.B.
  • 6,236
  • 1
  • 33
  • 56
0

I was encountering this problem on one of my solutions, while it didn't happen for others. The solution causing the trouble didn't do so until I added a certain project to it; after that I could not view the solution's properties anymore or set the startup projects.

Removing the project from the solution didn't solve it, the only way to 'reset' was to create a new solution file and adding all projects one by one to it. This made it work again, until of course I re-added the offending project.

Today the issue was solved for me by updating the NuGet package manager.

CodeCaster
  • 147,647
  • 23
  • 218
  • 272
  • Hmm, interesting. Did you do a diff between the old solution file and the new solution file? Perhaps that might shed some light? Which version of NuGet package manager were you on (and which did you upgrade to), might be useful to others. – jamiebarrow Aug 26 '13 at 12:30
0

This is my experience with the problem: (Running VS2012 as administrator, hoping that some setting would be sorted out).

I have a solution with two MVC projects and other projects. If I unload the two MVC projects without restarting VS, the problem is still there. After restarting VS, with the two projects not loading, but showing in Solution explorer, the problem disappears. Load the two projects back, Solution properties still work, but after a restart the cycle restarts.

NOTE: There is no difference in the projects and solution files when the two MVC projects are not loaded.

dawidg
  • 2,089
  • 2
  • 13
  • 5