Specify Framework version for CSharpCompilation.Emit

Does anyone know if Framework-Version can be specified when releasing collections using CSharpCompilation extensionmethod Emit?

We need to configure 4.5.1, because otherwise we get an unpleasant runtime error:

MissingMethodException
Method not found: '!!0[] System.Array.Empty()'.

Or do we need to wait for clients to upgrade to Framework 4.6 before we can use Roslyn?

+4
source share
1 answer

( ) " ". , . , 4.6 Framework (, - , 4.6).

, 4.5.1 (VS install , ) C:\Program Files (x86)\Reference Assemblies.

Array.Empty, , , .

+5

Source: https://habr.com/ru/post/1619820/


All Articles