Alternatively
You can compile the .js into a library via the command line thusly :
jsc /t:library yourfilename.js
this will create yourfilename.dll
add this dll into the references section of your other projects and you will be away .
The JSC compiler comes standard with the .NET framework and you dont need JS.Net if you do this.
- Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
- Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!
Collapse
You are not logged in or you do not have permission to access this page. This could be due to one of several reasons:
- You are not logged in. If you are already registered, fill in the form below to log in, or follow the "Sign Up" link to register a new account.
- You may not have sufficient privileges to access this page. Are you trying to edit someone else's post, access administrative features or some other privileged system?
- If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation.
Logging in...
Previously on "Cross Inheritance With .NET Can Anybody Help"
Collapse
-
Guest replied
-
Guest repliedYou need to create a JS.NEt project
Writing JS code in a cs file will not work. From your post it appears that your Visual Studio version doesn't have JS.Net installed . if it does , you will see a new JS project option when you try to create a New project.
You need to do that and compile the JS project before it can be cross referenced and inherited from . But it should work.
Leave a comment:
-
Guest repliedtry www.experts-exchange.com
I post there and get good answers within a few hours.
Don't have experience with JScript.Net
Leave a comment:
-
Cross Inheritance With .NET Can Anybody Help
1. Created a Solution
2. Added a vb project
3. Added a cs project
4. In the cs project Add a reference to our vb project by using the Project | Add Reference menu option.
' Parent.vb which makes the dll called vblib1 see (2.)
Public Class Parent
Public Sub New()
MsgBox("Constructor Parent")
End Sub
End Class
// Form1.cs
using System;
namespace cslib
{
using vblib1;
using System.Windows.Forms;
public class Form1 : Parent                
{
        public Form1()
        {
                MessageBox.Show("Form1 constructor");
        }
       
        public static void Main(System.String[] args)
        {
                Form1 f = new Form1();
        }
}
}
Now this works but what I really want to do is inherit JavaScript From CSharp
So I created a new solution and two cs projects ( how do you create a js project )
// ServerPush.js
import System;
package ServerPush
{               
public class jsServerPush
{
        function lib_setdata( vKey:String,
        vCode:String,
                vData:String ) : void
        {
                        //alert(vKey);
                        //alert(vCode);
                        //alert(vData);
        var y:int;
var x:int;
y=0;
        for ( x=0; x<10; x++)
{                       
                y = y + x;
        }
        }
}
}
// Mediator.cs
namespace montego.webserving.******
{
using ServerPush;
using System;
public class Mediator : jsServerPush        
{
        public Mediator()
        {
        System.String[] xargs = new System.String[3];
        xargs[ 0 ]= "Interface";
        xargs[1]= "Being";
        xargs[2]= "Called";
       
lib_setdata( xargs[ 0 ], xargs[1], xargs[2] );
        }
       
        public static void Main(System.String[] args)
        {
                Mediator f = new Mediator();
        }
}
}
But This causes a problem with ' using ServerPush '
Anybody know about this stuff ??Tags: None
- Home
- News & Features
- First Timers
- IR35 / S660 / BN66
- Employee Benefit Trusts
- Agency Workers Regulations
- MSC Legislation
- Limited Companies
- Dividends
- Umbrella Company
- VAT / Flat Rate VAT
- Job News & Guides
- Money News & Guides
- Guide to Contracts
- Successful Contracting
- Contracting Overseas
- Contractor Calculators
- MVL
- Contractor Expenses
Advertisers
Contractor Services
CUK News
- Who owns the loans? Inside the mystery of the loan charge recall scandal Today 06:20
- Umbrella company winding-up petitions in 2026: the practical guide for contractors Yesterday 05:29
- Payments on Account deadline: what contractors must do before July 31st — maybe for the final few times Jul 28 08:01
- Andy Burnham's first 100 days: five things contractors need from the new PM Jul 27 00:53
- Starmer vs Burnham on housing: What their rival plans mean for your contractor mortgage Jul 22 00:59
- Burnham's housing vision vs. Starmer's home-buying reforms: what it means for your contractor mortgage Jul 22 00:59
- In Khalil v Innovate Transport, a limited company contractor wasn’t a worker and was on £2.30 — not £230 Jul 21 07:58
- Andy Burnham is PM: 5 new IT policies set to shape UK tech and its contractors Jul 20 06:29
- Taxed on money I haven't earned yet? Bold move, HMRC Jul 17 08:36
- The Fair Work Agency has got zero hours in its sights. Do you? Jul 16 08:44

Leave a comment: