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:
-
Guest started a topic Cross Inheritance With .NET Can Anybody HelpCross 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
- Streamline Your Retirement with iSIPP: A Solution for Contractor Pensions Sep 1 09:13
- Making the most of pension lump sums: overview for contractors Sep 1 08:36
- Umbrella company tribunal cases are opening up; are your wages subject to unlawful deductions, too? Aug 31 08:38
- Contractors, relabelling 'labour' as 'services' to appear 'fully contracted out' won't dupe IR35 inspectors Aug 31 08:30
- How often does HMRC check tax returns? Aug 30 08:27
- Work-life balance as an IT contractor: 5 top tips from a tech recruiter Aug 30 08:20
- Autumn Statement 2023 tipped to prioritise mental health, in a boost for UK workplaces Aug 29 08:33
- Final reminder for contractors to respond to the umbrella consultation (closing today) Aug 29 08:09
- Top 5 most in demand cyber security contract roles Aug 25 08:38
- Changes to the right to request flexible working are incoming, but how will contractors be affected? Aug 24 08:25
Leave a comment: