Unable to Cast Solution.Projects to EnvDTE.Project in Visual Studio 2022 - Casting Error
Timi
0
Reputation points
I’m facing an issue where my custom tool fails when trying to access the Solution.Projects
collection and cast its elements to EnvDTE.Project
in Visual Studio 2022. The same code was working in older VS versions without issues, but after upgrading to Visual Studio 2022, I encounter a casting error.
foreach (EnvDTE.Project project in prj.DTE.Solution.Projects)
{
// try to access properties
}
Unable to cast object of type 'Microsoft.VisualStudio.CommonIDE.Solutions.Dte.DteProjects' to type 'EnvDTE.Projects'.
Is this a bug or should I be handling the Solution.Projects
collection differently in VS 2022?
Sign in to answer