missing System.Object
when use CodeAnalysis to generate the exe file in PowerShell Core
#71519
Unanswered
steve02081504
asked this question in
Q&A
Replies: 1 comment 1 reply
-
You are referencing runtime assembly, instead of reference assembly. In .NET Core, the actually loaded assemblies at runtime are not meant to be used as compilation reference. The reference assemblies are at |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've tried porting ps12exe from CodeDom-based to CodeAnalysis in the quest for better cross-platform results.
I'm not skilled in c# or even powershell itself, but I tried to write an implementation of it
code: https://github.com/steve02081504/ps12exe/blob/b4ef7ec7796d66f60acbcef8498eda3bfcff971f/src/CodeAnalysisCompiler.ps1
The problem is when I try to compile the file:
As you can see, some basic types are not defined.
But in my code I included
System.Runtime
andmscorlib
, so I don't understand why this is happening at all.Can anyone help me?
powershell info:
Beta Was this translation helpful? Give feedback.
All reactions