Solved

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

Posted on 2016-11-14
5
18 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

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.
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

708 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

16 Experts available now in Live!

Get 1:1 Help Now