VS2012: Property Pages isn't opening: Object reference not set to an instance of an object - visual-studio-2012

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

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.

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.

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.

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.

Related

Error when using development time IIS support

Update: this bug has been fixed for a while now
I installed Visual Studio 2017.3 yesterday and was trying to used the new Development time IIS Support feature. I think I encountered a bug, and I was wondering if anyone knows a workaround this bug. When I used it with a new project it works fine most of the time. By most of the time, is that I think it is broken sometimes depending on the where the project is located/state of cached data, etc.
Sometimes I get an error "Value cannot be null. Parameter name: name". That's the entire error. No log files, no extra information.
I tried to enable the feature for an existing project I am working
on, it got that error.
I tried adding a new web project in a new solution it worked fine. I tried adding a new web project in the same solution as my project, it didn't work.
I deleted all temp files, all bin obj and .vs folders and .user files in the
solution. Same problem.
I deleted temp folder, visual studio user profile data, and restarted the PC same problem.
I tried again in the same solution with the project not having '.' in the name, it worked.
I did some modification to the project that was working and tried to launch again I got same error.
I reverted all changes so that the project was back to the "empty project" state, still same error.
I removed the project. Exited visual studio, deleted all temp/.vs/.use/bin/obj files. Then restarted and added the project again, it worked.
I restarted VS and tried to relaunch it didn't work.
The aspnet core version seems to be not related to the bug. I had the problem with projects targeting 1.1 and 2.0 and also had the feature working for both versions.
So obviously this is a bug in VS2017.3. Since even if I am doing something wrong I should at least get an error explaining what I do wrong not an ArgumentNullException message. I already made a bug report. I am wondering if someone knows a workaround thing bug.
Thanks a lot in advance.
Update: This bug has been fixed for a while now.
After some investigation and with help from a helpful member of Microsoft's Visual Studio Team, I found that Visual Studio was failing at the point where it grants folder read access to the IIS App Pool account. The method that gets the App Pool account name was returning null, and when that null value was passed to the System.Security.Principal.NTAccount class constructor, the ArgumentNullException is thrown.
A workaround that fixed the problem for me, was changing the App Pool to any other App Pool, trying to launch, then changing it back to the original/desired App Pool.
First You Must Update Visual studio with visual studio Installer and Launch the Visual Studio installer.
And Select the Development time IIS support component and Modify.
Wait For Download is Processing
The component is listed as optional in the Summary panel for the ASP.NET and web development workload.
Then you Create New Project Again
Problem Solved.

Visual Studio 2017 publish to Azure fails with null reference ("object reference not set to an instance of an object")

Crash on Azure publish from Visual Studio. The same thing happens in previous versions of Visual Studio, but in the past I've been able to work around the bug by clearing the appdata and if necessary resorting to resetting user settings per the responses to this question about a VS2015 issue.
Azure publish has been working up to now in 2017. Suddenly I am getting the dreaded null reference, and this time clearing the aforementioned data has not helped:
Restarted Visual Studio, restarted machine, cleared data a second time including both roaming and local appdata, all to no avail.
Just for others searching, in my case the issue was that I had previously disabled the "Microsoft VisualStudio Managed Publish" extension in VS2017 (probably in an attempt to get VS to be more responsive). To re-enable it, go to Tools > Extensions and Updates, enable it, then restart VS:
Thank you for your sharing. I have the same case as you. I accidently disabled the "Microsoft VisualStudio Managed Publish" extension in VS2017. The publish menu even doesn't show up in .net core solution explorer. To re-enable it, go to Tools > Extensions and Updates, enable it, then restart VS.
Unchecking/unselecting the Application Insights in the Publish workflow of Visual Studio 2017 fix the error for me.
This can be caused by a validation error in the service definition and configuration files.
Even though the editor doesn't highlight any problems, and the build completes successfully, there can be errors in these files and they are not handled properly when you attempt to publish, giving the null reference error.
I encountered this after modifying the files per these steps to configure SSL. I really wasn't expecting that to be the culprit, but in desperation I was trying everything I could think of that might be causing the problem. As soon as I commented out the change to the <certificates> element, the null reference error went away, and the publish succeeded.
(I now need to work out why the steps for SSL configuration didn't work, perhaps due to a change introduced by VS2017, but that's another story.)
I was experiencing the same issue as the OP. I created a new DB Project and then compared the settings of the new DB Project with the DB Project that was causing the Null Reference Exception upon Build or Publish. I noticed that our output directory was redirected to a non-standard location. After deleting all the files in the bin folder, the Build and Publish started working. YMMV
I found a lot of answers around that -- so may be there are more than one -- but none worked for me.
On my system it worked again after removing the installations for ASP.NET and Azure and installing it newly .. --> evth is fine.

VS 2012 Error on build of Hello World: "The operation could not be completed. The parameter is incorrect"

