You must Sign In to post a response.
  • Category: ASP.Net MVC

    How to Solve the type exists in both dlls error in WebAPI?

    I am getting below error after installing Odata pkg.


    The type 'System.Web.Http.SingleResult<T>' exists in both 'c:\Users\UserName\Documents\Visual Studio 2013\Projects\ODataSampleApps\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll' and 'c:\Users\UserName\Documents\Visual Studio 2013\Projects\ODataSampleApps\packages\Microsoft.AspNet.WebApi.OData.5.0.0\lib\net45\System.Web.Http.OData.dll' c:\users\UserName\documents\visual studio 2013\Projects\ODataSampleApps\ODataSampleApps\Controllers\GamesController.cs 39 16 ODataSampleApps


    Suggest how to resolve this issue
  • #763882
    You can try to merge two dll's into one
    You also use the following command to merge two dll's into one.


    Aspnet_merge C:\DLLFolder -o MyApp.dll

    By Nathan
    Direction is important than speed

  • #763890
    Hai Jeevan,
    This is called as Ambiguous reference error. Sometimes this kind of error comes when there is an old assembly exists somewhere in the cache.
    So you need to remove the old assembly cache. Go to the below path:

    C:\Windows\Microsoft.NET\Framework64\vx.x.xxxx\Temporary ASP.NET Files
    and then delete all the files in the folder.
    Hope it will be helpful to you.

    Regards,
    Pawan Awasthi(DNS MVM)
    +91 8123489140 (whatsApp), +60 14365 1476(Malaysia)
    pawansoftit@gmail.com

  • #763932
    Just go to below path and try to delete all folders from that path, after that restart IIS, it will resolve the issue
    go to
    C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files'
    Here search for folder with the same name as your virtual directory and then delete it

    Thanks
    Koolprasd2003
    Editor, DotNetSpider MVM
    Microsoft MVP 2014 [ASP.NET/IIS]


Sign In to post your comments