Failed loading project because of IsOsPlatform function in build condition

Hi all,


I have some old projects in c# 4.6.1 which are using mongo.

To Connect to mongo its using internally some lib named "Libmongocrypt".
This seems to have a build condition:

<ItemGroup Condition="$([MSBuild]::IsOsPlatform('Windows'))">
<Content Include="$(MSBuildThisFileDirectory)../x64/native/windows/mongocrypt.dll">

As far as I understand the condition can not be evaluated. The Proeject works fine within VisualStudio 2015/2017 but does not work in Rider 2020.2.4.

My error message is:

17:11 Project '*************' load failed
[MSB4186] Ungültige Aufrufsyntax für statische Methode: "[MSBuild]::IsOsPlatform('Windows')". Die Methode "[MSBuild]::IsOsPlatform" konnte nicht gefunden werden. Für den Aufruf statischer Methoden muss folgendes Format verwendet werden: $([vollständiger Typname]::Methode()), z. B. $([System.IO.Path]::Combine(`a`, `b`))
**************\source\packages\MongoDB.Libmongocrypt.1.0.0\build\MongoDB.Libmongocrypt.targets at (4:16)

Can anyone help?

Thank you.

Please sign in to leave a comment.