I have started up VS 2012. I created a new solution/project, and made the project a console app. In the provided "Program" class, in the "Main" method, I have added a single line, namely:
Console.WriteLine("Hello World");
This is the ONLY thing I have done.
I right-click on the solution name, and select "Build".
Immediately, a dialog/alert pops up with the title "Microsoft Visual Studio", containing the silver "X" in the red circle, followed by the enormously useful error text that reads:
The operation could not be completed. The parameter is incorrect.
I have done extensive searching on this very informative error, and have come to the conclusion that it pops up in many different circumstances. In my case, I started experiencing it some days ago (on a much more complex MVC app) and it seems intermittent. Sometimes I get the error, sometimes not. Sometimes I can close VS entirely and re-open and it will still be there, sometimes it will be gone for several hours. Rebooting the system (ick) usually makes it go away.
Any help out there? This is now driving me crazy. Many thanks in advance.
ADDITIONAL INFO: If I kill all Visual Studio applications in the task manager (rather than just closing the Visual Studio the more conventional way) it seems to always fix the problem on restarting Visual Studio. Still baffled.
Simply turning VS off and on again removed this error for me.
I tried to solve this by deleting the *.suo files, bin and obj folder, with no success. I tried to restart VS(2015) and reload the solution. All project references were fine.
I then killed all processes related to Visual Studio.
After that I was able to rebuild the solution.
For me this happened when I removed a project from the solution that wasn't at the same path anymore.
Weird, it was a greyed out project, but was still needed for the build somehow?!
I found out where it was referenced, in my .sln file I had a References entry pointing to the guid of a missing or deleted project in the solution. This would cause an error.
You can also check the properties pages of the solution, one of them gives a message about a project with the name "" that doesn't exist.
So basically, cleanup the References section in your .sln until it builds.
This happened to me in a new web project in VS 2015. I got the error when I tried to build or clean the solution. Closing down VS and deleting everything in the bin folder worked for me.
For me what helped was to delete all bin obj folders and rebuild the solution.
I was moving an mvc project from 2013 to 2015.
Strange as it is - happened to 2 solutions, but not for every other I had.
For me, my project was not opening on VS 2022 ,i tried this and it worked!
Directory: Your project folder/.vs/SolutionName/.suo
Solution: Delete All .suo files from above directory
Note: If you cant find , just search '.suo' on project folder.
Run the project.

Why won't my VS2012 recognize modified files on disk and reload?

I've been away from Windows and Visual Studio for a few years. Now I have VS2012, and I notice that it fails to recognize that a file has changed on disk (i.e. by a different editor). In fact, even if I hit the refresh button on the Solution Explorer window, it still doesn't reload the file. I can close the window and reopen it -- still no luck. I thought "gosh, I hope I don't have to close and reopen the solution each time!", but it turns out even THAT doesn't do the trick.
Its as if VS is caching old copies of files and cannot imagine that someone might use something other than VS to modify them.
These are just local files, no network issues involved. I must be missing an understanding of some major new "feature", yes?
--- Edit: -----
Ok, here's some progress. I've been using the VsVim extension to have a vim-compatible keymap. On a hunch, I disabled it, restarted VS, and found the problem solved. Then, I re-enabled it, and the problem is still solved. So the mystery remains, but not the problem.
I don't have VS2012 (I went up to 2005), but from what I remember, this is configurable from the IDE. In VS2005 go to the menu, choose Tools, then Options, then Documents, then you'll see the options to detect when files are changed externally, and to auto-load files changed externally. I think in VS2012 it'll be similar.

The Debugger cannot continue running the process. Unable to start debugger

I have a Lightswitch 2012 application. It's been working fine for weeks. I made some changes and F5 stopped working. When I click on Start (toolbar) it gives this error message and does nothing.
"The Debugger cannot continue running the process. Unable to start debugging"
Note: It does compile file, it just doesn't run.
If I rollback to an earlier version then it works fine - i.e. it is solution specific.
Here is a video of the current version of my solution with the problem:
http://screencast.com/t/TD4RzLASO
and here is the previous version of the solution from earlier today (and no, I don't know what I changed). As you can see, at least it does something with F5 or Start:
http://screencast.com/t/wX5fRDPz
Rebooting doesn't help... ;)
Maybe you should select start up project which can be started.
Solution Explorer -> On your startable project right mouse click -> Set as Start up Project.
I had this situation when i unloaded my main lightswitch project and other project which is dll has been selected automatically and when i reloaded my main project "The Debugger cannot continue running the process. Unable to start debugging" exception was shown, because debuger was trying to load DLL.
Sometimes you need to start up a project which is compiled as a dll, for instance when testing WCF services.
To do so:
Projects -> 'Set Startup Projects...' -> Select 'Multiple Startup Projects' and set action to 'Start' for each one.
It's a pity you didn't recorded the whole screen, so I can't confirm, but I had the same error a few times...
When this happens, my "output panel" isn't visible and even I try to go on Menu -> View -> Output the panel don't appear.
I need to restart my Visual Studio 2013.
Then my output panel is visible again and everything works fine.
I discovered the cause was an extension which I installed on my Visual Studio.
I encountered this problem after removing some projects from the solution. I wasn't able to pinpoint the exact cause, but closing the solution, deleting the solution file, then opening the project and re-adding supporting projects solved the issue for me. Kind of a sledge hammer, but only takes a minute to do if you don't have a lot of projects.
Also, there are some people that uses a "One Click" Certification in your settings that you'll want to make sure its set up right, re-install or unchecked in-which this case was my problem. I finally got it working myself, but check that too just in case. Again this would be for most Visual Studio Versions only. Im 2013 Ult.

Resources