Skip to main content
Notice removed Draw attention by CommunityBot
Bounty Ended with no winning answer by CommunityBot
Notice added Draw attention by Chris Bordeman
Bounty Started worth 100 reputation by Chris Bordeman
added 75 characters in body
Source Link

In my VSIX (VS Extension), I am reading the config properties' .Value of each of the projects in the currently loaded solution. For a C# (csproj) project:

var configurationManager = project.ConfigurationManager;
if (configurationManager == null) return null;
var configuration = configurationManager.ActiveConfiguration;
if (configuration == null) return null;
var properties = configuration.Properties;
if (properties == null) return null;

foreach (var property in properties.Cast<Property>())
{
    // reading property.Name is OK but reading property.Value gives the COMException 'not implemented'
    if (property == null) continue;
    if (property.Name == "StartWorkingDirectory") workingDir = (string)property.Value;
    if (property.Name == "StartAction") startProject = 0 == (int)property.Value;
    if (property.Name == "StartProgram") startExtProg = (string)property.Value;
    if (property.Name == "StartURL") startBrowser = (string)property.Value;
    // etc...
}

For every property, I get the COMException: 'The method or operation is not implemented' when I try to read the .Value property, though .Name is fine. All the searched for properties seem to exist, their .Value just can't be read.

This is a brand new VSIX project created with the VS2022 template that includes Microsoft.VisualStudio.SDK and the Microsoft.VisualStudio.BuildTools in the references.

