I have the following error when making publish
a web page on iis
my local machine, if I do debug
it it works fine but not when publishing from Visual Studio
, if I copy the project folder it works without any problem but I cannot pass the files to the server since there is no username or password for ftp
, they already provided me with a file to publish from theVisual Studio
This is the error when opening http://localhost/ControlCobranza
Server error in the application '/ControlCobranza'.
Cannot load file or assembly 'Microsoft.AI.Web' or one of its dependencies. The system cannot find the specified file.
Description: Unhandled exception executing the current web request. Review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.IO.FileNotFoundException: Cannot load file or assembly 'Microsoft.AI.Web' or one of its dependencies. The system cannot find the specified file.
Source code error:
An unhandled exception was thrown during the execution of the current web request. Information about the origin and location of the exception can be identified using the following exception stack trace.
Trace on Assembly Load: The following information may be helpful in determining why the 'Microsoft.AI.Web' assembly did not load.
AVS: Assembly binding logging is disabled. To enable assembly binding error logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There is a performance penalty associated with assembly binding error logging. To disable this feature, delete the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
Stack trace:
[FileNotFoundException: Cannot load file or assembly 'Microsoft.AI.Web' or one of its dependencies. The system cannot find the specified file.]
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) +106 System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark) +62
System.Type.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +50 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) +53[ConfigurationErrorsException: Cannot load file or assembly 'Microsoft.AI.Web' or one of its dependencies. The system cannot find the specified file.]
System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, XmlNode node, Boolean checkAptcaBit, Boolean ignoreCase) +587
System.Web.Configuration.ConfigUtil.GetType( String typeName, String propertyName, ConfigurationElement configElement, Boolean checkAptcaBit) +33
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) +198
System.Web.HttpApplication.GetModuleCollection(IntPtr appContext) +1114 System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +140
System .Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +172
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +402
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +343[HttpException (0x80004005): Cannot load file or assembly 'Microsoft.AI.Web' or one of its dependencies. The system cannot find the specified file.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +539
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +125 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +731
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.1586.0
It is possible that the error occurs because when deploying the assembly is not included
Microsoft.AI.Web
To make this assembly included in the deploy you have to check the option
Copia local=true
as shown in the imageYou also have to do the same with
Microsoft.ApplicationInsights
, and the rest of the assemblies that the application needs and that are not in the GACUpdate:
According to JuankGlezz , the problem was in the references and it was fixed by updating them with the Nuget package control .
Once this problem was fixed, this other error also occurred when publishing via Webdeploy :
This error was related to a permission setting issue in IIS and is fixed by following the steps in this SO answer in English
I had the same error, but it happened to me because I had IIS services disabled, look for the option to Turn Windows features on or off and look for Internet Information Services, activate the features I needed.
I hope this helps, although at the beginning, perform all the steps shown above, but do not rule out this option, where you may have Internet Information Services disabled.
I had the same problem and solved it as indicated in this answer on Stack Overflow in English :