operation is not valid due to current state of object

Shubham 10 Reputation points
2024-01-20T14:36:17.5633333+00:00

I tried to create a new .net web application project, installed workloads are-> ASP.NET and web development, .NET desktop development, data storage and processing, VS extension development, I just change the location , instead of C:\program\user... I changed it to D:\location... , after installtion, i create a new project , chossing .net web application, select empty template , uncheck https, and check web server, chnage location for project... on clicking create button , it showing error, pic below-> User's image

User's image

User's image

Screenshot (479)

i installed both preview and simple version but same error showing..

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,725 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Tianyu Sun-MSFT 28,066 Reputation points Microsoft Vendor
    2024-01-22T06:25:27.7433333+00:00

    Hello @Shubham,

    Welcome to Microsoft Q&A forum.

    Please try following methods and let us know if this error disappears.

    1. Reboot your machine and test again.
    2. Close VS, navigate to this directory C:\Users\username\AppData\Local\Microsoft\VisualStudio\17.0_XXXXXXXX and delete this folder => ComponentModelCache. Open Developer Command Prompt for VS 2022, run devenv /ResetSettings command.
    3. Close Visual Studio and run Visual Studio as administrator.
    4. Is there any limitation on your machine, like permission limitation, group policy, antivirus software…? Looks like some packages are not correctly loaded.

    Best Regards,

    Tianyu


    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.

    1 person found this answer helpful.