Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8926009
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T07:51:33+00:00 2026-06-15T07:51:33+00:00

I am getting a TypeInitializationException when I try to debug my application in Visual

  • 0

I am getting a TypeInitializationException when I try to debug my application in Visual Studio 2012, but I am able to run the application in Visual Studio 2010 without error.

I recently moved a bunch of stuff around (including my project and several references) in order to get it into a version control system. I had to relink several items so that everything would link correctly when checked out on a different system.

Our development environment is mixed (VS2010 & VS2012). Running out of VS2010 produced no errors. But when I ran the Debug in VS2012 I received the TypeInitializationException exception.

The project in the original directory (where it resided before moving for version control purposes) still runs fine in both VS2010 and VS2012.

There is a flag or a parameter or something that got a little messed up somewhere, but I’m not sure where. Does anyone have any ideas on what I can do to get this to work in VS2012 as well?

(please let me know what, if any, code or config information to include here)

InnerException:

The type initializer for ‘System.Windows.Navigation.BaseUriHelper’ threw an exception.

(Second) InnerException:

The type initializer for ‘MS.Internal.TraceDependencyProperty’ threw an exception.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T07:51:35+00:00Added an answer on June 15, 2026 at 7:51 am

    Comments on the original question sparked further searches, which ultimately yielded a solution.

    Doing a search for “The type initializer for ‘System.Windows.Navigation.BaseUriHelper’ threw an exception.” I found the following StackOverflow question: WPF Application fails on startup with TypeInitializationException

    Similar to that question I had added a <startup> </startup> block to my “app.config” file. Where this tag block was placed made the difference:

    Causes Error in VS2012:

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
        <startup useLegacyV2RuntimeActivationPolicy="true">
            <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0,Profile=Client" />
        </startup>
        <configSections>
           ...
        </configSections>
        <applicationSettings>
           ...
        </applicationSettings>
    </configuration>
    

    Everything works fine:

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
        <configSections>
           ...
        </configSections>
        <applicationSettings>
           ...
        </applicationSettings>
        <startup useLegacyV2RuntimeActivationPolicy="true">
            <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0,Profile=Client" />
        </startup>
    </configuration>
    

    Moving the tag block to the bottom did the trick!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Getting this error when I try to run this script. I'm creating the function
Getting following error message when I try to fetch JSON response into my app.
Getting a MySQL error message when I try to insert a text message from
Getting an error is usually unpleasant, but sometimes it is also unpleasant when you
Getting Invalid Application Path error. Here are the steps I've taken. Right click on
Getting the following error/exception while trying to compile my maven based web application... can
Getting a Operand should contain 1 column(s) mysql error whenever I try to insert
Getting this error on ALL ClickOnce application launches for a certain user. This started
Getting this error while I am trying to run /compile/build a Proiject Incompatible Types
Getting 'Dispatcher has no subscribers' error while trying to post message to a channel

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.