7

I upload my asp.net file in webserver. First it shows

<!-- Web.Config Configuration File -->

<configuration>
    <system.web>
        <customErrors mode="Off"/>
    </system.web>
</configuration>

Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's configuration tag to point to a custom error page URL.

<!-- Web.Config Configuration File -->



<configuration>
    <system.web>
        <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
    </system.web>
</configuration

Then I add <customErrors mode="Off"> in web.config file.

After that when i run it shows the following error.

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.

I upload my projects file completely such as bin, css, js, images and forms. First time I am uploading in web server. Please tell me what should I do.

Community
  • 1
  • 1

6 Answers6

6

I had this exact same error while deploying an app containing application insights to production (worked on acceptance weirdly, but oh well) yesterday. Somehow the project was incorrectly configured to not copy a bunch of references (including the Microsoft.AI.Web reference).

The solution proved quite simple:

Install-Package Microsoft.ApplicationInsights.Web

This installed a new version of application insights and fixed the references. Alternatively, I would suspect that a reinstall of that package would do the same trick.

Johan B
  • 890
  • 3
  • 23
  • 39
  • 1
    I installed the library form NuGet Package manager but failed, after installing the library from console it worked for me! Thanks @Johan B – Rameez Javed Jul 02 '20 at 06:34
2

You could follow the below steps to solve the issue:

  1. Open IIS.
  2. Right click the 'Default Web Site'. Go to 'Manage Web Site' > 'Advanced Settings..'
  3. Check the 'Physical Path' value. It should be 'C:\inetpub\wwwroot'.

Note: The above steps would work if you have published your project as an Application under the 'Default Web Site' in IIS. In case you have publish your project as a different web site, you could try the similar steps to point it to your project and not to 'C:\inetpub\wwwroot'

Pulkit
  • 43
  • 6
  • Yes, I think accidently my release pipeline did a release to the root folder. This might have changed the default web site. – Buminda Mar 11 '20 at 03:31
1

You must have your reference set to "copy local" when deploying your website.

Check this answer

Community
  • 1
  • 1
Stormhashe
  • 704
  • 6
  • 16
1

I get this when running my site with Target .Net Framework 4.5.2 but not when running with 4.6

Rodney Ellis
  • 727
  • 2
  • 13
  • 28
1

I had similar issues. It started after I uninstalled an instance of visual studio 2017. I wanted to revert back to VS2015.

Cause

  1. It was probably caused by conflict in .Net Framework.

My Solution

  1. I Edited changed all the .Net Framework of my Projects to point to the same framework (.Net 4.6 framework)
  2. I cleared the bin folder of the project.Make sure this is selected for the bin folder to be visible

  3. I rebuilded the projects and the error stopped.

Ifesinachi Bryan
  • 2,240
  • 1
  • 19
  • 20
1

Just Remove the following tag line from web.config file

ApplicationInsightsWebTracking

Mamun_007
  • 21
  • 3