Skip to content

Commit

Permalink
fix(vsix): Don't fail if DTE build information cannot be found
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromelaban authored Apr 19, 2022
1 parent 4c17a03 commit 9363ae3
Showing 1 changed file with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -164,23 +164,24 @@ private void SetUWPAnyCPUBuildableAndDeployable()

private void SetDefaultConfiguration()
{
if (_dte?.Solution.SolutionBuild is SolutionBuild2 val)
try
{
try
if (_dte?.Solution.SolutionBuild is SolutionBuild2 val)
{
var x86Config = val.SolutionConfigurations
.Cast<SolutionConfiguration2>()
.FirstOrDefault(c => c.Name == "Debug" && c.PlatformName == "x86");
var x86Config = val.SolutionConfigurations
.Cast<SolutionConfiguration2>()
.FirstOrDefault(c => c.Name == "Debug" && c.PlatformName == "x86");

x86Config?.Activate();
x86Config?.Activate();
}
catch (Exception)
else
{
// Unable to set the startup project when running from RunFinished since VS 2022 17.2 Preview 2
// throw new InvalidOperationException();
}
}
else
catch (Exception)
{
throw new InvalidOperationException();
}
}

Expand Down

0 comments on commit 9363ae3

Please sign in to comment.