Value cannot be null. Error on opening webpage in .net - asp.net

I have a web application that runs fine on a local dev server(the one that comes with ,net) but when uploaded to iis8 it comes up with a null exception. Not sure where to start.
The app is runing version 4 of the framework.
Value cannot be null.
Parameter name: type
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.ArgumentNullException: Value cannot be null.
Parameter name: type
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:
[ArgumentNullException: Value cannot be null.
Parameter name: type]
System.Activator.CreateInstance(Type type, Boolean nonPublic) +10703382
System.Activator.CreateInstance(Type type) +6
System.Web.Profile.ProfileBase.CreateMyInstance(String username, Boolean isAuthenticated) +77
System.Web.Profile.ProfileBase.Create(String username, Boolean isAuthenticated) +256
System.Web.HttpContext.get_Profile() +113
MB.ASTechnology.UI.BasePage.InitializeCulture() +36
ASP.default_aspx.__BuildControlTree(default_aspx __ctrl) +91
ASP.default_aspx.FrameworkInitialize() +44
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +48
System.Web.UI.Page.ProcessRequest() +72
System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +21
System.Web.UI.Page.ProcessRequest(HttpContext context) +58
ASP.default_aspx.ProcessRequest(HttpContext context) +4
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +341
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69

Related

Web App running on local but after deployment on azure is giving error

I have a web app in which I am reading some data from Microsoft Excel. It is working fine on my desktop but when I am deploying it on Azure it is giving me below error when I visit that page. I am using Microsoft Office Interop Excel as a reference in my app. If someone can help me in this regard?
Retrieving the COM class factory for component with CLSID
{00024500-0000-0000-C000-000000000046} failed due to the following
error: 80040154 Class not registered (Exception from HRESULT:
0x80040154 (REGDB_E_CLASSNOTREG)). 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.Runtime.InteropServices.COMException:
Retrieving the COM class factory for component with CLSID
{00024500-0000-0000-C000-000000000046} failed due to the following
error: 80040154 Class not registered (Exception from HRESULT:
0x80040154 (REGDB_E_CLASSNOTREG)).
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:
[COMException (0x80040154): Retrieving the COM class factory for
component with CLSID {00024500-0000-0000-C000-000000000046} failed due
to the following error: 80040154 Class not registered (Exception from
HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).]
System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean
publicOnly, Boolean noCheck, Boolean& canBeCached,
RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) +0
System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean
skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +119
System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly,
Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
+247 System.Activator.CreateInstance(Type type, Boolean nonPublic) +83 System.Activator.CreateInstance(Type type) +11 Painting.Painting2.imageRetriever() in D:\Work (D)\Generix\Painting
Web\Visual Studio\Salman Bhai Fixes\Work
7-18-2018\Painting\Painting\Painting2.aspx.cs:24
Painting.Painting2.Page_Load(Object sender, EventArgs e) in D:\Work
(D)\Generix\Painting Web\Visual Studio\Salman Bhai Fixes\Work
7-18-2018\Painting\Painting\Painting2.aspx.cs:17
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender,
EventArgs e) +51 System.Web.UI.Control.OnLoad(EventArgs e) +95
System.Web.UI.Control.LoadRecursive() +59
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
+678

Schema specified is not valid - error in asp.net application after upgrade Oracle database

