tyranid / DotNetToJScript

A tool to create a JScript file which loads a .NET v2 assembly from memory.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This tool should only be run on v2 of the CLR error

fanbyprinciple opened this issue · comments

when pulling from github and loading DotNetToJScript in visual studio and compiling I get the error.

PS C:\Users\misthios\codeplay\pen300\book\chapter4> ./DotNetToJScript.exe ExampleAssembly.dll --lang=Jscript --ver=auto -o demo.js
This tool should only be run on v2 of the CLR

my specifications

PS C:\Users\misthios\codeplay\pen300\book\chapter4> $PSVersionTable
>>

Name                           Value
----                           -----
PSVersion                      5.1.19041.1682
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.19041.1682
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

The error want me to run v2 that is understandable, however there is no immediate resources how to remedy this. Tried installing .NET 3.5 manually that did not work.

However getting the files from release and running it opens up system dialog to install net 3.5. Shouldn't this be the ideal behaviour?

commented

Did you solve this issue?

I solved the issue by commenting on the lines of DotNetToJScript\Program.cs

                if (Environment.Version.Major != 2)
                {
                    WriteError("This tool should only be run on v2 of the CLR");
                    Environment.Exit(1);
                }

After commenting on the lines, and rebuilding the solution the program worked without a problem:

.\DotNetToJScript.exe ExampleAssembly.dll --lang=Jscript --ver=v4 -o demo.js