Server error after updating Jspool - c#

i'm working with React.NET, i recently updated those nugets:
And now i receive this error :
Method not found: 'JavaScriptEngineSwitcher.Core.IJsEngine JSPool.IJsPool.GetEngine(System.Nullable`1<System.TimeSpan>)'.
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: Method not found: 'JavaScriptEngineSwitcher.Core.IJsEngine JSPool.IJsPool.GetEngine(System.Nullable`1<System.TimeSpan>)'.
Stack trace:
[MissingMethodException: Method not found: 'JavaScriptEngineSwitcher.Core.IJsEngine JSPool.IJsPool.GetEngine(System.Nullable`1<System.TimeSpan>)'.]
React.JavaScriptEngineFactory.GetEngine() +0
System.Lazy`1.CreateValue() +741
System.Lazy`1.LazyInitValue() +430
React.ReactEnvironment.EnsureUserScriptsLoaded() +40
React.ReactEnvironment.CreateComponent(String componentName, T props, String containerId, Boolean clientOnly) +43
Google didn't helped much, maby you can.
Thanks.

JavaScriptEnginerSwitch 2.0 is not supported yet: https://github.com/reactjs/React.NET/issues/319
and
https://github.com/reactjs/React.NET/issues/306
You will need to revert back to the previous version of those packages to get things working.

Related

The pre-application start initialization method... Run WebActivatorEx.ActivationManager - Exception has been thrown by the target of an invocation

