none
System.TypeInitializationException when migrating code.

    Question

  • Hi,

    So, I have the "System.TypeInitializationException" when I migrated to a fresh install of VS express 2015 on a Win 7 professional machine. From VS express 2015 on Win 7. both having a newer .NET framework, only on this machine I have the latest(fresh install).

    The externals I use are: system.Drawing, system.Threading, system.IO.

    Im lost.. Can anyone make sense of my ramblings?

    Saturday, April 8, 2017 10:48 AM

Answers

All replies

  • What references are in the project other than the standard references?

    What happens if you create a new form in the project and make the new form the start up form, do you still get the exception?


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Saturday, April 8, 2017 12:48 PM
    Moderator
  • I'm a bit confused as it seems only C# is installed, since I can only add C# Files?

    Repairing didn't help, also I can't go online to find new templates. It does have the VB net main application templates tho, jut not the new empty file.

    Sunday, April 9, 2017 12:49 PM
  • I'm a bit confused as it seems only C# is installed, since I can only add C# Files?

    Repairing didn't help, also I can't go online to find new templates. It does have the VB net main application templates tho, jut not the new empty file.

    Re-run the installer and check your install options... not just a repair, but modify the installation options.  I'm not sure if this was the original VS2015 installer or the later, light, VS15 installer.  The latter does incremental installs so you may have missed a selection.

    You might also want to add an Application Event handler for UnhandledException and catch the error so that you can review the stack trace and see exactly where the error is occurring when attempting to create the form.


    Reed Kimble - "When you do things right, people won't be sure you've done anything at all"

    Sunday, April 9, 2017 1:44 PM
    Moderator
  • Hmm, reinstalled it twice "and now I have no installed languages what so ever". One thing I noticed it had to be in the same folder as VS for web, maybe the files got mangled? I did make a mistake, I can just add classes.. So I do have the languages.

    The result is a little different..





    • Edited by Naampie2000 Tuesday, April 11, 2017 11:06 AM
    Sunday, April 9, 2017 4:39 PM
  • It was a missing bitmap..
    • Marked as answer by Naampie2000 Monday, April 10, 2017 9:23 PM
    Monday, April 10, 2017 9:21 PM