I have an asp.net web application which uses only SQL Database on Windows SQL Server 2008. When Oracle client was upgraded (I didn't do this), something has changed. I saw that in IIS in "String Connections" appeared additional empty connection - OraAspNetConString and I'm start getting errors on these pages of my app, where should be displayed information from SQL Database.
I don't know where should I start repairing, because I'm not using Oracle database, but errors are connected with this. I don't want to change app code also, because I'm using deploying version. So maybe do you have any ideas?
There is an error below which I'm getting:
Server Error in '/Budzet' Application.
Schema specified is not valid. Errors:
Oracle.DataAccess.src.EntityFramework.Resources.EFOracleStoreSchemaDefinition.ssdl(2,2) : error 0152: No Entity Framework provider found for the ADO.NET provider with invariant name 'Oracle.DataAccess.Client'. Make sure the provider is registered in the 'entityFramework' section of the application config file. See http://go.microsoft.com/fwlink/?LinkId=260882 for more information.
Models.Model_Excel.ssdl(2,49) : error 0172: All SSDL artifacts must target the same provider. The Provider 'Oracle.DataAccess.Client' is different from 'Oracle.DataAccess.Client' that was encountered earlier.
Models.Model_Excel.ssdl(2,82) : error 0169: All SSDL artifacts must target the same provider. The ProviderManifestToken '2008' is different from '9.2' that was encountered earlier.
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.Data.Entity.Core.MetadataException: Schema specified is not valid. Errors:
Oracle.DataAccess.src.EntityFramework.Resources.EFOracleStoreSchemaDefinition.ssdl(2,2) : error 0152: No Entity Framework provider found for the ADO.NET provider with invariant name 'Oracle.DataAccess.Client'. Make sure the provider is registered in the 'entityFramework' section of the application config file. See http://go.microsoft.com/fwlink/?LinkId=260882 for more information.
Models.Model_Excel.ssdl(2,49) : error 0172: All SSDL artifacts must target the same provider. The Provider 'Oracle.DataAccess.Client' is different from 'Oracle.DataAccess.Client' that was encountered earlier.
Models.Model_Excel.ssdl(2,82) : error 0169: All SSDL artifacts must target the same provider. The ProviderManifestToken '2008' is different from '9.2' that was encountered earlier.
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:
[MetadataException: Schema specified is not valid. Errors:
Oracle.DataAccess.src.EntityFramework.Resources.EFOracleStoreSchemaDefinition.ssdl(2,2) : error 0152: No Entity Framework provider found for the ADO.NET provider with invariant name 'Oracle.DataAccess.Client'. Make sure the provider is registered in the 'entityFramework' section of the application config file. See http://go.microsoft.com/fwlink/?LinkId=260882 for more information.
Models.Model_Excel.ssdl(2,49) : error 0172: All SSDL artifacts must target the same provider. The Provider 'Oracle.DataAccess.Client' is different from 'Oracle.DataAccess.Client' that was encountered earlier.
Models.Model_Excel.ssdl(2,82) : error 0169: All SSDL artifacts must target the same provider. The ProviderManifestToken '2008' is different from '9.2' that was encountered earlier.]
System.Data.Entity.Core.Metadata.Edm.Loader.ThrowOnNonWarningErrors() +44
System.Data.Entity.Core.Metadata.Edm.Loader.LoadItems(IEnumerable`1 xmlReaders, IEnumerable`1 sourceFilePaths) +180
System.Data.Entity.Core.Metadata.Edm.Loader..ctor(IEnumerable`1 xmlReaders, IEnumerable`1 sourceFilePaths, Boolean throwOnError, IDbDependencyResolver resolver) +127
System.Data.Entity.Core.Metadata.Edm.StoreItemCollection.Init(IEnumerable`1 xmlReaders, IEnumerable`1 filePaths, Boolean throwOnError, IDbDependencyResolver resolver, DbProviderManifest& providerManifest, DbProviderFactory& providerFactory, String& providerInvariantName, String& providerManifestToken, Memoizer`2& cachedCTypeFunction) +131
System.Data.Entity.Core.Metadata.Edm.StoreItemCollection..ctor(IEnumerable`1 xmlReaders, IEnumerable`1 filePaths) +223
System.Data.Entity.Core.Metadata.Edm.MetadataCache.LoadStoreCollection(EdmItemCollection edmItemCollection, MetadataArtifactLoader loader) +88
System.Data.Entity.Core.Metadata.Edm.<>c__DisplayClass7.<GetMetadataWorkspace>b__1() +14
System.Lazy`1.CreateValue() +415
System.Lazy`1.LazyInitValue() +152
System.Lazy`1.get_Value() +75
System.Data.Entity.Core.Metadata.Edm.<>c__DisplayClass7.<GetMetadataWorkspace>b__4() +9
System.Data.Entity.Core.Metadata.Edm.MetadataWorkspace.LoadAndCheckItemCollection(Func`1 itemCollectionLoader) +16
System.Data.Entity.Core.Metadata.Edm.<>c__DisplayClass16.<.ctor>b__f() +21
System.Lazy`1.CreateValue() +415
System.Lazy`1.LazyInitValue() +152
System.Lazy`1.get_Value() +75
System.Data.Entity.Core.Metadata.Edm.MetadataWorkspace.GetItemCollection(DataSpace dataSpace, Boolean required) +92
System.Data.Entity.Core.Metadata.Edm.MetadataWorkspace.GetItemCollection(DataSpace dataSpace) +12
System.Data.Entity.Core.Objects.ObjectContext.InitializeMappingViewCacheFactory(DbContext owner) +46
System.Data.Entity.Core.Objects.ObjectContext..ctor(EntityConnection connection, Boolean isConnectionConstructor, ObjectQueryExecutionPlanFactory objectQueryExecutionPlanFactory, Translator translator, ColumnMapFactory columnMapFactory) +571
System.Data.Entity.Internal.InternalConnection.CreateObjectContextFromConnectionModel() +65
System.Data.Entity.Internal.LazyInternalConnection.CreateObjectContextFromConnectionModel() +20
System.Data.Entity.Internal.LazyInternalContext.InitializeContext() +465
System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType) +18
System.Data.Entity.Internal.Linq.InternalSet`1.Initialize() +53
System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext() +15
System.Data.Entity.Infrastructure.DbQuery`1.System.Linq.IQueryable.get_Provider() +38
System.Linq.Queryable.FirstOrDefault(IQueryable`1 source) +49
Budzet.Controllers.HomeController.Contact() +127
lambda_method(Closure , ControllerBase , Object[] ) +62
System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +14
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +182
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +27
System.Web.Mvc.Async.<>c__DisplayClass42.<BeginInvokeSynchronousActionMethod>b__41() +28
System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) +10
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +50
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +49
System.Web.Mvc.Async.<>c__DisplayClass39.<BeginInvokeActionMethodWithFilters>b__33() +58
System.Web.Mvc.Async.<>c__DisplayClass4f.<InvokeActionMethodFilterAsynchronously>b__49() +225
System.Web.Mvc.Async.<>c__DisplayClass37.<BeginInvokeActionMethodWithFilters>b__36(IAsyncResult asyncResult) +10
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +50
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) +49
System.Web.Mvc.Async.<>c__DisplayClass2a.<BeginInvokeAction>b__20() +24
System.Web.Mvc.Async.<>c__DisplayClass25.<BeginInvokeAction>b__22(IAsyncResult asyncResult) +99
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +50
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +44
System.Web.Mvc.<>c__DisplayClass1d.<BeginExecuteCore>b__18(IAsyncResult asyncResult) +14
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +23
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +55
System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +41
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +23
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +55
System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +31
System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +10
System.Web.Mvc.<>c__DisplayClass8.<BeginProcessRequest>b__3(IAsyncResult asyncResult) +25
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +23
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +55
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +31
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9657896
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34237

No parameterless constructor defined for this object for home controller

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.MissingMethodException: No parameterless constructor defined for this object.
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:
[MissingMethodException: No parameterless constructor defined for this object.]
System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) +0
System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +159
System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +256
System.Activator.CreateInstance(Type type, Boolean nonPublic) +127
System.Activator.CreateInstance(Type type) +11
System.Web.Mvc.DefaultControllerActivator.Create(RequestContext requestContext, Type controllerType) +92
[InvalidOperationException: An error occurred when trying to create a controller of type 'Web.Controllers.HomeController'. Make sure that the controller has a parameterless public constructor.]
System.Web.Mvc.DefaultControllerActivator.Create(RequestContext requestContext, Type controllerType) +256
System.Web.Mvc.DefaultControllerFactory.CreateController(RequestContext requestContext, String controllerName) +81
Castle.Proxies.Invocations.IControllerFactory_CreateController.InvokeMethodOnTarget() +155
Castle.DynamicProxy.AbstractInvocation.Proceed() +116
Glimpse.Core.Extensibility.AlternateMethod.NewImplementation(IAlternateMethodContext context) +71
Castle.DynamicProxy.AbstractInvocation.Proceed() +604
Castle.Proxies.IControllerFactoryProxy.CreateController(RequestContext requestContext, String controllerName) +193
System.Web.Mvc.MvcHandler.ProcessRequestInit(HttpContextBase httpContext, IController& controller, IControllerFactory& factory) +270
System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state) +86
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +12639055
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +288
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18447
Add the following parameterless constructor to your controller:
public HomeController()
{
//...
}
Internally, the MVC engine (DefaultControllerActivator) is looking for such a constructor in order to instantiate your controller.

ASP.NET MS11-100: how can I change the limit on the maximum number of posted form values? value="10000000000" not working

I am getting this error message.
Server Error in '/' Application.
Operation is not valid due to the current state of the object.
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.InvalidOperationException: Operation is not valid due to the current state of the object.
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:
[InvalidOperationException: Operation is not valid due to the current state of the object.]
System.Web.HttpValueCollection.ThrowIfMaxHttpCollectionKeysExceeded() +2420322
System.Web.HttpValueCollection.FillFromEncodedBytes(Byte[] bytes, Encoding encoding) +58
System.Web.HttpRequest.FillInFormCollection() +159
[HttpException (0x80004005): The URL-encoded form data is not valid.]
System.Web.HttpRequest.FillInFormCollection() +217
System.Web.HttpRequest.get_Form() +104
Microsoft.Web.Infrastructure.DynamicValidationHelper.<>c__DisplayClass8.<MakeCollectionsLazy>b__2() +12
Microsoft.Web.Infrastructure.DynamicValidationHelper.<>c__DisplayClass12.<ReplaceCollection>b__e() +61
Microsoft.Web.Infrastructure.DynamicValidationHelper.<>c__DisplayClass12.<ReplaceCollection>b__11() +17
Microsoft.Web.Infrastructure.DynamicValidationHelper.DeferredCountArrayList.get_Count() +17
System.Collections.Specialized.NameObjectCollectionBase.get_Count() +15
System.Web.HttpRequest.ValidateNameValueCollection(NameValueCollection nvc, RequestValidationSource requestCollection) +23
System.Web.HttpRequest.get_Form() +150
System.Web.HttpRequestWrapper.get_Form() +11
System.Web.Mvc.HttpRequestExtensions.GetHttpMethodOverride(HttpRequestBase request) +126
System.Web.Mvc.AcceptVerbsAttribute.IsValidForRequest(ControllerContext controllerContext, MethodInfo methodInfo) +41
System.Web.Mvc.HttpGetAttribute.IsValidForRequest(ControllerContext controllerContext, MethodInfo methodInfo) +40
System.Web.Mvc.<>c__DisplayClass11.<RunSelectionFilters>b__d(ActionMethodSelectorAttribute attr) +24
System.Linq.Enumerable.All(IEnumerable`1 source, Func`2 predicate) +145
System.Web.Mvc.ActionMethodSelector.RunSelectionFilters(ControllerContext controllerContext, List`1 methodInfos) +319
System.Web.Mvc.ActionMethodSelector.FindActionMethod(ControllerContext controllerContext, String actionName) +59
System.Web.Mvc.ReflectedControllerDescriptor.FindAction(ControllerContext controllerContext, String actionName) +62
System.Web.Mvc.ControllerActionInvoker.FindAction(ControllerContext controllerContext, ControllerDescriptor controllerDescriptor, String actionName) +16
System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +105
System.Web.Mvc.Controller.ExecuteCore() +116
System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +97
System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +10
System.Web.Mvc.<>c__DisplayClassb.<BeginProcessRequest>b__5() +37
System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +21
System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) +12
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
System.Web.Mvc.<>c__DisplayClasse.<EndProcessRequest>b__d() +50
System.Web.Mvc.SecurityUtil.<GetCallInAppTrustThunk>b__0(Action f) +7
System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Action action) +22
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +60
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +8969201
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +184
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272
I have tried doing the suggested fix off
<appSettings>
<add key="aspnet:MaxHttpCollectionKeys" value="1001" />
</appSettings>
I tried putting it at some crazy number
<add key="aspnet:MaxHttpCollectionKeys" value="10000000000" />
yet it still gives me the same error (I have alot of fields but not that many). I am using asp.net mvc 3 (razor). I am using .net 4.0.
I am sending the whole form by jquery ajax(seralizeArrary) so I don't know if that has something to do with it or not.
Use a more reasonable value such as 32000, that works fine for me.
Is there a way also to limit it to which forms this is allowed on and not global as it seems to be right now?
No, I don't think that is is possible to handle this setting per form. This is because the values are parsed very eary before the routing takes place, but only after routing it would be known what "form" this belongs to.
Following are the limits:
MaxHttpCollectionKeys is an int, so it could have a max value of an integer (int.MaxValue: 2,147,483,647)
Minimum value is 1
Default value is 1000
Check on MSDN