I keep getting this error, usually after changing the web.config on a running ASP.NET MVC azure web service app. It will run fine the first time but after it recompiles after changing the web.config this is usually appearing. I think it happens sometimes by just starting and stopping the web app. The only way I can make it go away is by publishing the app again from visual studio to azure.
Method not found: 'Microsoft.Practices.Unity.IUnityContainer MyProject.Core.ContainerManager.GetConfiguredContainer()'.
The pre-application start initialization method Run on type WebActivatorEx.ActivationManager threw an exception with the following error message: Exception has been thrown by the target of an invocation
Source File: D:\MyProject-master\src\MyProject.Web\App_Start\UnityMvcActivator.cs Line: 73
StackTrace
MissingMethodException: Method not found:
'Microsoft.Practices.Unity.IUnityContainer
MyProject.Core.ContainerManager.GetConfiguredContainer()'.]
MyProject.Web.App_Start.UnityWebActivator.Start() in D:\MyProject-master\src\MyProject.Web\App_Start\UnityMvcActivator.cs:73
[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +87
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +101
WebActivatorEx.BaseActivationMethodAttribute.InvokeMethod() +73
WebActivatorEx.ActivationManager.RunActivationMethods(Boolean designerMode) +350
WebActivatorEx.ActivationManager.Run() +78
[InvalidOperationException: The pre-application start initialization method Run on type WebActivatorEx.ActivationManager threw an exception with the following error message: Exception has been thrown by the target of an invocation..]
System.Web.Compilation.BuildManager.InvokePreStartInitMethodsCore(ICollection`1 methods, Func`1 setHostingEnvironmentCultures) +615
System.Web.Compilation.BuildManager.InvokePreStartInitMethods(ICollection`1 methods) +141
System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded) +102
System.Web.Compilation.BuildManager.ExecutePreAppStart() +157
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +549
[HttpException (0x80004005): The pre-application start initialization method Run on type WebActivatorEx.ActivationManager threw an exception with the following error message: Exception has been thrown by the target of an invocation..]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +10075124
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +95
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254
This question seems very close to my issue but I haven't gotten this solution to work, there are two projects in my solution that use the RegisterTypes method:
interface and cannot be constructed on Unity config
These questions were related but not exactly this issue:
https://stackoverflow.com/questions/21078380/webactivatorex-dll-unity-bootstrap-is-firing-on-a-different-project
ActivationManager Exception during build process?
Unity Bootstrapper from NuGet is throwing error on App_Start
EDIT: If I merge the application into single assemblies during deployment the issue doesn't seem to happen anymore.
Install-Package Microsoft.AspNet.WebHelpers
For me, this turned out to be a problem where I was trying to inject something null into something that required a value -- didn't actually have anything to do with the error. For instance, I had a configuration setting that was missing, and it was trying to inject that missing setting somewhere. Once I realized which injection was going awry and fixed it, the error went away.

Random NullReferenceException with Redis

I have an intermittent error which shows up in my code. When I debug it using Visual Studio, with break on all exceptions (caught & uncaught) it doesn't break, so I'm not sure what to do.
It looks like it's the session state provider from the stack trace, here is the config:
<sessionState mode="Custom" customProvider="RedisSessionProvider">
<providers>
<add name="RedisSessionProvider" type="Microsoft.Web.Redis.RedisSessionStateProvider" port="6380" host="2asdasdasdasd.redis.cache.windows.net" accessKey="2asdasdasdasd=" ssl="true" />
</providers>
</sessionState>
I installed StackExchange.Redis from NuGet, I'm runnning 1.0.297. I'm unable to reproduce this regularly, I've tried a variety of browsers and operating systems, and it just happens "sometimes".
Here is the stack trace:
Object reference not set to an instance of an 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.NullReferenceException: Object reference not set to an instance of an 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: 
[NullReferenceException: Object reference not set to an instance of an object.]
   Microsoft.Web.Redis.StackExchangeClientConnection.Eval(String script, String[] keyArgs, Object[] valueArgs) +246
   Microsoft.Web.Redis.RedisConnectionWrapper.Set(ISessionStateItemCollection data, Int32 sessionTimeout) +60
   Microsoft.Web.Redis.RedisSessionStateProvider.SetAndReleaseItemExclusive(HttpContext context, String id, SessionStateStoreData item, Object lockId, Boolean newItem) +802
   System.Web.SessionState.SessionStateModule.OnReleaseState(Object source, EventArgs eventArgs) +565
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +136
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69

Upgrade with SQL

I am converting a website over to ASP.NET 2.0, which supports .NET Framework versions 2.0 – 3.5. I am getting the following error message on a particular tab that is connected to a SQL DB. I am stuck at where this change needs to occur as I did not build this particular section of the site. Here is the error message and the Code. Any Help would be greatly appreciated.
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:
[NullReferenceException: Object reference not set to an instance of an object.]
MagicAjax.AjaxCallHelper.GetPageHiddenDictionary(Page page, String fieldName) +37
MagicAjax.AjaxCallHelper.HandleClientScriptBlocks(Page page, Boolean
reflectToClient) +17
MagicAjax.AjaxCallHelper.Page_PreRender(Object sender, EventArgs e) +238
System.Web.UI.Control.OnPreRender(EventArgs e) +8996626
System.Web.UI.Control.PreRenderRecursiveInternal() +103
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean
includeStagesAfterAsyncPoint) +2496

Operation is not valid due to the current state of the object, when I select a dropdown list [duplicate]

This question already has answers here:
'Operation is not valid due to the current state of the object' error during postback
(4 answers)
Closed 8 years ago.
I have radcombo boxes on aspx page, and when I select any option from then it gives error`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()
+2692302 System.Web.HttpValueCollection.FillFromEncodedBytes(Byte[] bytes, Encoding encoding) +61
System.Web.HttpRequest.FillInFormCollection() +148
[HttpException (0x80004005): The URL-encoded form data is not valid.]
System.Web.HttpRequest.FillInFormCollection() +206
System.Web.HttpRequest.get_Form() +68
System.Web.HttpRequest.get_HasForm() +8735447
System.Web.UI.Page.GetCollectionBasedOnMethod(Boolean dontReturnNull)
+97 System.Web.UI.Page.DeterminePostBackMode() +63 System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
+133
Version Information: Microsoft .NET Framework Version:2.0.50727.3634;
ASP.NET Version:2.0.50727.3634 `
From http://codecorner.galanter.net/2012/06/04/solution-for-operation-is-not-valid-due-to-the-current-state-of-the-object-error/
Issue happens because Microsoft Security Update MS11-100 limits number
of keys in Forms collection during HTTP POST request. To alleviate
this problem you need to increase that number.
This can be done in your application Web.Config in the <appSettings>
section (create the section directly under <configuration> if it
doesn’t exist). Add 2 lines similar to the lines below to the
section:
<add key="aspnet:MaxHttpCollectionKeys" value="2000" />
<add key="aspnet:MaxJsonDeserializerMembers" value="2000" />
The above example set the limit to 2000 keys. This will lift the
limitation and the error should go away.
This can happen if you call
.SingleOrDefault()
on an IEnumerable with 2 or more elements.
I know an answer has already been accepted for this problem but someone asked in the comments if there was a solution that could be done outside the web.config. I had a ListView producing the exact same error and setting EnableViewState to false resolved this problem for me.

Custom Error Handler Returns A Different Error Than The Generic Error Handler

My custom error handler returns:
Message: Exception of type 'System.Web.HttpUnhandledException' was thrown.
Source: System.Web
Stack Track: 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.ProcessRequest(HttpContext context) at
ASP.inc_iframe_eventdetail_aspx.ProcessRequest(HttpContext context) in
c:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET
Files\root\c30f285f\68ea8ff1\App_Web_g4uza9zi.4.cs:line 0 at
System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step,
Boolean& completedSynchronously)
Target Site: Boolean HandleError(System.Exception)
However, the generic error handler returns:
Server Error in '/' Application. Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key
constraints. 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.ConstraintException: Failed to enable
constraints. One or more rows contain values violating non-null,
unique, or foreign-key constraints.
Source Error:
Line 44: ChurchEventDataSource.SelectParameters.Add("ChurchEventId",
Request.QueryString["EventId"]); Line 45: Line 46:
EventFormView.DataBind(); Line 47: break; Line 48:
Source File:
c:\Sites\Altruistic\ChurchFinder\Inc\Iframe\EventDetail.aspx.cs Line:
46
Obviously, I want the most detailed description possible.
Where is your custom error handler & how are you retrieving the exception. Most probably you might be using HttpServerUtility.GetLastError method to get the exception - so in such case use InnerException property (if not null) of the actual exception object - it will have the actual exception that has occured.

Categories

Resources