Asp.net web api exception only after deploying at IIS : A route named 'HelpPage_Default' is already in the route collection

后端 未结 6 823
孤独总比滥情好
孤独总比滥情好 2021-01-01 09:01

I\'ve read this question and tried the solutions mentioned there but I\'m getting this exception only after i published the application to IIS of a remote server. In my loca

相关标签:
6条回答
  • 2021-01-01 09:22
    1. Right click your solution in Visual Studio -> click Clean Solution
    2. Remove all files under your \Project\bin\ folders
    3. Rebuild your solution in Visual Studio Cheers.
    0 讨论(0)
  • 2021-01-01 09:25

    I had this same issue and tried multiple proposed solutions from different threads with similar issues and got nowhere.

    I finally just checked out a clean copy of the solution from team explorer and that fixed it for me.

    0 讨论(0)
  • 2021-01-01 09:28

    I renamed a Namespace by refactoring it and doing that missed this hardcoded string:

    Project > Areas > HelpPage > AppStart:

    public static class HelpPageConfig
        {
            [SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters",
                MessageId = "<CORRECT NAMESPACE>.Areas.HelpPage.TextSample.#ctor(System.String)",
    
    0 讨论(0)
  • 2021-01-01 09:31

    I just ran into the same issue. I think the error was caused because I had pushed another solution to my site previously and there were leftover files that were somehow getting in the way.

    To fix this I checked the box that says "Remove additional files at destination" while publishing through Visual Studio to my Azure site. I would assume you could just manually delete any old files that were on the server before publishing as well. After this the site ran fine with no errors.

    0 讨论(0)
  • 2021-01-01 09:31

    I have the same issue after renamed the project name. So,

    1. Find & Replace the correct name across the entire solution.
    2. Clean solution
    3. Delete bin & obj folder of the project.
    4. Rebuild solution

    ..yes, it works.

    0 讨论(0)
  • 2021-01-01 09:43

    I had the same issue when deploying application on Local IIS. My publish directory and IIS hosting directory are same. I tried with following steps, it worked for me:

    1. Click on Solution >> publish
    2. Delete existing file>> settings>> expand file publish options
    3. check checkbox Delete all existing files prior to publish is true;
    4. check checkbox Precompile during publishing is true.
    0 讨论(0)
提交回复
热议问题