That seems to include every DTE* reference, stdole, and the other VS COM dlls like VSLangProj* (If I try to add these as project references, it says they're already included in the build process). So, I tried adding all those references via nuget packages, but it had no effect I could see and the error remains.

So I can't find anything on how to read these properties on my C# projects (csproj). They're simple C# 8 Console applications, empty that I just created.

Here are all my VSIX project's references, including the ones pulled in by nuget but probably don't need to be:

envdte
envdte80
envdte90
Microsoft.CSharp
Microsoft.VisualStudio.CommandBars
Microsoft.VisualStudio.SDK
Microsoft.VSSDK.BuildTools
NJsonSchema
PresentationCore
PresentationFramework
stdole
System
VSLangProj
VSLangProj100
VSLangProj110
VSLangProj140
VSLangProj150
VSLangProj80
VSLangProj90
WindowsBase
WindowsFormsIntegration

I'm using VS2022, fully updated as of March 2024.

Any ideas?

EDIT: Source at: https://github.com/cbordeman/switchstartupproject/pull/4

In my VSIX (VS Extension), I am reading the config properties' .Value of each of the projects in the currently loaded solution. For a C# (csproj) project:

var configurationManager = project.ConfigurationManager;
if (configurationManager == null) return null;
var configuration = configurationManager.ActiveConfiguration;
if (configuration == null) return null;
var properties = configuration.Properties;
if (properties == null) return null;

foreach (var property in properties.Cast<Property>())
{
    // reading property.Name is OK but reading property.Value gives the COMException 'not implemented'
    if (property == null) continue;
    if (property.Name == "StartWorkingDirectory") workingDir = (string)property.Value;
    if (property.Name == "StartAction") startProject = 0 == (int)property.Value;
    if (property.Name == "StartProgram") startExtProg = (string)property.Value;
    if (property.Name == "StartURL") startBrowser = (string)property.Value;
    // etc...
}

For every property, I get the COMException: 'The method or operation is not implemented' when I try to read the .Value property, though .Name is fine. All the searched for properties seem to exist, their .Value just can't be read.

This is a brand new VSIX project created with the VS2022 template that includes Microsoft.VisualStudio.SDK and the Microsoft.VisualStudio.BuildTools in the references.

That seems to include every DTE* reference, stdole, and the other VS COM dlls like VSLangProj* (If I try to add these as project references, it says they're already included in the build process). So, I tried adding all those references via nuget packages, but it had no effect I could see and the error remains.

So I can't find anything on how to read these properties on my C# projects (csproj). They're simple C# 8 Console applications, empty that I just created.

Here are all my VSIX project's references, including the ones pulled in by nuget but probably don't need to be:

envdte
envdte80
envdte90
Microsoft.CSharp
Microsoft.VisualStudio.CommandBars
Microsoft.VisualStudio.SDK
Microsoft.VSSDK.BuildTools
NJsonSchema
PresentationCore
PresentationFramework
stdole
System
VSLangProj
VSLangProj100
VSLangProj110
VSLangProj140
VSLangProj150
VSLangProj80
VSLangProj90
WindowsBase
WindowsFormsIntegration

I'm using VS2022, fully updated as of March 2024.

Any ideas?

In my VSIX (VS Extension), I am reading the config properties' .Value of each of the projects in the currently loaded solution. For a C# (csproj) project:

var configurationManager = project.ConfigurationManager;
if (configurationManager == null) return null;
var configuration = configurationManager.ActiveConfiguration;
if (configuration == null) return null;
var properties = configuration.Properties;
if (properties == null) return null;

foreach (var property in properties.Cast<Property>())
{
    // reading property.Name is OK but reading property.Value gives the COMException 'not implemented'
    if (property == null) continue;
    if (property.Name == "StartWorkingDirectory") workingDir = (string)property.Value;
    if (property.Name == "StartAction") startProject = 0 == (int)property.Value;
    if (property.Name == "StartProgram") startExtProg = (string)property.Value;
    if (property.Name == "StartURL") startBrowser = (string)property.Value;
    // etc...
}

For every property, I get the COMException: 'The method or operation is not implemented' when I try to read the .Value property, though .Name is fine. All the searched for properties seem to exist, their .Value just can't be read.

This is a brand new VSIX project created with the VS2022 template that includes Microsoft.VisualStudio.SDK and the Microsoft.VisualStudio.BuildTools in the references.

That seems to include every DTE* reference, stdole, and the other VS COM dlls like VSLangProj* (If I try to add these as project references, it says they're already included in the build process). So, I tried adding all those references via nuget packages, but it had no effect I could see and the error remains.

So I can't find anything on how to read these properties on my C# projects (csproj). They're simple C# 8 Console applications, empty that I just created.

Here are all my VSIX project's references, including the ones pulled in by nuget but probably don't need to be:

envdte
envdte80
envdte90
Microsoft.CSharp
Microsoft.VisualStudio.CommandBars
Microsoft.VisualStudio.SDK
Microsoft.VSSDK.BuildTools
NJsonSchema
PresentationCore
PresentationFramework
stdole
System
VSLangProj
VSLangProj100
VSLangProj110
VSLangProj140
VSLangProj150
VSLangProj80
VSLangProj90
WindowsBase
WindowsFormsIntegration

I'm using VS2022, fully updated as of March 2024.

Any ideas?

EDIT: Source at: https://github.com/cbordeman/switchstartupproject/pull/4

added 181 characters in body
Source Link

In my VSIX (VS Extension), I am reading the config properties' .Value of each of the projects in the currently loaded solution. For a C# (csproj) project:

var configurationManager = project.ConfigurationManager;
if (configurationManager == null) return null;
var configuration = configurationManager.ActiveConfiguration;
if (configuration == null) return null;
var properties = configuration.Properties;
if (properties == null) return null;

foreach (var property in properties.Cast<Property>())
{
    // reading property.Name is OK but reading property.Value gives the COMException 'not implemented'
    if (property == null) continue;
    if (property.Name == "StartWorkingDirectory") workingDir = (string)property.Value;
    if (property.Name == "StartAction") startProject = 0 == (int)property.Value;
    if (property.Name == "StartProgram") startExtProg = (string)property.Value;
    if (property.Name == "StartURL") startBrowser = (string)property.Value;
    // etc...
}

For every property, I get the COMException: 'The method or operation is not implemented' when I try to read the .Value property, though .Name is fine. All the searched for properties seem to exist, their .Value just can't be read.

This is a brand new VSIX project created with the VS2022 template that includes Microsoft.VisualStudio.SDK and the Microsoft.VisualStudio.BuildTools in the references.

That seems to include every DTE* reference, stdole, and the other VS COM dlls like VSLangProj* (If I try to add these as project references, it says they're already included in the build process). So, I tried adding all those references via nuget packages, but it had no effect I could see and the error remains.

So I can't find anything on how to read these properties on my C# projects (csproj). They're simple C# 8 Console applications, empty that I just created.

Here are all my VSIX project's references, including the ones pulled in by nuget but probably don't need to be:

envdte
envdte80
envdte90
Microsoft.CSharp
Microsoft.VisualStudio.CommandBars
Microsoft.VisualStudio.SDK
Microsoft.VSSDK.BuildTools
NJsonSchema
PresentationCore
PresentationFramework
stdole
System
VSLangProj
VSLangProj100
VSLangProj110
VSLangProj140
VSLangProj150
VSLangProj80
VSLangProj90
WindowsBase
WindowsFormsIntegration

I'm using VS2022, fully updated as of March 2024.

Any ideas?

In my VSIX (VS Extension), I am reading the config properties' .Value of each of the projects in the currently loaded solution. For a C# (csproj) project:

var configurationManager = project.ConfigurationManager;
if (configurationManager == null) return null;
var configuration = configurationManager.ActiveConfiguration;
if (configuration == null) return null;
var properties = configuration.Properties;
if (properties == null) return null;

foreach (var property in properties.Cast<Property>())
{
    // reading property.Name is OK but reading property.Value gives the COMException 'not implemented'
    if (property == null) continue;
    if (property.Name == "StartWorkingDirectory") workingDir = (string)property.Value;
    if (property.Name == "StartAction") startProject = 0 == (int)property.Value;
    if (property.Name == "StartProgram") startExtProg = (string)property.Value;
    if (property.Name == "StartURL") startBrowser = (string)property.Value;
    // etc...
}

For every property, I get the COMException: 'The method or operation is not implemented' when I try to read the .Value property, though .Name is fine. All the searched for properties seem to exist, their .Value just can't be read.

This is a brand new VSIX project created with the VS2022 template that includes Microsoft.VisualStudio.SDK and the Microsoft.VisualStudio.BuildTools in the references.

That seems to include every DTE* reference, stdole, and the other VS COM dlls like VSLangProj* (If I try to add these as project references, it says they're already included in the build process). So, I tried adding all those references via nuget packages, but it had no effect I could see and the error remains.

So I can't find anything on how to read these properties on my C# projects (csproj). They're simple C# 8 Console applications, empty that I just created.

Here are all my project's references, including the ones pulled in by nuget but probably don't need to be:

envdte
envdte80
envdte90
Microsoft.CSharp
Microsoft.VisualStudio.CommandBars
Microsoft.VisualStudio.SDK
Microsoft.VSSDK.BuildTools
NJsonSchema
PresentationCore
PresentationFramework
stdole
System

I'm using VS2022, fully updated as of March 2024.

Any ideas?

In my VSIX (VS Extension), I am reading the config properties' .Value of each of the projects in the currently loaded solution. For a C# (csproj) project:

var configurationManager = project.ConfigurationManager;
if (configurationManager == null) return null;
var configuration = configurationManager.ActiveConfiguration;
if (configuration == null) return null;
var properties = configuration.Properties;
if (properties == null) return null;

foreach (var property in properties.Cast<Property>())
{
    // reading property.Name is OK but reading property.Value gives the COMException 'not implemented'
    if (property == null) continue;
    if (property.Name == "StartWorkingDirectory") workingDir = (string)property.Value;
    if (property.Name == "StartAction") startProject = 0 == (int)property.Value;
    if (property.Name == "StartProgram") startExtProg = (string)property.Value;
    if (property.Name == "StartURL") startBrowser = (string)property.Value;
    // etc...
}

For every property, I get the COMException: 'The method or operation is not implemented' when I try to read the .Value property, though .Name is fine. All the searched for properties seem to exist, their .Value just can't be read.

This is a brand new VSIX project created with the VS2022 template that includes Microsoft.VisualStudio.SDK and the Microsoft.VisualStudio.BuildTools in the references.

That seems to include every DTE* reference, stdole, and the other VS COM dlls like VSLangProj* (If I try to add these as project references, it says they're already included in the build process). So, I tried adding all those references via nuget packages, but it had no effect I could see and the error remains.

So I can't find anything on how to read these properties on my C# projects (csproj). They're simple C# 8 Console applications, empty that I just created.

Here are all my VSIX project's references, including the ones pulled in by nuget but probably don't need to be:

envdte
envdte80
envdte90
Microsoft.CSharp
Microsoft.VisualStudio.CommandBars
Microsoft.VisualStudio.SDK
Microsoft.VSSDK.BuildTools
NJsonSchema
PresentationCore
PresentationFramework
stdole
System
VSLangProj
VSLangProj100
VSLangProj110
VSLangProj140
VSLangProj150
VSLangProj80
VSLangProj90
WindowsBase
WindowsFormsIntegration

I'm using VS2022, fully updated as of March 2024.

Any ideas?

added 2 characters in body
Source Link

In my VSIX (VS Extension), I am reading the config propertiesproperties' .Value of each of the projects in the currently loaded solution. For a C# (csproj) project:

var configurationManager = project.ConfigurationManager;
if (configurationManager == null) return null;
var configuration = configurationManager.ActiveConfiguration;
if (configuration == null) return null;
var properties = configuration.Properties;
if (properties == null) return null;

foreach (var property in properties.Cast<Property>())
{
    // reading property.Name is OK but reading property.Value gives the COMException 'not implemented'
    if (property == null) continue;
    if (property.Name == "StartWorkingDirectory") workingDir = (string)property.Value;
    if (property.Name == "StartAction") startProject = 0 == (int)property.Value;
    if (property.Name == "StartProgram") startExtProg = (string)property.Value;
    if (property.Name == "StartURL") startBrowser = (string)property.Value;
    // etc...
}

For every property, I get the COMException: 'The method or operation is not implemented' when I try to read itthe .Value property, though .Name is fine. All the searched for properties seem to exist, their .Value just can't be read.

This is a brand new VSIX project created with the newVS2022 template that includes It has the Microsoft.VisualStudio.SDK and the Microsoft.VisualStudio.BuildTools in the references.

That seems to include every DTE* reference, stdole, and the other VS COM dlls like VSLangProj* (If I try to add these as project references, it says they're already included in the build process). So, I tried adding everythingall those references via nuget packages, whichbut it had no effect I could see;see and the error remains.

So I can't find anything on how to read these properties on my C# projects (csproj). They're simple C# 8 Console applications, empty that I just created.

Here are all my project's references, including the ones pulled in by nuget but probably don't need to be:

envdte
envdte80
envdte90
Microsoft.CSharp
Microsoft.VisualStudio.CommandBars
Microsoft.VisualStudio.SDK
Microsoft.VSSDK.BuildTools
NJsonSchema
PresentationCore
PresentationFramework
stdole
System

I'm using VS2022, fully updated as of March 2024.

Any ideas?

In my VSIX (VS Extension), I am reading the config properties of each of the projects in the currently loaded solution. For a C# (csproj) project:

var configurationManager = project.ConfigurationManager;
if (configurationManager == null) return null;
var configuration = configurationManager.ActiveConfiguration;
if (configuration == null) return null;
var properties = configuration.Properties;
if (properties == null) return null;

foreach (var property in properties.Cast<Property>())
{
    if (property == null) continue;
    if (property.Name == "StartWorkingDirectory") workingDir = (string)property.Value;
    if (property.Name == "StartAction") startProject = 0 == (int)property.Value;
    if (property.Name == "StartProgram") startExtProg = (string)property.Value;
    if (property.Name == "StartURL") startBrowser = (string)property.Value;
    // etc...
}

For every property, I get the COMException: 'The method or operation is not implemented' when I try to read it.

This is a brand new VSIX project with the new template that includes It has the Microsoft.VisualStudio.SDK and the Microsoft.VisualStudio.BuildTools

That seems to include every DTE* reference, stdole, and the other VS COM dlls like VSLangProj* (If I try to add these as project references, it says they're already included in the build process. So, I tried adding everything via nuget packages, which had no effect I could see; the error remains.

So I can't find anything on how to read these properties on my C# projects (csproj). They're simple C# 8 Console applications, empty that I just created.

I'm using VS2022, fully updated as of March 2024.

Any ideas?

In my VSIX (VS Extension), I am reading the config properties' .Value of each of the projects in the currently loaded solution. For a C# (csproj) project:

var configurationManager = project.ConfigurationManager;
if (configurationManager == null) return null;
var configuration = configurationManager.ActiveConfiguration;
if (configuration == null) return null;
var properties = configuration.Properties;
if (properties == null) return null;

foreach (var property in properties.Cast<Property>())
{
    // reading property.Name is OK but reading property.Value gives the COMException 'not implemented'
    if (property == null) continue;
    if (property.Name == "StartWorkingDirectory") workingDir = (string)property.Value;
    if (property.Name == "StartAction") startProject = 0 == (int)property.Value;
    if (property.Name == "StartProgram") startExtProg = (string)property.Value;
    if (property.Name == "StartURL") startBrowser = (string)property.Value;
    // etc...
}

For every property, I get the COMException: 'The method or operation is not implemented' when I try to read the .Value property, though .Name is fine. All the searched for properties seem to exist, their .Value just can't be read.

This is a brand new VSIX project created with the VS2022 template that includes Microsoft.VisualStudio.SDK and the Microsoft.VisualStudio.BuildTools in the references.

That seems to include every DTE* reference, stdole, and the other VS COM dlls like VSLangProj* (If I try to add these as project references, it says they're already included in the build process). So, I tried adding all those references via nuget packages, but it had no effect I could see and the error remains.

So I can't find anything on how to read these properties on my C# projects (csproj). They're simple C# 8 Console applications, empty that I just created.

Here are all my project's references, including the ones pulled in by nuget but probably don't need to be:

envdte
envdte80
envdte90
Microsoft.CSharp
Microsoft.VisualStudio.CommandBars
Microsoft.VisualStudio.SDK
Microsoft.VSSDK.BuildTools
NJsonSchema
PresentationCore
PresentationFramework
stdole
System

I'm using VS2022, fully updated as of March 2024.

Any ideas?

added 2 characters in body
Source Link
Loading
Source Link
Loading