Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@
<PackageReference Include="CodingWithCalvin.Otel4Vsix" Version="0.2.2" />
<PackageReference Include="Microsoft.VisualStudio.SDK" Version="17.14.40265" />
<PackageReference Include="Microsoft.VSSDK.BuildTools" Version="17.*" PrivateAssets="all" />
<PackageReference Include="Microsoft.VisualStudio.VCProjectEngine" Version="17.14.40264">
<ForceIncludeInVSIX>true</ForceIncludeInVSIX>
</PackageReference>
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using EnvDTE;
using EnvDTE80;
using Microsoft.VisualStudio.Shell;
using Microsoft.VisualStudio.VCProjectEngine;
using Project = EnvDTE.Project;

namespace CodingWithCalvin.OpenBinFolder.Commands
Expand Down Expand Up @@ -102,9 +101,9 @@ private void OpenProjectBinFolder(Project project)

string projectBinPath;

if (IsCppProject(project.Kind) && project.Object is VCProject vcProject)
if (IsCppProject(project.Kind))
{
projectBinPath = GetCppOutputPath(vcProject, projectPath);
projectBinPath = GetCppOutputPath(project.Object, projectPath);
}
else
{
Expand Down Expand Up @@ -142,16 +141,16 @@ bool IsCppProject(string projectKind)
return string.Equals(projectKind, CppProjectKind, StringComparison.OrdinalIgnoreCase);
}

string GetCppOutputPath(VCProject vcProject, string projectPath)
string GetCppOutputPath(dynamic vcProject, string projectPath)
{
var activeConfig = vcProject.ActiveConfiguration as VCConfiguration;
dynamic activeConfig = vcProject.ActiveConfiguration;
if (activeConfig == null)
{
throw new InvalidOperationException("Unable to get active configuration for C++ project");
}

// Evaluate expands macros like $(OutDir), $(Configuration), $(Platform), etc.
var outDir = activeConfig.Evaluate("$(OutDir)");
string outDir = activeConfig.Evaluate("$(OutDir)");

if (Path.IsPathRooted(outDir))
{
Expand Down
Loading