ASP MVC2 deploying to IIS 7 with error

after I deployed the application to IIS7 server, it seems fine at the beginning and can display the login page. But after the user inputted the username and password, I have to authenticate the user with the DB connection. At this time, it display error (attached). I guess the error is caused by the reflection during the EntityFramwork load the DB data.
My server has been installed .net framework 3.5 sp1 already.
On the other hand, I have tried another server. If a server has been installed VS2008 and MVC2 package for VS2008, that server can run the application properly in IIS7.
My aim is to run the application on a IIS7 server with .net framework 3.5 only.
Please help me solve this problem.
The error datails:
Server Error in '/FDDV_demo' Application.
--------------------------------------------------------------------------------
Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
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.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
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:
[ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.]
System.Reflection.Module._GetTypesInternal(StackCrawlMark& stackMark) +0
System.Reflection.Assembly.GetTypes() +111
System.Data.Metadata.Edm.AssemblyCacheEntry.LoadTypesFromAssembly(LoadingContext context) +28
System.Data.Metadata.Edm.AssemblyCacheEntry.InternalLoadAssemblyFromCache(LoadingContext context) +290
System.Data.Metadata.Edm.AssemblyCacheEntry.LoadAssemblyFromCache(Assembly assembly, Boolean loadReferencedAssemblies, Dictionary`2 knownAssemblies, Dictionary`2& typesInLoading, List`1& errors) +137
System.Data.Metadata.Edm.ObjectItemCollection.LoadAssemblyFromCache(ObjectItemCollection objectItemCollection, Assembly assembly, Boolean loadReferencedAssemblies) +284
System.Data.Metadata.Edm.ObjectItemCollection.LoadAssemblyForType(Type type) +33
System.Data.Metadata.Edm.MetadataWorkspace.LoadAssemblyForType(Type type, Assembly callingAssembly) +80
System.Data.Objects.ObjectContext.CreateQuery(String queryString, ObjectParameter[] parameters) +106
FDDV.Models.DBEntities.get_user_master() +113
FDDV.Controllers.HomeController.validateUser(String userid, String password) +254
FDDV.Controllers.HomeController.LogOn(LogOnModel model, String returnUrl) +134
lambda_method(ExecutionScope , ControllerBase , Object[] ) +136
System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +17
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +178
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +24
System.Web.Mvc.<>c__DisplayClassd.<InvokeActionMethodWithFilters>b__a() +53
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +258
System.Web.Mvc.<>c__DisplayClassf.<InvokeActionMethodWithFilters>b__c() +20
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +193
System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +316
System.Web.Mvc.Controller.ExecuteCore() +104
System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +36
System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +7
System.Web.Mvc.<>c__DisplayClass8.<BeginProcessRequest>b__4() +34
System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +21
System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) +12
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +53
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +43
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +7
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +8682542
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.4952; ASP.NET Version:2.0.50727.4955
I finally solved this problem. The main cause is the project missed some assembly references. I add the following code to the login function to find out the reflection type load exception. Once again, thanks everyone 's helpful
try{
//Do your work
}
catch (Exception ex)
{
ReflectionTypeLoadException exception = ex as ReflectionTypeLoadException;
if (exception == null)
System.IO.File.AppendAllText("C:\\TestLog.txt", "Not a ReflectionTypeLoadException ex.");
else
{
foreach (Exception loaderException in exception.LoaderExceptions)
{
System.IO.File.AppendAllText("C:\\TestLog.txt", loaderException.Message);
System.IO.File.AppendAllText("C:\\TestLog.txt", loaderException.StackTrace);
}
}
return true;
}
I faintly recall having a similar issue with MVC 3 when I upgraded a project from MVC 2 and had some version issues in my web.config.
Try enabling fusion assembly log binding and see if you can find maybe what the load is failing on.
http://www.hanselman.com/blog/BackToBasicsUsingFusionLogViewerToDebugObscureLoaderErrors.aspx
I found a script a while back that allowed me to work with fusion log better in IIS (I was having problems where it didn't run in IIS).

Resources