You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a need to detect if the specified LanguageTargets file was successfully imported (because it existed).
We had been doing something like this:
<PropertyGroup>
<MSBuildAllProjectsCondition=" '$(MSBuildVersion)' == '' Or '$(MSBuildVersion)' < '16.0' ">$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>
<!-- Need to detect if the expected targets where actually imported and reset to common if not -->
<PropertyGroup>
<_SdkLanguageTargetsMissingCondition="$(MSBuildAllProjects.Contains('Microsoft.Common.targets')) ">false</_SdkLanguageTargetsMissing>
<_SdkLanguageTargetsMissingCondition="'$(_SdkLanguageTargetsMissing)' == ''">true</_SdkLanguageTargetsMissing>
</PropertyGroup>
However, that no longer works since MSBuildAllProjects isn’t set anymore. We was simply looking to see if Common targets was in the list. I can’t do a simple Exists() check earlier on because of the fallback location on Mono/MacOS. That special exists check only works in an Import block, so we can’t do a regular conditional on it to set the variable. Either the import succeeds or its skipped.
The text was updated successfully, but these errors were encountered:
We have a need to detect if the specified LanguageTargets file was successfully imported (because it existed).
We had been doing something like this:
However, that no longer works since
MSBuildAllProjects
isn’t set anymore. We was simply looking to see if Common targets was in the list. I can’t do a simple Exists() check earlier on because of the fallback location on Mono/MacOS. That special exists check only works in an Import block, so we can’t do a regular conditional on it to set the variable. Either the import succeeds or its skipped.The text was updated successfully, but these errors were encountered: