Click here to Skip to main content
15,888,351 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am working on MVC and Web Api project and i have added the Elmah nuget package in the both application,
and it's working fine, exception log is writing into database, but when i deploy the application on IIS server. it's showing the duplicate name="Elmah" and other elmah related tag into the web.config file.


1) first deploy the mvc application
2) deploye web api project as nested application in mvc.


i need to add the elmah nuget in both the application because, web api project is also uses by android application and also access by mvc application.

please help, how can i do this.


What I have tried:

mvc config value:

<handlers>
     <add name="Elmah" verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" />
     <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
     <remove name="OPTIONSVerbHandler" />
     <remove name="TRACEVerbHandler" />
     <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
   </handlers>
   <validation validateIntegratedModeConfiguration="false" />
   <modules>
     <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" preCondition="managedHandler" />
     <add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" preCondition="managedHandler" />
     <add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" preCondition="managedHandler" />
   </modules>



web api config value:
<httpModules>
     <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" />
     <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" />
     <add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" />
     <add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" />
   </httpModules>
   <httpHandlers>
     <add verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" />
   </httpHandlers>
Posted
Comments
F-ES Sitecore 15-Jun-17 10:40am    
What do you mean by step 2, deploying as a nested project? If all you did was copy the other app into a folder or root of the website then that's not going to work, you'll need to do something like create a virtual directory and deploy your web api to that.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900