Skip to content

Commit

Permalink
Use msbuild dll path where applicable for obtaining appropriate versi…
Browse files Browse the repository at this point in the history
…on (#665)
  • Loading branch information
mruxmohan4 authored Feb 19, 2025
1 parent 7d25c03 commit 86299f8
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/Microsoft.VisualStudio.SlnGen/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,13 @@ internal static int Execute(ProgramArguments arguments, IConsole console)

bool useSimpleCache = true;

var msbuildVersion = FileVersionInfo.GetVersionInfo(CurrentDevelopmentEnvironment.MSBuildExe.FullName);
#if NETFRAMEWORK
string msBuildPath = CurrentDevelopmentEnvironment.MSBuildExe.FullName;
#else
string msBuildPath = CurrentDevelopmentEnvironment.MSBuildDll.FullName;
#endif

var msbuildVersion = FileVersionInfo.GetVersionInfo(msBuildPath);

// Work around https://github.com/dotnet/msbuild/issues/11394 by falling back to the slower PRE cache
// on known-affected MSBuild versions (this should be much more tightly scoped after that bug is fixed).
Expand All @@ -159,11 +165,7 @@ internal static int Execute(ProgramArguments arguments, IConsole console)
CacheFileEnumerations = true,
LoadAllFilesAsReadOnly = true,
UseSimpleProjectRootElementCacheConcurrency = useSimpleCache,
#if NETFRAMEWORK
MSBuildExePath = CurrentDevelopmentEnvironment.MSBuildExe.FullName,
#else
MSBuildExePath = CurrentDevelopmentEnvironment.MSBuildDll.FullName,
#endif
MSBuildExePath = msBuildPath,
};

LoggerVerbosity verbosity = ForwardingLogger.ParseLoggerVerbosity(arguments.Verbosity?.LastOrDefault());
Expand Down

0 comments on commit 86299f8

Please sign in to comment.