Has anyone successfully installed Roslyn nuget packages on projects with target framework 4.5.2?
I am trying to install Microsoft.CodeAnalysis.CSharp.Scripting package, but havent seen success yet. It fails due to various dependent assemblies.
Please let me know if you have installed any Roslyn build on framework > 4.5
I took a look into Cake build system project, they use C# scripting and whole thing runs on .Net 4.5. The secret behind this is:
<package id="Microsoft.CodeAnalysis.Scripting.CSharp" version="1.0.0-rc2" targetFramework="net45" />
I guess rc2 was compiled against .Net 4.5 so it should work.
Example packages.config
:
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.CodeAnalysis.Analyzers" version="1.0.0-rc2" targetFramework="net452" />
<package id="Microsoft.CodeAnalysis.Common" version="1.0.0-rc2" targetFramework="net452" />
<package id="Microsoft.CodeAnalysis.CSharp" version="1.0.0-rc2" targetFramework="net452" />
<package id="Microsoft.CodeAnalysis.Scripting.Common" version="1.0.0-rc2" targetFramework="net452" />
<package id="Microsoft.CodeAnalysis.Scripting.CSharp" version="1.0.0-rc2" targetFramework="net452" />
<package id="System.Collections.Immutable" version="1.1.33-beta" targetFramework="net452" />
<package id="System.Reflection.Metadata" version="1.0.18-beta" targetFramework="net452" />
</packages>
Or using the Package Management Console:
Install-Package Microsoft.CodeAnalysis.CSharp -Version 1.0.0-rc2 -IncludePrerelease
Install-Package Microsoft.CodeAnalysis.Scripting.CSharp -Version 1.0.0-rc2 -IncludePrerelease
Scripting requires fixes made as part of .Net 4.6.
Microsoft.CodeAnalysis.CSharp.Scripting latest version 1.2.1 (and previous versions) does not support library of 4.5. It requires at least .net 4.6.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With