locked
VS2012 RC - Error when adding a new table or deleting a screen. Object reference not set. RRS feed

  • Question

  • I upgraded an existing VS11Beta application to VS2012RC.  It uses an intrinsic database.  Upgrade went fine.  I was able to build and run the app successfully.

    However, when I try to add a new table Visual Studio displays the error "The add new operation failed. Object reference not set to an instance of an object".

    I have rebooted, cleaned, rebuilt.  Same error.

    I get the error regardless of how I trigger the command, either right clicking on ApplicationData in Solution Explorer, or selecting the PROJECT / Add Table item from the top menu.

    I believe this may be the same error reported here: http://social.msdn.microsoft.com/Forums/en-US/LightSwitchDev11Beta/thread/0c9a2cbe-7c73-4843-b5fa-cd19137d0d49 but waiting to see the OP confirm the error message in English.

    My config is Win7, 64bit.  I installed RC without first removing VS11 Beta.

    ====

    I created a brand new project to see if that would work.  Nope, same error, so it must not be related to upgrading a VS11Beta app.   Screenshot below:


    Ed Taylor






    • Edited by Ed Taylor Sunday, June 3, 2012 1:06 AM
    Saturday, June 2, 2012 11:39 PM

Answers

  • The solution to these problems for me was to delete the following two VS cache folders:

    • ComponentModelCache
    • ManifestCache

    After doing that I was able to add a new table, add a new screen, and delete tables/screens without seeing the "Object reference not set..." error.

    Hope it works for others too.


    Ed Taylor

    • Marked as answer by Ed Taylor Sunday, June 3, 2012 4:01 PM
    Sunday, June 3, 2012 4:01 PM

All replies

  • I ran into the same problem.  The difference was that I had uninstalled VS 11 Beta before installing VS 12.

    I got the same error message when trying to add a screen.  The second time it appeared to add the screen but not to the list of screens.  When I exited and returned into the project it was on the list.  However, when I did a build, it did not appear.

    I too will be watching ... something isn't right here ... yet ... but I have the confidence ( hope ) we will have a fix soon.


    Tim Stone MLS Small Business Services

    Sunday, June 3, 2012 12:18 AM
  • I just tried adding a new screen.  It worked OK, but the new screen did not show up in the list of screens within Solution Explorer, even after clicking Refresh.  I had to restart VS to see it.


    Ed Taylor

    Sunday, June 3, 2012 12:36 AM
  • After some more trial and error testing, it appears that the new table actually does get created, but the Table Designer does not automatically open up.   I had to find the table in Solution Explorer and double-click it to open the designer.

    However, the "Object not set error..." must screw something up with the internal state, because when I tried to add a column to the newly created table I got another weird error after typing in the column name and tabbing out:   "Change should not happen outside of a transaction"

     


    Ed Taylor


    • Edited by Ed Taylor Sunday, June 3, 2012 1:09 AM
    Sunday, June 3, 2012 12:43 AM
  • Well, as I mentioned, I was able to add a new screen under VS12RC, but when I went to delete it I got an error "The deletion failed. Object reference not set to an instance of an object".   Something is definitely is not right.   Wondering if others are able to do it and it is something related to our particular installation?


    Ed Taylor

    Sunday, June 3, 2012 1:03 AM
  • The solution to these problems for me was to delete the following two VS cache folders:

    • ComponentModelCache
    • ManifestCache

    After doing that I was able to add a new table, add a new screen, and delete tables/screens without seeing the "Object reference not set..." error.

    Hope it works for others too.


    Ed Taylor

    • Marked as answer by Ed Taylor Sunday, June 3, 2012 4:01 PM
    Sunday, June 3, 2012 4:01 PM
  • Hi, I am not getting any of these errors. First machine has W7, VS2010 SP1, VS LS 2011, VS2010 SDK SP1, LS Ext Toolkit and now VS2012, SDK, LS Ext Toolkit. To get all my solutions working I did need to install SL5 Tools for VS2010 SP1 (there is no VS2012 version), and I also need to finish off with a repair VS 2012 for new LS projects to work again after the SL5 Tools. So the problems stem from your environments and not simply that LS in VS2012 does not work.


    Xpert360 blog | twitter : @xpert360 Opinions are my own. Please mark as answer if this helps solve your problem.

    Sunday, June 3, 2012 4:05 PM
  • Thanks for confirming that things are working for you.  

    Yep, looks like my issue was environmental due to stale data in two VS cache folders.  


    Ed Taylor

    Sunday, June 3, 2012 4:20 PM