在构建过程中Activati​​onManager例外? [英] ActivationManager Exception during build process?

查看:234
本文介绍了在构建过程中Activati​​onManager例外?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我得到以下异常时的建筑的在VS 2010中一个网站项目:

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

我如何去调试呢?当我建立VS.NET和命令行(例如,通过恶性/ MSBuild的),它的发生。

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

推荐答案

要解决这个问题,你需要在 -errorstack 参数提供给aspnetcompiler。然后,当它失败了,你得到的不仅仅是你现在看到异常的堆栈跟踪,还设置InnerException,它的包装。举例来说,这里是当生成错误是由与磁带的问题引起的DLL没有被加载的输出:

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)

这篇关于在构建过程中Activati​​onManager例外?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