Solved

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

Posted on 2016-11-14
5
23 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
  • 3
  • 2
5 Comments
 
LVL 49

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 49

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

Superior storage. Superior surveillance.

WD Purple drives are built for 24/7, always-on, high-definition security systems. With support for up to 8 hard drives and 32 cameras, WD Purple drives are optimized for surveillance.

Question has a verified solution.

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

If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties

867 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now