2017-10-05 66 views
2

尝试将MVC5应用程序部署到新的专用服务器时,仍然收到相同的错误。问题将MVC 5部署到Windows Server 2014

我曾尝试重新安装Microsoft.Web.Infrastructure程序包。
我也改变了属性>复制本地为真。

我已检查发布的bin文件夹中是否存在Microsoft.AI.Web。

仍然收到相同的错误消息:

任何人有任何想法? MVC需要服务器配置吗?

Server Error in '/' Application. ________________________________________ Could not load file or assembly 'Microsoft.AI.Web' or one of its dependencies. The system cannot find the file specified. 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.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.AI.Web' or one of its dependencies. The system cannot find the file specified.

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.

Assembly Load Trace: The following information can be helpful to determine why the assembly 'Microsoft.AI.Web' could not be loaded.

WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

Stack Trace:

[FileNotFoundException: Could not load file or assembly 'Microsoft.AI.Web' or one of its dependencies. The system cannot find the file specified.] System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type) +0 System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName) +95 System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark) +53
System.Type.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +44 System.Web.Compilation.BuildManager.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +61
System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, XmlNode node, Boolean checkAptcaBit, Boolean ignoreCase) +49

[ConfigurationErrorsException: Could not load file or assembly 'Microsoft.AI.Web' or one of its dependencies. The system cannot find the file specified.]
System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, XmlNode node, Boolean checkAptcaBit, Boolean ignoreCase) +558
System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, Boolean checkAptcaBit) +30
System.Web.Configuration.Common.ModulesEntry.SecureGetType(String typeName, String propertyName, ConfigurationElement configElement) +57 System.Web.Configuration.Common.ModulesEntry..ctor(String name, String typeName, String propertyName, ConfigurationElement configElement) +54 System.Web.HttpApplication.BuildIntegratedModuleCollection(List`1 moduleList) +191
System.Web.HttpApplication.GetModuleCollection(IntPtr appContext) +1086 System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +123
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +169
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +396
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +333

[HttpException (0x80004005): Could not load file or assembly 'Microsoft.AI.Web' or one of its dependencies. The system cannot find the file specified.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +525
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +124 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +700

UPDATE:

我可以部署一个基本空白的MVC应用程序的罚款。所以我想,我只是从我想要部署的项目中转移视图,模型和控制器。当我这样做时,我再次得到错误。代码中是否有可能导致此类错误的内容?

+0

此AI与Application Insights一起使用。如果您的项目中不需要它,也可以将其删除。否则,检查https://stackoverflow.com/a/39776427/7974050 – Amit

+0

它是标准的空白MVC项目,因此不确定我是否需要它? @Amit – elszeus

+0

检查你的web.release.config是否没有删除程序集? – GGO

回答

0

嘿,只是为了更新每个人,卸载应用程序见解对我发布的错误起作用,404是一个路由问题。当运行本地路由没有问题时,但在服务器上,路由有点不同(可能配置不同)。我们选择使用Url.Action(在视图中)和~/Home/Index(在我们的Cookie检查器中)来实现成功的URL路由。

这是不明显的开始,所以希望这可以帮助别人!