asp.net-2.0publishing

asp.net publish problem


My application works fine on localhost. But when I publish it to the server , it throws the exception below.
It was working yesterday, but I added some simple file IO operations to global.asax and some other parts in code, i try to write log to some file in server side ..

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

Solution

  • My assumption would be that you haven't marked the target folder as an "application" is IIS, meaning it will be looking in the wrong place for the "bin" folder. You can do this in the IIS manager on the server; the folder should have a "cog" icon, indicating that it knows it is an application. If not: right-click on the folder and go into the properties; there should be a "Create Application" button (or similar). Also verify that ASP.NET is set to 2.0.* (on the ASP.NET tab).