in a .NET 4.x C# project to dynamically execute .NET 9 code?

Open
#34 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Quiet
Tech stack
csharp, powershell

Research direction

Start by reading the project's runtime-compilation and scripting entry points; no specific file or test is named in the issue. Compare the .NET 4.8 and .NET 9 environments with the provided PowerShell example, and establish whether this cross-runtime scenario is supported or what compatibility limitation must be documented.

Written by the indexing model from the issue text.

Description

Thank you for sharing this useful project.

I would like to know whether it is possible to use the westwind.script component in a .NET 4.x C# project to dynamically execute .NET 9 code.

My system environment:

  • .NET 4.8.0 runtime
  • .NET 9.0 runtime

By using the following code, I am able to execute .NET 9 code under PowerShell 5.1 (.NET 4.5).

pwsh -c {
$code = @'
using System;
public static class __cla
{
 public static void __fun()
 {
     Console.WriteLine("hello from .NET9!");
 }
}
'@
Add-Type -TypeDefinition $code -ReferencedAssemblies 'System.Console'
[__cla]::__fun()
}
Dominant language
C#
Stars
256
Forks
47
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from RickStrahl/Westwind.Scripting

All issues in RickStrahl/Westwind.Scripting

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.