2

Not sure what happened my project but when I tried to run it I got the error message Could not load file or assembly 'Exceptionless.Mvc' or one of its dependencies

Eceptionless.MVC is not used or referenced anywhere in my project I cant even find any text with Exceptionless......

So I used Nuget Manager to install the exceptionless.MVC package.

Now I get the error

`HTTP Error 500.19 - Internal Server Error

The requested page cannot be accessed because the related configuration data for the page is invalid.

Config Error
There is a duplicate 'exceptionless' section defined `

The install of exceptionless.Mvc added the following to my web config

 <section name="exceptionless" type="Exceptionless.ExceptionlessSection, Exceptionless" />
 <exceptionless apiKey="API_KEY_HERE" />
  <modules runAllManagedModulesForAllRequests="true">
      <add name="ExceptionlessModule" type="Exceptionless.Mvc.ExceptionlessModule, Exceptionless.Mvc" />
    </modules>

and the packages config was updated

  <package id="Exceptionless" version="4.2.1982" targetFramework="net45" />

That is the only ref to exceptionsless/exceptionlessMVC in my project.

I am at a loss to what its look for with mvc exceptionless or where the duplicate sections are??

any help pls?

John
  • 3,965
  • 21
  • 77
  • 163
  • Restart your IIS/DevelopmentServer/PC and try again,you should be able to update the config fie then – George Vovos Jan 08 '18 at 10:40
  • Hey George thanks for the reply. So I closed and opend VS and edited the config file removing the only ref of name="exceptionless" (which was flagging as duplicate when I tried to run...even tho it was the only ref)...no when I run the program I get 'Could not load file or assembly 'Exceptionless.Mvc' or one of its dependencies. The system cannot find the file specified.' – John Jan 09 '18 at 02:17
  • 1
    Have you checked machine.config? – Simon Mourier Jan 12 '18 at 08:43
  • You don't have a dupe "ExceptionlessModule" in any of these places?? – smoore4 Jan 12 '18 at 16:06
  • Otherwise it is in the GAC and you want to remove the part in
    – smoore4 Jan 12 '18 at 16:08
  • Check your system-wide web.config and machine.config (assuming .NET4.0 and higher) here: C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config and here C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config – Ondrej Svejdar Jan 13 '18 at 23:53

3 Answers3

1

Issue was to do with a duplicate web config file stored in the IIS. Renaming that web config allowed the original to take priority removing any duplicate issues with exceptionless.

John
  • 3,965
  • 21
  • 77
  • 163
0

You should try removing the handler then adding it back in. Here is a similar example:

  <system.webServer>
    <handlers>
      <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
      <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
    </handlers>

You may need to comment out this part too.

 <section name="exceptionless".... 
smoore4
  • 4,520
  • 3
  • 36
  • 55
0

Web.config is inheriting from Web.config from parent application. Also there is machine-wide web.config and machine.config.

1) If you application is on IIS and there is a parent application, check web.config of parent application

2) Check your machine-wide web.config and machine.config. Assuming you're on .NET 4.0 and higher they're here: C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config (for x32 bit application pool) C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config (for x64 bit application pool)

Ondrej Svejdar
  • 21,349
  • 5
  • 54
  • 89