Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
fanbyprinciple opened this issue Jul 5, 2022 · 3 comments
Open

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

fanbyprinciple opened this issue Jul 5, 2022 · 3 comments

Comments

@fanbyprinciple
Copy link

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?

@wxyzed
Copy link

wxyzed commented Jan 14, 2023

Did you solve this issue?

@Marmeus
Copy link

Marmeus commented May 11, 2023

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

@n3rada
Copy link

n3rada commented Mar 14, 2024

@tyranid, do you still maintain the project?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants