因此,我的一个网站有一个PreApplicationStartMethod,它应该在应用程序启动之前运行:
[assembly: PreApplicationStartMethod(typeof(ServiceStackAppHost), "Start")]
该方法进行了一些引导操作,并依赖于一些配置的设置。
现在,我想将网站编译为自动化构建流程的一部分 - 因此我调用 aspnet_compiler.exe,但它失败了,因为它运行了 PreApplicationStartMethod:
AfterBuild:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_compiler.exe -v temp -p C:\Projects\ error ASPRUNTIME : The pre-application start initialization method Start on type RedactedNameSpace.ServiceStackAppHost threw an exception with the following error message: Resolution of the dependency failed, type = "..."
如何避免 aspnet_compiler.exe 在编译网站时调用 PreApplicationStartMethod?
PreApplicationStart
吗?或者将你在那里的代码移动到其他地方是否可以接受? - user743382