Contact Profilesync.aspx throws "Attempt to load JVM failed on native side" - tridion

Brief Summery : We are using Tridion 2011 SP1 with out any hotfix, and a .net web application as Synchronization server (Profilesync.aspx) to synchronize the contact of subscription db and audience manger db. Also we are using Java 6.
Problem : After completing the installation when we hit the "Profilesync.aspx" page, it gives the error "Attempt to load JVM failed on native side".
Error :
Attempt to load JVM failed on native side
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: Codemesh.JuggerNET.JuggerNETFrameworkException: Attempt to load JVM failed on native side
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:
[JuggerNETFrameworkException: Attempt to load JVM failed on native side]
Codemesh.JuggerNET.JvmLoader.Load(Boolean bAcceptPreloaded) +287
Codemesh.JuggerNET.JvmLoader.Load() +41
Codemesh.JuggerNET.JavaClass.init() +111
Codemesh.JuggerNET.JavaClass.get_JObject() +49
Codemesh.JuggerNET.JavaMethod.init() +1082
Codemesh.JuggerNET.JavaMethod.get_MethodPtr() +54
Codemesh.JuggerNET.JavaMethod.get_Handle() +50
Codemesh.JuggerNET.JavaMethod.CallObject(JavaProxy jpo, JavaMethodArguments args) +390
Com.Tridion.Marketingsolution.Utilities.TcmUri..ctor(Int32 publicationId, Int32 itemId, Int32 itemType) +160
Tridion.OutboundEmail.ContentDelivery.Utilities.Settings.set_ConfigFileName(String value) +51
Tridion.OutboundEmail.ContentDelivery.OutboundEmailPage.Page_Init(Object sender, EventArgs e) +153
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
System.Web.UI.Control.OnInit(EventArgs e) +91
System.Web.UI.Page.OnInit(EventArgs e) +12
System.Web.UI.Control.InitRecursive(Control namingContainer) +140
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +480
Can some one help me to find whats going wrong.
Thanks in advance!!!!

Usually this means that there is a mismatch between 32bits and 64bits files (dll's) in combination with the installed Java version. If you installed the 64bits version of Java, be sure to also use the 64bits version of the SDL Tridion (OutboundEmail) Content Delivery dll's. Same goes for the 32bits version of Java; Use the 32bits version of the SDL Tridion Content Delivery dll's.

If Albert's post doesn't do it for you (although what he says is very correct), have a look at the same issue I had here HTTP Deployer throws "Attempt to load JVM failed on native side".

Just want to leave some notes to help somebody in the future.
If you verified that the proper .dlls were used but yet still encountering the error (Attempt to load JVM failed on native side).
Try uninstall all java run time in the system and re-install it back cleanly (install JRE 64-bit first)
I have seen this has helped resolved an issue for a customer of mine.

Related

Specified Web Pages version "3.0.0.0" could not be found. Update your web.config to specify a different version. Current version: "2.0.0.0"

I found this error after publishing the site on the server.
I tried a lot to solve this problem from my side but nothing works for me.
I have tried to update all those packages with the latest and still does not work for me.
But, it works well when I run a project in Visual Studio without any problems.
I have checked these 2 links to fix my problem but it still doesn't work for me.
Specified Web Pages version “3.0.0.0” could not be found. Update your web.config to specify a different version. Current version: “2.0.0.0”
Update your web.config to specify a different version?
However, I tried to install the downgraded (older) version and I got a 404 error code, the resource could not be found.
Also, I have checked all the web config files where the version has been declared and it seems right for me.
I don't know what I should do with this error message.
It would be nice if someone could help me with this.
Server Error in '/' Application.
Specified Web Pages version "3.0.0.0" could not be found. Update your web.config to specify a different version. Current version: "2.0.0.0".
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: Specified Web Pages version "3.0.0.0" could not be found. Update your web.config to specify a different version. Current version: "2.0.0.0".
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: Specified Web Pages version "3.0.0.0" could not be found. Update your web.config to specify a different version. Current version: "2.0.0.0".]
System.Web.WebPages.Deployment.PreApplicationStartCode.StartCore(IFileSystem fileSystem, String appDomainAppPath, String binDirectory, NameValueCollection appSettings, IEnumerable1 loadedAssemblies, IBuildManager buildManager, Action1 loadWebPages, Action registerForChangeNotification, Func`2 getAssemblyNameThunk) +21268
System.Web.WebPages.Deployment.PreApplicationStartCode.StartCore() +245
[InvalidOperationException: The pre-application start initialization method Start on type System.Web.WebPages.Deployment.PreApplicationStartCode threw an exception with the following error message: Specified Web Pages version "3.0.0.0" could not be found. Update your web.config to specify a different version. Current version: "2.0.0.0"..]
System.Web.Compilation.BuildManager.InvokePreStartInitMethodsCore(ICollection1 methods, Func1 setHostingEnvironmentCultures) +890
System.Web.Compilation.BuildManager.InvokePreStartInitMethods(ICollection`1 methods) +167
System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded) +133
System.Web.Compilation.BuildManager.ExecutePreAppStart() +178
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +746
[HttpException (0x80004005): The pre-application start initialization method Start on type System.Web.WebPages.Deployment.PreApplicationStartCode threw an exception with the following error message: Specified Web Pages version "3.0.0.0" could not be found. Update your web.config to specify a different version. Current version: "2.0.0.0"..]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +552
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +122
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +737
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4261.0

Sitecore 8.0 Update-3 WebEdit Palette.aspx error

I've been searching for the fix of this issue for some time today, but I still got no luck to find the root cause. Maybe someone else encountered the same scenario and able to fix the issue. Thanks in advance.
Okay, basically I already migrated one of my client production SC instance to my local machine for an upgrade simulation from 8.0-U3 to 8.1-U2, and it is up and running in terms of accessing the CM (content editor, experience editor, publish and other more) and the health of logging is quite good.
Note that: I haven't started the simulation, so this is still in v.8.0-U3
Until I opened a page using Experience Editor (still good) and start adding new component (clicked the add here button), and then, I encountered the Palette.aspx 500 internal server error after checking it in the browser console log.
POST http://8.0-u3.sitecore.com/sitecore/shell/Applications/WebEdit/Palette.aspx 500 (Internal Server Error)
And so, as most curious developer will do, I opened the URL to see the full stack trace:
Server Error in '/' Application.
Palette.aspx: unrecognized command ''
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: Palette.aspx: unrecognized command ''
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: Palette.aspx: unrecognized command '']
Sitecore.Shell.Applications.WebEdit.Palette.OnPreInit(EventArgs e) +2380
System.Web.UI.Page.PerformPreInit() +46
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1251
I also checked the SC log file, to see what it tells me:
16220 2016:04:29 17:37:12 ERROR Application error.
Exception: System.Web.HttpUnhandledException
Message: Exception of type 'System.Web.HttpUnhandledException' was thrown.
Source: System.Web
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.sitecore_shell_applications_webedit_palette_aspx.ProcessRequest(HttpContext context) in c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\bf95a62a\ceceb3fc\App_Web_mqggjnpz.2.cs:line 0
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Nested Exception
Exception: System.FormatException
Message: Unrecognized Guid format.
Source: mscorlib
at System.Guid.GuidResult.SetFailure(ParseFailureKind failure, String failureMessageID, Object failureMessageFormatArgument, String failureArgumentName, Exception innerException)
at System.Guid.TryParseGuid(String g, GuidStyles flags, GuidResult& result)
at System.Guid..ctor(String g)
at Sitecore.Data.ShortID..ctor(String id)
at Sitecore.Data.ShortID.Parse(String value)
at Sitecore.Pipelines.ExecutePageEditorAction.ExecuteInsertRenderingArgs.<GetAllowedRenderingsIds>b__0(String id)
at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at Sitecore.Pipelines.ExecutePageEditorAction.InsertRendering.InsertRenderingAt(DeviceDefinition device, RenderingDefinition renderingDefinition, Int32 insertPosition, IEnumerable`1 allowedRenderingsIds)
at Sitecore.Pipelines.ExecutePageEditorAction.InsertRendering.Process(PipelineArgs args)
at (Object , Object[] )
at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
at Sitecore.Pipelines.ExecutePageEditorAction.ExecutePageEditorActionPipeline.Run(ExecutePageEditorActionArgs args)
at Sitecore.Shell.Applications.WebEdit.Palette.OnPreInit(EventArgs e)
at System.Web.UI.Page.PerformPreInit()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
So I made some investigation and tweaking, I commented out the WebEdit Palette from Sitecore.AntiCSRF.config, just to check if there's any difference (seems not the right solution)
My self-arguement: Why do I have to edit this at all?
<ignore contains="WebEdit/Palette"/>
The previous SC log was not existing anymore, but got a new one below.
18404 2016:04:29 18:46:28 ERROR Application error.
Exception: Sitecore.Security.AntiCsrf.Exceptions.PotentialCsrfException
Message: CSRF form field is missing.
Source: Sitecore.Security.AntiCsrf
at Sitecore.Security.AntiCsrf.SitecoreAntiCsrfModule.RaiseError(Exception ex, HttpContext context)
at Sitecore.Security.AntiCsrf.SitecoreAntiCsrfModule.PreRequestHandlerExecute(Object sender, EventArgs e)
at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Unfortunately, up to this point, the error still persist and I still wasn't able to add new component because it returns a An error occurred pop up.
Anyone?
I've recently experienced the same issue on my environment. In my case it was because adding the component in certain placeholders was breaking the html structure and causing this issue.
It looks like it's having a problem parsing a Guid from the Allowed Renderings on your placeholder settings. Make sure you have only valid renderings selected. You may want to view the raw value to make sure it is a properly formatted pipe-delimited list of Guids.
It happened when we added a class in default.cshtml on the layout page. the JS frameworks conflicted

Rotativa PDF generation working locally but not on IIS 7

I have an ASP.NET MVC 5 application. It has a simple form and when the user submits it, the form is stored in the cache and then another controller action is called, this action will return the model as a view as a PDF.
I have no need to save it locally, just to show it in the browser so that the user can download it.
There is no need for a database either, that is why I store the model in the cache.
Locally, on Visual studio 2013, it works fine. But when I publish it to IIS 7 I get an Unhandled Execution Error. Here is the stack trace that I get back:
Unhandled Execution Error
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:
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]
Rotativa.WkhtmltopdfDriver.Convert(String wkhtmltopdfPath, String switches, String html) +1364
Rotativa.WkhtmltopdfDriver.ConvertHtml(String wkhtmltopdfPath, String switches, String html) +70
Rotativa.ViewAsPdf.CallTheDriver(ControllerContext context) +1986
Rotativa.AsPdfResultBase.BuildPdf(ControllerContext context) +380
Rotativa.AsPdfResultBase.ExecuteResult(ControllerContext context) +69
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +109
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +890
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +97
System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult) +241
System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) +29
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +111
System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +53
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +19
System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState) +51
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +111
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +606
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +288
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34248
I first used ActionAsPDF() but now I also tried to use return new ViewAsPDF(). Both give the same error and stack trace. Does this have to do something with permissions?
This error is a missing C++ redistributable Package for Visual Studio 2013 file called (MSVCP120.dll).
To solve the issue:
Open the C++ redistributable Package for Visual Studio 2013 downloadable link below:
download Visual C++ Redistributable Packages for Visual Studio 2013
Click Download and choose the file (vcredist_x86.exe) even if you are running X64 bit server version.
Install the file.
Check Jalal W Hijazi Blog http://jwhijazi.blogspot.com/2015/05/solving-rotativa-unhandled-exception.html for more details.
As mentioned in the comments on the blog linked in the answer, you can just copy the 2 following dll files to the rotativa folder on the server if you don't want to / can't easily install things on the server.
msvcr120.dll
msvcp120.dll
If it's working locally, you should have the two dll files available already.
You need the x86 versions, if you find x64 versions packaged with vs 2015 they don't work. I found the right versions here:
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\redist\x86\Microsoft.VC120.CRT
After upgrading to Rotativa 1.7.3 this no longer worked. I had to copy over some new dlls from visual studio 2017, i found them here this time:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\redist\x86\Microsoft.VC140.CRT
and i had to copy over
msvcp140.dll
vcruntime140.dll
The accepted answer almost worked for me. I was missing a newer version of the C++ redistributable so installing the old version didn't help.
The easiest way to find out what you are missing is to run wkhtmltopdf.exe manually. It will either give you console output (if working) or a message box about what's missing.
I was missing MSVCP140.dll, which is from the VS 2015 redist, available here: https://www.microsoft.com/en-gb/download/details.aspx?id=48145
I fixed my issue by updating the wkhtmltopdf files from the installer found here
Working flawlessly now!
When I upgraded from Rotativa 1.6.4 to 1.7.3 my PDF conversion on my website app stopped working and after running the wkhtmltopdf.exe on my production server I noticed it was having an issue with msvcp140.dll
Solution was to install Visual C++ Redistributable for Visual Studio 2015
https://www.microsoft.com/en-us/download/details.aspx?id=48145
I faced the same problem. Even the error logger wasn't logging anything.
After some research, I tried replacing the wkhtmltopdf.exe with the latest version available in wkhtmltopdf.org website, still no luck.
Finally copied msvcp120.dll and msvcr120.dll to the folder where I had the excutable and it worked. (There was no need of the latest version of wkhtmltopdf.exe, instead it worked with the version what I got from Nuget.)
msvcp120.dll and msvcr120.dll were available in the below directory in Windows 7.
C:\Windows\SysWOW64\
I installed Visual C ++ Redistributable Packages for Visual Studio 2015
https://www.microsoft.com/pt-br/download/details.aspx?id=48145
This solved for me.

ActivationManager Exception during build process?

I'm getting the following exception when building a website project in VS 2010:
The pre-application start initialization method Run on type WebActivator.ActivationManager threw an exception with the following error message: Exception has been thrown by the target of an invocation..
How do I go about debugging this? It's happening when I build in VS.NET and from the command-line (e.g., via NAnt/MSBuild).
To solve this, you need to supply the -errorstack argument to the aspnetcompiler. Then when it fails, you'll get not only the stack trace of the exception you're seeing now, but also the InnerException that it's wrapping. For instance, here's the output when the build error is caused by a problem with a Cassette dll not being loaded:
error ASPRUNTIME: The pre-application start initialization method Run on type We
bActivator.ActivationManager threw an exception with the following error message
: Exception has been thrown by the target of an invocation..
[TypeLoadException]: Could not load type 'Cassette.Configuration.ICassetteConfig
uration' from assembly 'Cassette, Version=0.8.1.0, Culture=neutral, PublicKeyTok
en=null'.
at Cassette.Web.StartUp..cctor()
[TypeInitializationException]: The type initializer for 'Cassette.Web.StartUp' t
hrew an exception.
at Cassette.Web.StartUp.PreApplicationStart()
[TargetInvocationException]: Exception has been thrown by the target of an invoc
ation.
at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Ob
ject target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAt
tributes, RuntimeType typeOwner)
at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Obj
ect target, Object[] arguments, Signature sig, MethodAttributes methodAttributes
, RuntimeType typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invoke
Attr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisib
ilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invoke
Attr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at WebActivator.BaseActivationMethodAttribute.InvokeMethod()
at WebActivator.ActivationManager.RunActivationMethods[T]()
at WebActivator.ActivationManager.RunPreStartMethods()
at WebActivator.ActivationManager.Run()
[InvalidOperationException]: The pre-application start initialization method Run
on type WebActivator.ActivationManager threw an exception with the following er
ror message: Exception has been thrown by the target of an invocation..
at System.Web.Compilation.BuildManager.InvokePreStartInitMethods(ICollection`
1 methods)
at System.Web.Compilation.BuildManager.CallPreStartInitMethods()
at System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appMan
ager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, Host
ingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception a
ppDomainCreationException)
[HttpException]: The pre-application start initialization method Run on type Web
Activator.ActivationManager threw an exception with the following error message:
Exception has been thrown by the target of an invocation..
at System.Web.Compilation.ClientBuildManager.EnsureHostCreated()
at System.Web.Compilation.ClientBuildManager.PrecompileApplication(ClientBuil
dManagerCallback callback, Boolean forceCleanBuild)
at System.Web.Compilation.Precompiler.Main(String[] args)
I'd like to up-vote Xoltar's answer, but this is my first contribution to SO so I don't have the rep!
I had a very similar problem on our build-server (TeamCity), here's a clip from the build-log:
[00:10:39]: (MvcBuildViews target) ->
[00:10:39]: error ASPRUNTIME : The pre-application start initialization method Run on type WebActivator.ActivationManager threw an exception with the following error message: Exception has been thrown by the target of an invocation.. [C:\TeamCity\buildAgent\work\1ee8c94c32e676ad\source\Project.Site\Project.Site.csproj]
[00:10:39]: 0 Warning(s)
[00:10:39]: 1 Error(s)
[00:10:39]: Time Elapsed 00:00:27.93
To diagnose the problem I ran ASPNET_COMPILER, using the -errorstack argument against what MSBUILD had generated for site. In this case:
C:\Windows\Microsoft.NET\Framework\v4.0.30319>aspnet_compiler -p "C:\TeamCity\buildAgent\work\1ee8c94c32e676ad\source\Project.Site" -v anything -errorstack
Utility to precompile an ASP.NET application
Copyright (C) Microsoft Corporation. All rights reserved.
error ASPRUNTIME: The pre-application start initialization method Run on type WebActivator.ActivationManager threw an exception with the following error message : Exception has been thrown by the target of an invocation..
[FileNotFoundException]: Could not load file or assembly 'msshrtmi, Version=1.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
at Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.InitializeEnvironment()
at Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment..cctor()
error ASPRUNTIME: The pre-application start initialization method Run on type WebActivator.ActivationManager threw an exception with the following error message : Exception has been thrown by the target of an invocation..
In my case a dependency on one of the Azure assemblies (which wasn't installed on the build server) was the root of the problem.
Increase the verbosity level of the msbuild task or command line to get more detailed error messages.
For example, use /verbosity:detailed.
See http://msdn.microsoft.com/en-us/library/ms164311.aspx
Are you using Ninject?
If so, see this: http://groups.google.com/group/ninject/browse_thread/thread/1934e9260ba07ecd?pli=1 and this: http://www.techques.com/question/1-6173194/Strange-behaviour-when-using-Ninject-to-resolve-a-service-within-a-controller-factory
Are you using RavenDB?
If so, see this: http://groups.google.com/group/ravendb/browse_thread/thread/437738caf4760ce1/b7e92fd6cfeaaa17?#b7e92fd6cfeaaa17
In my case, I was seeing the message [AspNetCompiler] error ASPRUNTIME error message: Value cannot be null. in TeamCity.
In the full build logs, the more useful message at the bottom was:
error ASPRUNTIME : The pre-application start initialization method InitializePreStart on type MyApplication.MvcApplication threw an exception with the following error message: Value cannot be null.
As it turns out I had an exception being thrown by a method I had defined using PreApplicationStartMethod:
[assembly: System.Web.PreApplicationStartMethod(typeof(MyApp.MvcApplication), "InitializePreStart")]
namespace PrintFleet.PFE.RestService
{
public class MvcApplication : System.Web.HttpApplication
{
//....
public static void InitializePreStart()
{
// exception thrown here
}
}
}
The cause in my case was my prestart method was loading settings from the registry, and they didn't exist on the build server (but did on my machine, so it worked when I built it). I have no clue why webdeployment projects run this code.
I wrapped the entire thing in a try..catch that logs a fatal message (which in my app, goes to both the log file and windows event log). In builds, I don't really care if it fails since it doesn't need to do anything. In actual installations, if the settings are missing the app won't work (and so the log explains why).
Now, to the OP the problem seems to be in web activator. I would not be surprised if there is a method using webactivor in App_Start folder that is throwing the error, which is making it look like it's coming from WebActivator. Check there first, wrap things in try..catch if needed. It's also possible there is a bug in webactivator itself.
So because I came across this post while researching the problem, hopefully this information is useful to at least someone else.
TL;DR: Web deployment projects run the ApplicationPreStart methods when they compile. Ensure that you have try..catch blocks around any code run at prestart time or can otherwise handle the situation where the code is executed during compile time on your build server(s), outside of the IIS/hosting environment.

XCOPY/Publish ASP.NET 3.5 Website in x86 onto a 64-bit Server

I have a ASP.NET "website" which uses a 32-bit dll. When I XCOPY to our 64-bit server, the page which uses this 32-bit dll throws an exception. I've already set the "Enable 32-Bit Applications" to True for the App Pool the site runs on but that doesn't help.
I'm also trying to set the target platform to x86 but the Website has no option for it unlike a Web app.
Here's the stack trace -
Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 7/13/2010 5:01:12 PM
Event time (UTC): 7/13/2010 9:01:12 PM
Event ID: 9611671ef6b845f39af6b26b89af85e3
Event sequence: 51
Event occurrence: 4
Event detail code: 0
Application information:
Application domain: /LM/W3SVC/2/ROOT-1-129235271319338750
Trust level: Full
Application Virtual Path: /
Application Path: C:\Site\
Machine name: WWWTEST
Process information:
Process ID: 4020
Process name: w3wp.exe
Account name: IIS APPPOOL\WWWTEST AppPool
Exception information:
Exception type: COMException
Exception message: Retrieving the COM class factory for component with CLSID {58968145-CF05-4341-995F-2EE093F6ABA3} failed due to the following error: 80040154.
Request information:
Request URL: http://site/Downloads.aspx
Request path: /Downloads.aspx
User host address: 192.168.1.101
User:
Is authenticated: False
Authentication Type:
Thread account name: WWWTEST\Webtest
Thread information:
Thread ID: 4
Thread account name: WWWTEST\Webtest
Is impersonating: False
Stack trace: at Downloads.Button_Click(Object Sender, DataGridCommandEventArgs E) in C:\Site\Downloads.aspx.vb:line 1034
at System.Web.UI.WebControls.DataGrid.OnItemCommand(DataGridCommandEventArgs e)
at System.Web.UI.WebControls.DataGrid.OnBubbleEvent(Object source, EventArgs e)
at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
at System.Web.UI.WebControls.DataGridItem.OnBubbleEvent(Object source, EventArgs e)
at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
at System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e)
at System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument)
at System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
I did an online search for the exception "Retrieving the COM class factory for component with CLSID {58968145-CF05-4341-995F-2EE093F6ABA3} failed due to the following error: 80040154." and enabled the 32-bit mode on IIS7 but still no luck.
Any help is greatly appreciated.
** ANSWER **
I was able to fix this issue with the help from user Kev. Here's what I did -
Download Microsoft Developer Support OLE File Property Reader 2.1 Sample (KB 224351) from here
Extract the contents to a temp folder using WinZip/7-zip etc. Don't run the Setup. Copy the files "Interop.DSOFile.dll" and "dsofile.dll" from the extracted location over to the bin directory of the app on the Server.
Open a cmd prompt with Admin rights and navigate to the bin directory on the Server
Type in "regsvr32 dsofile.dll"
Make sure the App Pool is set to Enable 32-Bit applications.
Restart IIS
Thank you very much, Kev. I really appreciate it.
This sounds like the COM component isn't registered on the server. You need to copy the component (dsofile.dll) to the server and run regsvr32.exe to register it:
regsvr32 dsofile.dll
You also need to make sure that the account that the website runs under has read access to this file or its containing folder.
It might also be worth trying building your project and changing the build to target x86 instead of Any CPU, though I doubt that's the problem.
You probably need to set the application pool the app is running in to run as x86.

Resources