0

I'm trying to use Javascript.NET, but I'm having trouble adding a reference to static classes.

jc.SetParameter("test", Log);

Also, "Log" is a static class.

I get the 'is a type but is used as a variable' error.

5
  • SetParameter expects a variable but you are passing a class Commented Sep 3, 2014 at 16:59
  • How do I reference it then? Commented Sep 3, 2014 at 17:00
  • its unclear what you are trying to do but you need to pass intance of class and you have static class Commented Sep 3, 2014 at 17:00
  • So, how? I cant pass the static instance in there? Commented Sep 3, 2014 at 17:01
  • try new Log() you can call static methods from object anyway Commented Sep 3, 2014 at 17:21

1 Answer 1

1

Static classes cannot be instantiated. You can't pass them as a parameter to methods.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.