Recently, I have updated my ASP.NET Core MVC application from .NET 6 to .NET 8. The VS 2022 Professional was also updated to version 17.14.7.
After that, when I right-click my web project, which is also the startup project, it throws the error as shown below. Other projects, which are class libraries, do not have this issue. When I run the project, it opens the server in a command prompt, but doesn't load the browser. I have to copy the URL and manually paste it into a browser, and then it loads. I tried to modify the .csproj file similar to the class library project files and deleted temp files such as .vs, bin, and .csproj.user. Still, the issue is happening.
Microsoft.VisualStudio.ProjectSystem.Query.QueryExecutionException:
An exception was thrown while initializing part "Microsoft.VisualStudio.ProjectSystem.Properties.UserFileInterceptedProjectPropertiesProvider".Microsoft.VisualStudio.Composition.CompositionFailedException: An exception was thrown while initializing part "Microsoft.VisualStudio.ProjectSystem.Properties.UserFileInterceptedProjectPropertiesProvider".
System.ArgumentException: 'interceptingValueProviders' must contain at least one element.
Parameter name: interceptingValueProvidersat Microsoft.Requires.NotNullOrEmpty[T](IEnumerable
1 values, String parameterName) at Microsoft.VisualStudio.ProjectSystem.Properties.InterceptedPropertiesProviderBase..ctor(IProjectPropertiesProvider provider, IProjectInstancePropertiesProvider instanceProvider, UnconfiguredProject project, IEnumerable1 interceptingValueProviders)
at Microsoft.VisualStudio.ProjectSystem.Properties.UserFileInterceptedProjectPropertiesProvider..ctor(IProjectPropertiesProvider provider, IProjectInstancePropertiesProvider instanceProvider, UnconfiguredProject project, IEnumerable1 interceptingValueProviders) --- End of inner exception stack trace --- at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker.CreateValue() at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.Create() at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveNext(PartLifecycleState nextState) at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveToState(PartLifecycleState requiredState) at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.GetValueReadyToExpose() at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.ConstructExportedValue(RuntimeImport import, RuntimeExport export, RuntimePartLifecycleTracker importingPartTracker, PartLifecycleTracker partLifecycle, ReportFaultCallback faultCallback) at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.<>c__DisplayClass16_0.<GetExportedValue>b__1() at Microsoft.VisualStudio.Composition.DelegateServices.<>c__DisplayClass2_01.b__0() at System.Lazy1.CreateValue() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Lazy1.get_Value() at Microsoft.VisualStudio.ProjectSystem.PropertyPages.PageRule.GetDataSourceConnector(DataSource dataSource, Boolean& pretranslatedPersistedName, String& defaultProjectPath) at Microsoft.VisualStudio.ProjectSystem.PropertyPages.PageRuleBase.get_DataSourceConnector() at Microsoft.VisualStudio.ProjectSystem.PropertyPages.PageProperty.d__41.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.ProjectSystem.VS.Query.UIPropertyValueDataProducer.d__1.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.ProjectSystem.VS.Query.UIPropertyValueDataProducer.d__0.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Microsoft.VisualStudio.ProjectSystem.VS.Query.UIPropertyValueDataProducer.d__2.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.ProjectSystem.VS.Query.QueryDataFromProviderStateProducerBase1.<SendRequestAsync>d__0.MoveNext() --- End of inner exception stack trace --- at Microsoft.VisualStudio.ProjectSystem.Query.Execution.QuerySubscription1.d__11.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.ProjectSystem.Query.Execution.QuerySubscription1.<>c__DisplayClass10_0.<<Start>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.ProjectSystem.VS.Implementation.PropertyPages.Designer.ProjectPropertyDataAccess.Observer.<InitializeAsync>d__10.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult() at Microsoft.VisualStudio.ProjectSystem.VS.Implementation.PropertyPages.Designer.ProjectPropertyDataAccess.Observer.d__9.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.ProjectSystem.VS.Implementation.PropertyPages.Designer.ProjectPropertiesEditor.<>c__DisplayClass0_0.<<-ctor>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.ProjectSystem.VS.Implementation.PropertyPages.Designer.AsyncLoadContent.<>c__DisplayClass0_0.<b__0>d.MoveNext()