none
.NET 4.5 Framework is causing - The type initializer for 'System.Data.SqlClient.SqlPerformanceCounters' threw an exception. ------>[Win32Exception] The parameter is incorrect. RRS feed

  • Question

  • After installing .NET 4.5 Framework, I am unable to install one of our proprietary applications. I receive the error below during the install. When I uninstall .NET 4.5 Framework and install .NET Framework 4.0, I do not receive this error.

    Login failed for user 'sa': [TypeInitializationException] The type initializer for 'System.Data.SqlClient.SqlConnection' threw an exception.
    -->[TypeInitializationException] The type initializer for 'System.Data.SqlClient.SqlConnectionFactory' threw an exception.
    ---->[TypeInitializationException] The type initializer for 'System.Data.SqlClient.SqlPerformanceCounters' threw an exception.
    ------>[Win32Exception] The parameter is incorrect
    Thursday, August 29, 2013 2:10 AM

Answers

  • I opened a support ticket with Microsoft through my MSDN subscription.  After working with 3 different support teams, the resolution eluded us. However, I downloaded and installed Microsoft Visual Studio 2013 along with the .NET Framework 4.5.1 and the issue no longer occurs so this was my resolution.
    • Marked as answer by derekcoder Thursday, October 31, 2013 12:05 AM
    Thursday, October 31, 2013 12:05 AM

All replies

  • Hi derekcoder,

    Welcome to the MSDN forum.

    Does that application programmed yourself? If so, do you know your target framework version?

    This issue when programming seems due to configuration problem but it seems different from your issue.

    I have checked this report https://connect.microsoft.com/VisualStudio/feedback/details/793500/sqlclr-typeinitializationexception-in-sqlconnection-since-kb2840628 and find that this issue may related to a .NET Framework update, could you please help me to check if you have installed it?

    If you have, please follow the report there for further details and try temporarily disable this update like mentioned on this thread:

    http://social.technet.microsoft.com/Forums/sqlserver/en-US/67677199-1a30-4df9-a8e7-9ab6944e3f84/systemtypeinitializationexception-in-ctor-of-systemdatasqlclientsqlconnection-in

    If you haven't installed that update, please submit a new report on this site:

    https://connect.microsoft.com/VisualStudio/feedback/CreateFeedbackForm.aspx?FeedbackFormConfigurationID=5303&FeedbackType=1

    Your step to reproduce this problem is not the same like metioned on the last report. By the way, if you have done this, please send your link back.

    Regards,


    Barry Wang
    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.


    Friday, August 30, 2013 2:51 AM
    Moderator
  • Yes, this is a proprietary application. The target framework is Microsoft .NET 4.0.

    It is not a configuration problem. The msi launches a custom application that performs the database checks and updates. This application runs perfectly except when the msi installer launches it. We can manually launch it from the installation directory and it completes without error.

    I currently have .NET 4.5 Framework installed.  When I uninstall .NET 4.5 Framework and install only .NET 4.0 Framework, the error does not occur. When I install .NET 4.5 without any patches/updates the error returns. When I apply all .NET 4.5 patches/updates, the error is still present.

    I have opened a support ticket with Microsoft under my MSDN subscription and so far I have worked with 3 different groups but have not resolved this issue. The last status is that I used DebugDiag to take a memory dump and uploaded it for analysis.

    Tuesday, September 17, 2013 8:56 PM
  • @derekcoder

    Sorry for the late track. Saw your case just today. Have you also tried to report this issue on Connect? What is that "I have worked with 3 different groups "?

    Regards,


    Barry Wang
    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Tuesday, September 24, 2013 11:14 AM
    Moderator
  • I opened a support ticket with Microsoft through my MSDN subscription.  After working with 3 different support teams, the resolution eluded us. However, I downloaded and installed Microsoft Visual Studio 2013 along with the .NET Framework 4.5.1 and the issue no longer occurs so this was my resolution.
    • Marked as answer by derekcoder Thursday, October 31, 2013 12:05 AM
    Thursday, October 31, 2013 12:05 AM