asp.net 发布问题

问题描述 投票:0回答:2

我的应用程序在本地主机上运行良好。但是当我将其发布到服务器时,它抛出以下异常。
它昨天可以工作,但是我向 global.asax 和代码中的其他一些部分添加了一些简单的文件 IO 操作,我尝试将日志写入服务器端的某个文件..

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 'MyApplication' or one of its dependencies. The system cannot find the file specified.]
System.RuntimeTypeHandle._GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, Boolean loadTypeFromPartialName) +0
System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark) +78
System.RuntimeType.PrivateGetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark) +58
System.Type.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +64
System.Web.Compilation.BuildManager.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +51
System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, XmlNode node, Boolean checkAptcaBit, Boolean ignoreCase) +38
asp.net-2.0 publishing
2个回答
1
投票

我的假设是您没有将目标文件夹标记为 IIS 的“应用程序”,这意味着它将在错误的位置查找“bin”文件夹。您可以在服务器上的 IIS 管理器中执行此操作;该文件夹应该有一个“cog”图标,表明它知道它是一个应用程序。如果没有:右键单击该文件夹并进入属性;应该有一个“创建应用程序”按钮(或类似按钮)。还要验证 ASP.NET 是否设置为 2.0.*(在 ASP.NET 选项卡上)。


1
投票

MyApplication.dll 是否存在于 bin 文件夹中?检查它或提供有关您如何发布网站的更多详细信息

© www.soinside.com 2019 - 2024. All rights reserved.