Eventually, I've found the solution myself. It is to put:
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
in csproj
file, under appropriate PropertyGroup
(related to the configuration xbuild
is using to build the solution). It is correctly interpreted and unsafe
code compiles fine.