问题标签 [webactivator]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
asp.net-mvc-4 - asp.net MVC 4 与 StructureMap
我正在将 ASP.NET MVC3 项目转换为 MVC4。我试图找到使用 StructureMap 和 MVC4 的最佳方法。我找到了一些可能有效的解决方案,但还没有尝试过。
第一个解决方案非常简单和轻量级。第二个(Structuremap.MVC4)依赖于 WebActivator 来启动。
什么是更好和最简单的方法?我还需要引导所有内容并使用 WebActivator 设置 DependencyResolver 吗?
谢谢你的帮助。
asp.net - 如何在请求之外获取网站根目录?
在请求内部,我可以使用Server.MapPath()
访问网站根目录。如何访问该功能或以其他方式获取网站根目录而不访问Server
?我正在尝试为 ninject 内部构建一个绑定WebActivator.PreApplicationStartMethod
。
我们尝试过使用Directory.GetCurrentWorkingDirectory()
,它返回了Microsoft Shared\Dev Server
. 但是, in Global.asax.cs
,调用Server.MapPath("")
inApplication_Start
会产生我想要的目录。
vb.net - 将 Breeze js 代码转换为 vb.net 时出现 WebActivator 错误
在将一些微风 API 从 C# 代码转换为 VB.NET 后,当我运行我的项目时WebActivator
抛出以下消息:Server Error in '/' Aplication
DevCentralBreeze.HotTowelRouteConfig 类型没有名为 RegisterHotTowelPreStart 的静态方法
我想我编码的一切都是正确的——有一个静态成员,但 WebActivator 找不到它。
有谁知道我怎样才能WebActivator
认识到这一点?也许一些配置问题?
asp.net - WebActivator - 访问服务器对象/当前目录
我有一个需要访问该Server
属性的 WebActivator 引导程序。具体来说,它需要知道是什么Server.MapPath("~")
。
有没有办法做到这一点?
orchardcms - WebActivator 不适用于 Orchard
我有当前版本的 Orchard CMS 1.6.1 和 WebActivator 2.0.1。
Orchard 的默认安装。WebActivator PreApplicationStartMethod 没有被触发。
在同一个解决方案中,我有示例 MVC 应用程序,并且相同的 WebActivator 代码工作正常。
果园应用程序有什么问题。它是否破坏了标准的 ASP.NET 管道?
示例代码(我使用了 Pre 和 PostApplicationStartMethod):
c# - 安装包:找不到包“WebActivator”
我有用于 Web 的 Visual Studio 2012 Express。我的步骤 - 创建一个新的 ASP .NET MVC 4 应用程序 - 选择基本模板 - 转到包管理器控制台 - 尝试安装 WebActivator
我收到以下错误
我如何解决这个问题并安装 WebActivator 包?
asp.net-mvc - 应用程序启动前初始化方法 Run on type WebActivator.ActivationManager 抛出异常
我正在尝试在 IIS 上运行 ASP MVC 4 应用程序。当我从 Basic 模板发布 MVC 4 应用程序时——除了向导创建的这些之外没有任何依赖项——应用程序工作正常。但是当我发布其他应用程序时,即使用 WebActivator 和许多其他库时,我看到了这个错误:
并完成堆栈跟踪:
[FileLoadException:无法加载文件或程序集“System.Core,版本=2.0.5.0,文化=中性,PublicKeyToken=7cec85d7bea7798e,可重定位=是”或其依赖项之一。给定的程序集名称或代码库无效。(HRESULT 异常:0x80131047)] System.ModuleHandle.ResolveType(RuntimeModule 模块,Int32 typeToken,IntPtr* typeInstArgs,Int32 typeInstCount,IntPtr* methodInstArgs,Int32 methodInstCount,ObjectHandleOnStack 类型)+0 System.ModuleHandle.ResolveTypeHandleInternal(IntTokenModule 模块, , RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext) +180 System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments) +192 System.Reflection.CustomAttribute。
[InvalidOperationException:在类型 WebActivator.ActivationManager 上运行的预应用程序启动初始化方法引发异常,并显示以下错误消息:无法加载文件或程序集'System.Core,版本 = 2.0.5.0,文化 = 中性,PublicKeyToken = 7cec85d7bea7798e, Retargetable=Yes' 或其依赖项之一。给定的程序集名称或代码库无效。(HRESULT 异常:0x80131047)。]
System.Web.Compilation.BuildManager.InvokePreStartInitMethods(ICollection`1 方法)+423
System.Web.Compilation.BuildManager.CallPreStartInitMethods() +306
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager,IApplicationHost appHost,IConfigMapPathFactory configMapPathFactory,HostingEnvironmentParameters hostingParameters,PolicyLevel policyLevel,异常 appDomainCreationException)+591[HttpException (0x80004005):在类型 WebActivator.ActivationManager 上运行的预应用程序启动初始化方法引发异常,并显示以下错误消息:无法加载文件或程序集'System.Core,版本 = 2.0.5.0,文化 = 中性,PublicKeyToken =7cec85d7bea7798e, Retargetable=Yes' 或其依赖项之一。给定的程序集名称或代码库无效。(HRESULT 异常:0x80131047)。]
System.Web.HttpRuntime.FirstRequestInit(HttpContext 上下文)+8946484 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext 上下文)+97 System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest WR)+258
是与 IIS6 相关的问题,还是我在服务器上遗漏了什么?
asp.net-mvc-4 - ASP.NET MVC 4 网站无法启动 - 无法加载类型“System.Reflection.AssemblyMetadataAttribute”
我将 ASP.NET MVC 4 Web 应用程序部署到 Windows Server 2003 (IIS 6)。但它不会启动。
最初我为 .NET 4.5 开发了该项目,但当我发现 Windows Server 2003 不支持 .NET 4.5 时,我不得不为 .NET4 重新构建它。这意味着删除所有第三方引用(使用 NuGet),更改在项目属性中将目标构建到 .NET4,然后将引用添加回来。参考了 Ninject、EF 和 Automapper。
当我尝试加载页面时,出现以下错误:
无法从程序集“mscorlib,版本=4.0.0.0,文化=中性,PublicKeyToken=b77a5c561934e089”加载类型“System.Reflection.AssemblyMetadataAttribute”。说明:执行当前 Web 请求期间发生未处理的异常。请查看堆栈跟踪以获取有关错误及其源自代码的位置的更多信息。
异常详细信息:System.TypeLoadException:无法从程序集“mscorlib,版本=4.0.0.0,文化=中性,PublicKeyToken=b77a5c561934e089”加载类型“System.Reflection.AssemblyMetadataAttribute”。
源错误:
在执行当前 Web 请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪来识别有关异常起源和位置的信息。
堆栈跟踪:
[TypeLoadException:无法从程序集“mscorlib”加载类型“System.Reflection.AssemblyMetadataAttribute”,版本=4.0.0.0,Culture=neutral,PublicKeyToken=b77a5c561934e089。]
System.ModuleHandle.ResolveType(RuntimeModule 模块,Int32 typeToken,IntPtr* typeInstArgs , Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount, ObjectHandleOnStack type) +0
System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule module, Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext) +180
System.Reflection.RuntimeModule.ResolveType(Int32metadata(Int32 ) , 类型[] genericTypeArguments, Type[] genericMethodArguments) +192
System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord caRecord,MetadataImport 范围,Assembly& lastAptcaOkAssembly,RuntimeModule decoratedModule,MetadataToken decoratedToken,RuntimeType attributeFilterType,Boolean mustBeInheritable,Object[] 属性,IListderivedAttributes,RuntimeType& attributeType,IRuntimeMethodInfo&ctor,Boolean&ctorHasParameters,Boolean& isVarArg) + 115
System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule,Int32 decoratedMetadataToken,Int32 pcaCount,RuntimeType attributeFilterType,布尔 mustBeInheritable,IList derivedAttributes,布尔 isDecoratedTargetSecurityTransparent)+426 System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeAssembly 程序集,运行时类型 caType) +103
System.Reflection.RuntimeAssembly.GetCustomAttributes(Type attributeType, Boolean inherit) +64
WebActivator.AssemblyExtensions.GetActivationAttributes(Assembly assembly) +113
WebActivator.ActivationManager.RunActivationMethods() +216
WebActivator.ActivationManager.RunPreStartMethods() +28
WebActivator.ActivationManager.Run () +55[InvalidOperationException:在类型 WebActivator.ActivationManager 上运行的预应用程序启动初始化方法引发异常,并显示以下错误消息:无法从程序集“mscorlib”加载类型“System.Reflection.AssemblyMetadataAttribute”,版本 = 4.0.0.0,文化 = 中性, PublicKeyToken=b77a5c561934e089'..] System.Web.Compilation.BuildManager.InvokePreStartInitMethods(ICollection`1 方法) +423
System.Web.Compilation.BuildManager.CallPreStartInitMethods() +306
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager , IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, 异常 appDomainCreationException) +677[HttpException(0x80004005):在类型 WebActivator.ActivationManager 上运行的预应用程序启动初始化方法引发异常,并显示以下错误消息:无法从程序集 'mscorlib 加载类型'System.Reflection.AssemblyMetadataAttribute',版本 = 4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'..] System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9164848 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +97 System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +258
有任何想法吗?
编辑:使用 VS2012 开发的网站
c# - 用 OwinStartupAttribute 替换 WebActivator PreApplicationStartMethod?
我WebActivator.PreApplicationStartMethod
在我当前的项目中使用,但似乎OwinStartupAttribute
可以做同样的工作?这是正确使用的OwinStartupAttribute
吗?
c# - 从另一个程序集引导 Windows 窗体项目
在将 Onion Architecture 与Windows Forms UI 层相结合时,我遇到了障碍。问题是我的IoC配置方法永远不会被命中。IoC 设置发生在依赖解析程序集中:
而且我希望我的 UI 层除了Project.Core
.
在我使用此架构的 Web 项目中,我使用了 WebActivatorEx 和 OutputTo 来引导我的 IoC。因为我很熟悉,所以我决定在这里使用相同的,但它的行为不像预期的那样。我不确定我是问题还是 Windows 窗体是问题所以这是我的设置:
在 Project.DependencyResolution 中:
OutputTo 的 OutputTargets.txt:
在 Project.UI 中:
OutputToDependencyResolution's
将 DLL 文件正确复制到Ui's
bin,但从IocConfig.RegisterDependencies
不运行。
那么如何从它自己的程序集中设置 IoC,其中 Windows 窗体项目是启动项目?