.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Moving from .NET 3.5 to 4.0: A first chance exception of type 'System.AccessViolationException' oc

Posted By:      Posted Date: May 22, 2011    Points: 0   Category :ASP.Net

I'm trying to upgrade my web app from 3.5 to the 4.0 Framework but keep seeing this error when trying to build the solution. The problem is with some code that's in my App_Code directory (that runs on Application_Start), and the error tells me that the class in the App_Code directory is pointing to an older version of the Oracle.DataAccess.Dll... however using Process Explorer I can't see any references to the older DataAccess DLL after updating all references to the newer Oracle DLL

Is there some way to assure the code in my App_Code directory is using the newer version of Oracle.DataAccess? Any suggestions are welcomed. Thanks


View Complete Post

More Related Resource Links

A first chance exception of type 'System.ArgumentException' occurred in System.Windows.Forms.dll

I've read a bit about this error and maybe I have nothing to worry about.  BUT ... my simple little app gets 7 of these before it even gets to the first Dim statement in the Class Form1!  I found and followed instructions on how to have the Debugger intercept these exceptions but it seems that they are not being intercepted.  I only know that they have happened because of the messages in the Immediate Window.  In the Designer all I have is 5 Labels and 5 TextBoxes.   Any thoughts on how I could get to the cause of these messages? Thanks,  Bob

A first chance exception of type 'System.Runtime.InteropServices.COMException'


After calling a very simple WCF Service I bind the result an Observable Collection of Countries to WPF ComboBox, in second ComboBox of cities I displayed the filtered cities based on the selected country. It works fine the first time but when I select another country it takes lots of time to display, the Visual Studio 2010 output displays this like 50 times:

A first chance exception of type 'System.Runtime.InteropServices.COMException' occurred in mscorlib.dll

Intereting to point out that it only happens if I try to open the ComboBox and not if if navigate through code doing something like SelectedIndex=2 . It does not happen as well if instead of the ComboBox I use a ListBox or TreeView.

Some extra details.... the real exception detail is:

An event was unable to invoke any of the subscribers (Exception from HRESULT: 0x80040201)

Please help with this bug....

An unhandled exception of type 'System.Net.Sockets.SocketException' occurred in system.dll

Additional information: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respondThis error occurs when i was executing a vc++.net program implementing ICMP....Error occurs when executing this statement... iRet=st->ReceiveFrom(RecvByte,RecvByte->Length,SocketFlags::None,&senderRemote);How to solve this problem????

The type initializer for 'System.Data.SqlClient.SqlConnection' threw an exception.

 Hi all,When i run my project on my own computer, it works fine. But when i deploy it to server, it gives me this error. I can run my other dts and sp, but i get this error on this.. The type initializer for 'System.Data.SqlClient.SqlConnection' threw an exception. I googled it but could not find a solution. How can i solve this problem? 

the type initializer for 'system.runtime.remoting.identity' threw an exception.

HI, I am trying to implement kerberos delegation in Active Directory enviroment with windows 2003 servers SP2. I have Client, ProxyServer and RemoteServer application that are developed on .Net framework v3.5 using .Net Remoting "System.Runtime.Remoting". I am not using Microsoft.Samples.Security.SSPI &  Microsoft.Samples.Runtime.Remoting.Security directly. my code is based on "http://blogs.msdn.com/dotnetremoting/archive/2006/07/06/662599.aspx" Only change that I have done is put impersonate="true" in channel configuration of ProxyServer and RemoteServer, and of course changed the UPN and Port and IP address. The Client's credentials are successfully impersonated by ProxyServer, I can access the text file on ProxyServer on behalf of client. But when from ProxyServer I try to execute the method on RemoteServer it throws "the type initializer for 'system.runtime.remoting.identity' threw an exception." After looking at blog http://www.secnewsgroups.net/group/microsoft.public.dotnet.security/topic8251.aspx I did required changing under Local Security Settings -> Local Policies -> User Rights Assignments -> impersonate a client after authentication and Create Global Objects. I have added three domain user names in three machine under whose credentials corrosponding application is running. When i run three applications on their

