Debugging MVC C# app created in VS2017 on VS2022

Zalek bloom 1 Reputation point
2023-01-03T15:40:54.137+00:00

About 6 years ago I created a web site using MVS C# and VS2017. There were some changes on the web server and the web site is not working, so I decided to redeploy the app.

When I opened VS2017 I got:
Your license has expired.
Check for an updated license
We could not download a license. Please check your network

After searching the web and trying different solution I gave up - here are solutions I tried:
https://pupuweb.com/solved-visual-studio-community-license-expired-evaluation-period-ended/#ie11

So I downloaded  VS2022 community edition, but now I found different problems:

I cannot debug the app on the local server, the only options I see is to debug it on the sever where I deployed the app the ago 6 years ago.
What is weird, when I created a new project in VS2022 there is working option to debug on IIS Express.
By comparing my old project with a newly created project I see the old project has:
Web.Config
Web.Debug.config
Web.Release.config

These file are missing in the new created project in VS2022

So what do I need to change in my old project in order to debug my app on IIS Express on VS2022?

Thanks,

zb

Developer technologies | ASP.NET | Other
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Michael Taylor 60,161 Reputation points
    2023-01-03T16:28:54.17+00:00

    You don't need to change anything as nothing in your project is actually tied to IIS Express. After opening your project in VS 2022 go to the project's property settings. Under Web you should see the debugger options. Under Servers set it to use IIS Express. Set the project Url to what you need (you may need to create the virtual directory as well). It depends on whether you're using SSL or not as to what this gets set to. Ensure you have this applied to all users so the settings are stored in the project file so you don't have to do this again.

    275811-image.png

    Finally bring up the Properties window (F4) and select the project in Solution Explorer. Ensure the Always start when debugging option is set, enable/disable the authentication your site needs and, if you're using SSL, then enable it. Ensure the URLs (SSL or non) matches what the project URL was in the project properties.

    275773-image.png

    Then try running the app again using F5.

    0 comments No comments

  2. Lan Huang-MSFT 30,186 Reputation points Microsoft External Staff
    2023-01-04T07:54:08.74+00:00

    Hi @Zalek bloom ,
    I think you can check if the current build configuration is shown on the toolbar.
    275936-image.png
    How to debug ASP.NET in Visual Studio, detailed steps can be found in the document.
    https://learn.microsoft.com/en-us/visualstudio/debugger/how-to-enable-debugging-for-aspnet-applications?view=vs-2022#debug-aspnet-apps
    Best regards,
    Lan Huang


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.