Solved

System.InvalidProgramException: Common Language Runtime detected an invalid program.

Posted on 2016-11-14
5
108 Views
Last Modified: 2016-11-28
Any ideas on where to start to figure out why we are getting this error?

System.InvalidProgramException: Common Language Runtime detected an invalid program.
   at DataManager.Select(String cs, String tsql, Dictionary`2 result)
   at AAIO.Models.AuthenticationMgr.ValidateSession()
0
Comment
Question by:wfcrr
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 52

Expert Comment

by:Ryan Chong
ID: 41887256
check your method DataManager.Select , in which the program should tell in which line it hit the error.

DataManager.Select(String cs, String tsql, Dictionary`2 result)
I'm not too sure why there is a `2 there...
0
 

Author Comment

by:wfcrr
ID: 41891788
That didn't do anything. Are there any other suggestions?
0
 
LVL 52

Expert Comment

by:Ryan Chong
ID: 41892375
are you able to put the break points and Watch in your visual studio for debugging?

Using Breakpoints
https://msdn.microsoft.com/en-us/library/5557y8b4.aspx

Watch and QuickWatch Windows
https://msdn.microsoft.com/en-us/library/0taedcee(v=vs.140).aspx
0
 

Accepted Solution

by:
wfcrr earned 0 total points
ID: 41892702
Found this on Stack Overflow, seems to have fixed us:
For VB .NET projects go to the project properties and under the Compile tab click Advanced Compile Options and un-check "Enable Optimizations".
For C# projects go to the project properties and under the Build tab un-check "Optimize Code".
If you are getting this error during a Release build make sure to change the Configuration under the project properties to "Release" then un-check "Enable Optimizations" or "Optimize Code" depending on the whether you are using C# or VB .NET.
Enable optimizations
By default, this check box is cleared to disable compiler optimizations. Select this check box to enable compiler optimizations. Compiler optimizations make your output file smaller, faster, and more efficient. However, because optimizations cause code rearrangement in the output file, compiler optimizations can make debugging difficult.
-Excerpt taken from Advanced Compiler Settings Dialog Box, MSDN
0
 

Author Closing Comment

by:wfcrr
ID: 41903936
this solved the problem
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question