Exception of type 'System.ExecutionEngineException' was thrown.

Hi,       I am showing a WPF Window as ShowDialog().  Before loading the window, we are showing a message box. Upon Pressing Cancel Button from the Message box, Application throws "Exception of type 'System.ExecutionEngineException' was thrown.".. While cancelling, Events are raised to close the Window.. If we comment that code, window will be in the open state, other wise will "Throw the error". Please help me!!!!!!!!!  

Exception of type 'System.ServiceModel.FaultException`1' occurred in WCF library

Hi, While Throwing Custom Fault Exception, am getting the warning message as An exception of type 'System.ServiceModel.FaultException`1' occurred in IAuthentication.DLL but was not handled in user code But Fault Exception handled in Client Side Please let me know, How Can I suppress this warning? Regards, Ganesh

'schema.AllCategories' threw an exception of type 'System.UnauthorizedAccessException

We're porting a solution from 2007 to 2010 and we're having trouble accessing the CrawledProperties property from the Schema object. Other properties from the Schema object however are accessible (e.g. AllManagedProperties). It does not matter whether we use the obsolete SearchContext to create the Schema object, or the new SearchServiceApplication (Example code from Steve Curran here: http://social.technet.microsoft.com/Forums/en-US/sharepoint2010programming/thread/2550e6e8-34a6-4012-969f-9657dc526d74) Now what's interesting is that the SAME user (Farm administrator) can access the AllCategories using a Windows Forms application, but when using a SharePoint solution (Codebehind on an application page) it doesn't work. We have double-checked that the executing user is the same. The same user can also browse the CrawledProperties using the Central Admin UI. We're experiencing this on several server installations, one of which is the "Standalone" installation of Search Server Express 2010, whereas the same user was used to perform the installation. I'd appreciate any ideas you might have.

An unhandled exception of type 'System.Net.WebException' occurred in system.dll Additional inform

Hi , I am giving my functioon below. I am getting the error when  executing  "       streamInput = HTTPWebRequest.GetRequestStream                "   error is  An unhandled exception of type 'System.Net.WebException' occurred in system.dll  Additional information: The underlying connection was closed: Could not establish secure channel for SSL/TLS.  Sorry for my bad english  Private Function GetXMLMarkIntnlResponse(ByVal strRequest As String) As String         Dim HTTPWebRequest As HttpWebRequest         Dim HTTPWebResponse As HttpWebResponse         Dim Encoding As System.Text.UTF8Encoding         Dim byte1 As Byte()         Dim streamInput, streamOutPut As Stream         Dim strmReader As StreamReader         Dim strURL As String = "https://beta.triseptapi.com/9.0/vax.asmx"         HTTPWebRequest = CType(WebRequest.Create(strURL), HttpWebRequest)         HTTPWebRequest.Method = "Post"         HTTPWebRequest.ProtocolVersion = HttpVersion.Version11         HTTPWebRequest.C

Exception of type 'System.OutOfMemoryException' was thrown.

Hi, i am just using select stmt from some view. view defination is also selecting columns from inner join of 3 tables. view count is about 46 millions records. so while selecting from view it gives me: Exception of type 'System.OutOfMemoryException' was thrown. same error occur if i use direct select from those tables instead of select * from view. What is the reason behind this. Any help will be appreciated. Thanks Punia

need help about Exception of type 'System.Web.HttpUnhandledException' was thrown.

Hi Friends

I am developing a website in which i am using services of a third party service providers. after some transactions on their pages they are transfering control to my page say page1.aspx. 

But when the control is transfered to my page there is an exception /Runtime error..

I am unable to trace this error. I had tried to log all the errors. Where I found this error.

3/19/2010 3:34:44 AM
Offending URL: http://www.mydomain.com/ThankYou.aspx Source: System.Web Message: Exception of type 'System.Web.HttpUnhandledException' was thrown. Stack trace: at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at ASP.thankyou_aspx.ProcessRequest(HttpContext context) in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\5910a9b6\ab96f081\App_Web_upsitg7y.0.cs:line 0
at System.Web.HttpApplication.CallHandlerEx

System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.


I get the following error anytime i change something in the XAML and try and build the project. If I change anything in the code behind it works everytime.... To get it to work i have to get out of the ide come back in place a space in one of the .vb files to change it then it will build..... Any ideas?


Error 107 The "ResourcesGenerator" task failed unexpectedly.
System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
   at System.IO.MemoryStream.set_Capacity(Int32 value)
   at System.IO.MemoryStream.EnsureCapacity(Int32 value)
   at System.IO.MemoryStream.Write(Byte[] buffer, Int32 offset, Int32 count)
   at System.IO.BinaryWriter.Write(Byte[] buffer, Int32 index, Int32 count)
   at System.Resources.ResourceWriter.WriteValue(ResourceTypeCode typeCode, Object value, BinaryWriter writer, IFormatter objFormatter)
   at System.Resources.ResourceWriter.Generate()
   at System.Resources.ResourceWriter.Dispose(Boolean disposing)
   at Microsoft.Build.Tasks.Windows.ResourcesGenerator.Execute()
   at Microsoft.Build.BuildEngine.TaskEngine.ExecuteInstantiatedTask(EngineProxy engineProxy, ItemBucket bucket, TaskExecutionMode howToExecuteTask, ITask task, Boolean& taskResult) 

Error 1259 The type initializer for 'System.Web.Compilation.CompilationLock' threw an exception.


In my asp.net application i  have getting an error

Error 1259 The type initializer for 'System.Web.Compilation.CompilationLock' threw an exception.  
 How to solve this one

I configured this application in iis.

As per the many forum result . i changed the framworkwortion in asp.net  tab of iis proprty.

So kindly give a good solution for it



@ Page AutoEventWireup="false" CodeFile="IDNotification.aspx.vb" Inherits="IDNotification" Language

An exception of type 'System.Data.SqlClient.SqlException' occurred and was caught


When the Stored procedure is executed through SQL Server Management Studio, its taking 23 seconds

When the same Stored proc is called through web app, its throwing below copied exception. It is noticed that when the data is more than 100k records this exception is thrown other wise expected records are shown in UI. Another stored proc from the same app returns over 150k records without any excetpion.

Can't conclude that the exception is in Stored proc, because it works from SQL Server Management studio, but throws below exception from Web app.

Your help is appreciated in resolving this issue.

An exception of type 'System.Data.SqlClient.SqlException' occurred and was caught.
10/17/2010 16:56:01
Type : System.Data.SqlClient.SqlException, System.Data, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089 Message : Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
Source : .Net SqlClient Data Provider
Help link : 
Errors : System.Data.SqlClient.SqlErrorCollection
Class : 11
LineNumber : 0
Number : -2
Procedure : 
Server : XXXXX
State : 0
ErrorCode : -2146232060
Data : System.Collection

An unhandled exception of type 'System.StackOverflowException' occurred in WindowsBase.dll


i have .net 4.0 application in wpf . application is running fine but when i close the application by using exit button. it throws the exception after stopping the debugging. the exception is  "An unhandled exception of type 'System.StackOverflowException' occurred in WindowsBase.dll ".

the code in exit button is


 private void btnExit_Click(object sender, RoutedEventArgs e)


don't know from where it throws the exception and why ??

ServerVersion = 'Conn.ServerVersion' threw an exception of type 'System.InvalidOperationException



I have a web service  which tries to connect to the SQL server.

It uses Integrated security = true.

I get the Conn.ServerVersion threw an exception of  type System.InvalidOperationException as soon as the connection object is instatiated.

Any leads.


Getting Exception of type 'System.OutOfMemoryException' frequently



My web application is in Classic ASP and in that we had developed few modules in ASP.Net 2.0.

Initially all modules were working fine but as we goes on developing new modules in ASP.Net 2.0 we are getting this error very frequently - Exception of type 'System.OutOfMemoryException'.

Stack Trace: 
[OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.]
   System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +0
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend