.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

System.MethodAccess Exception in ASP.NET 4.0 after moving from 32-bit to 64-bit?

Posted By:      Posted Date: May 22, 2011    Points: 0   Category :WPF

I have an ASP.NET application that worked fine on ASP.NET 4.0 on a 32-bit system, but when moved over to a 64-bit system (both Windows 7), the applicaiton fails with a MethodAccess Exception attempting to initialize a Dictionary<string, CustomClass>.

Attempt by method 'ASP.global_asax.Intialize()' to access method 'System.Collections.Generic.Dictionary`2<System.__Canon,System.__Canon>..ctor()' failed. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.MethodAccessException: Attempt by method 'ASP.global_asax.Intialize()' to access method 'System.Collections.Generic.Dictionary`2<System.__Canon,System.__Canon>..ctor()' failed.

Source Error: 

Line 46:     //string[] controllerslist = { "NetApp-Sim1", "NetApp-Sim2" }; //
Line 47:     //string[]            controllerslist = { "NetApp1" }; 
Line 48:     Dictionary<string, NAS_Server> NAS_Lookup =     new Dictionary<string, NAS_Server>();
Line 49:     List<NAS_Server>        NAS_List = new List

View Complete Post

More Related Resource Links

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


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


Problems moving an InfoPath form from a DEV system to QA environment


We developed an InfoPath form using a local DEV environment.  The site collection under which the form was developed was http://server1/.

We are now attempting to deploy this form to a TEST environment that uses a slightly different structure for the collection, namely http://server2/sites/sitecol1.

In both cases the site that contains the form is /fin (so we were using http://server1/fin in DEV and want to use http://server2/sites/sitecol1/fin in TEST). 

The form contains VBA code and so requires admin-based deployment via Central Administration, so to deploy to TEST we:

1. Publish the form against the TEST server using InfoPath Designer

2. Upload the form using Central Administration > Application Managment > Manage Form Templates

3. After upload, we activate the form for the site collection http://server2/sites/sitecol1/

4. The form is then associated with a Form Library

When we try to create an instance of the form within this library we get the following error when we click on New to create the form instance:

The following location is not accessible, because it is in a differ

'System OutOfMemory Exception' while using rdlc in Windows application

hi Everyone , I am Using Reporting Service (.rdlc) in my Windows application , i am getting Error System OutOfMemory Exception Like "an error occured during local report processing An Unexpected error occured in Report Processing Exception of type 'System OutOfMemory Exception'Was Thrown " what to do Please anyone help me ... Advance Thanks Anilmarnal

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????

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

SSRS 2008 Export to PDF fails for large data with System.Exception: Parameter is not valid

Hi, We are working on Range Bar Chart using SSRS 2008. The report has huge data. It is properly displaying the data, but when we tried to export to pdf it is failing with the following exception. Exporting to excel works fine. Also if the report has small/medium data it is property exporting to PDF. It is failing only in case of huge data (we have custom page size of 28" X 14"). Of course the report has lot of expressions we used to customize the colors/text as per our requirements.   Server Error in '/Reports_SQLDEV2008' Application. Parameter is not valid. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Exception: Parameter is not valid. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace:   [Exception: Parameter is not valid.]   [Exception: An error occurred during rendering of the report.]   [Exception: An error occurred during rendering of the report.]    Microsoft.Reporting.WebForms.ServerReport.ServerUrlRequest(Boolean isAbortable, String url, Stream ou

need help moving System Center SQL Databases to new SQL Server about30 databases to be moved...

We are running various System Center products, SCSM, SCVMM, SCCM, DPM, OPALIS. and a few other servers all using the same SQL server, which currently is a VM. We have configured and built a new Physical box that will replace this. In the past we have moved SQL databases by doing a full backup and then restoring the backup on the new server, then renaming the servers, both network name and internal sql name.  This has worked fine in the past. However I've never had to move 30 databases before, nor have I had to move reporting services. Is there a better method. a recomended method? 

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!!!!!!!!!  

System.DirectoryServices.AccountManagement: FileNotFound exception while creating PrincipalContext o

Hi, I want to create a local group for my Netapp server. And also add a domain user under this group. Using .NET namepaces System.DirectoryServices.AccountManagement, I can achive this for Windows server. But if the same code is tried on NetApp, following exception is thrown: Unhandled Exception: System.IO.FileNotFoundException: The system cannot find the file specified. (Exception from HRESULT: 0x80070002)   at System.DirectoryServices.Interop.UnsafeNativeMethods.IAds.GetInfo()   at System.DirectoryServices.DirectoryEntry.RefreshCache()   at System.DirectoryServices.AccountManagement.PrincipalContext.DoMachineInit()   at System.DirectoryServices.AccountManagement.PrincipalContext.Initialize()   at System.DirectoryServices.AccountManagement.PrincipalContext.get_QueryCtx()    at System.DirectoryServices.AccountManagement.Principal.FindByIdentityWithTypeHelper(PrincipalContext context, Type principalType, Nullable`1 identityType, String identityValue, DateTime refDate)   at System.DirectoryServices.AccountManagement.Principal.FindByIdentityWithType(PrincipalContext context, Type principalType, String identityValue)   at System.DirectoryServices.AccountManagement.GroupPrincipal.FindByIdentity(PrincipalContext context, String identityValue)   at AddGroup.Program.Main(String[] args) Does S

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

Exception in System.Diagnostics.EventLog.get_EntryCount()

Hello,I am having an really weird exception which seems to originate in the BCL since the call stack does not show any of my code.Application is an event log processing service which uses the EntryWritten event of the System.Diagnostics.Eventlog class.The exceptions call stack is as follows:[System]System.ComponentModel.Win32ExceptionInterface unknownat System.Diagnostics.EventLogget_EntryCount()at System.Diagnostics.EventLogCompletionCallback(Object context)at System.Diagnostics.EventLogStaticCompletionCallback(Object context, Boolean wasSignaled)at System.Threading._ThreadPoolWaitOrTimerCallbackWaitOrTimerCallback_Context(Object state, Boolean timedOut)at System.Threading._ThreadPoolWaitOrTimerCallbackWaitOrTimerCallback_Context_f(Object state)at System.Threading.ExecutionContextRun(ExecutionContext executionContext, ContextCallback callback, Object state)at System.Threading._ThreadPoolWaitOrTimerCallbackPerformWaitOrTimerCallback(Object state, Boolean timedOut)Thats it. No sign of my own code. Yet, this happens like once or twice a day only, and ONLY on a Windows Vista SP1 installation. Anybody has any ideas whats that where it comes from, etc?CheersAndreas

file size increase when moving from file system to sharepoint 2007

Hi, While moving files from file system to Sharepoint 2007 via windows explorer view, why do file sizes increase? thanks, Burcu  

System.Net.WebException:an Exception occurred during a Webclient request.

Hi, I have a winforms application where in i want to access the application folder. I am workign on a vista pc. When i try to access the folder, i am getting he folllowing error: System.Net.WebException:an Exception occurred during a Webclient request. ---->System.UnauthorizedaccessException:Accessto the path "C:\ProgramFiles\...\setup.exe" is denied. How can i change this? Is there anyway i can give permissions from within the code? Or is there any other way to resolve this issue? Thanks

'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.

Weird Exception: Method not found: 'Double System.Windows.Controls.ScrollViewer.get_ContentHorizon

Hi guys I have an XBAP application that uses a Xamdatagrid from Infragistics. I have some filtering on this grid, that rebinds after a filter. The problem is, when a user has scrolled to a certain point and then filters, the rebinding causes the grid to scroll to the beginning position of the grid. Now how I solve this is by getting an instance of the ScrollViewer, I get the ScrollViewer.ContentHorizontalOffset and then I do a ScrollViewer.ScrollToHorizontalOffset after it filters.   Now here comes the problem. For 99% of the users of this xbap app, this will work absolutely fine. Most, if not all of the users run exactly the same machines, XP 64 bit with 8GB RAM. The other 1% get the error: Method not found: 'Double System.Windows.Controls.ScrollViewer.get_ContentHorizontalOffset()'. I cannot reproduce this error on my own box, our dev server or our production server, it is a phantom exception that only pops up on a certain condition. I have even wrapped the "offending" code in a try catch and it still doesn't solve it. If I set the DispatcherUnhandledExceptionArgs Handled to true, it works, but it doesn't feel right. How is this possible? If the method doesn't exist, how can it compile? Why does that method exist for 99% of the other users running the exact same machines? I have googled my fingers raw without any valid results and this issue is frustrat
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