WinWrap.Basic.Server
10.53.20.2
See the version list below for details.
dotnet add package WinWrap.Basic.Server --version 10.53.20.2
NuGet\Install-Package WinWrap.Basic.Server -Version 10.53.20.2
<PackageReference Include="WinWrap.Basic.Server" Version="10.53.20.2" />
<PackageVersion Include="WinWrap.Basic.Server" Version="10.53.20.2" />
<PackageReference Include="WinWrap.Basic.Server" />
paket add WinWrap.Basic.Server --version 10.53.20.2
#r "nuget: WinWrap.Basic.Server, 10.53.20.2"
#:package WinWrap.Basic.Server@10.53.20.2
#addin nuget:?package=WinWrap.Basic.Server&version=10.53.20.2
#tool nuget:?package=WinWrap.Basic.Server&version=10.53.20.2
WinWrap® Basic for .NET 5+ Everywhere
WinWrap® Basic for .NET 5+ Everywhere provides VB.NET scripting in a .NET/8+ object. Any .NET/8+ application can extend the scripting language using .NET/8+ classes.
For more infomation follow this link: https://www.winwrap.com/.
Licensing
WinWrap® Basic is licensed by PolarEngineering®, Inc.
History
PolarEngineering®, Inc. has been marketing WinWrap® Basic for Windows since 1993. Now, with WinWrap® Basic for .NET 5+ Everywhere any .NET 8+ application can utilized WinWrap® Basic scripting. Use WinWrap® Basic to provide VB.NET scripting on Windows, Linux, Macintosh, etc.
Evaluation
Request a WinWrap® Basic evaluation certificate from the "Evaluate" link at https://www.winwrap.com/web2/evaluate/.
Sample Console Application utilizing WinWrap® Basic
using System.Diagnostics;
using System.Reflection;
using WinWrap.Basic.Server;
namespace Test1
{
internal class Program
{
static void Main(string[] args)
{
string root = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) +
Path.DirectorySeparatorChar + "Scripts" + Path.DirectorySeparatorChar;
// create a BasicNoUIObj
using BasicNoUIObj basic_ = new();
// connect WWB.NET Debug.Print to the console
basic.DebugClear += (sender, e) => Console.Clear();
basic.DebugPrint += (sender, e) => Console.Write(e.Text);
// show script errors in the console
basic.ErrorAlert += (sender, e) => Console.WriteLine(basic.Error.ToString());
// three different ways to run WinWrap.Basic.Server
// 1) On Windows:
// Install WinWrap Basic for Everything with
// a valid Evaluation or Development Certificate
// * Don't set the Secret property.
// 2) On any computer:
// Create a Test Application Certificate
// The name of the application is "@assemblyname, PublicKey=key"
// Add the Test Application Certificate to the project.
// Select the "Copy if newer" action.
// Uncomment the next line to set the Secret with the proper GUID.
//basic.Secret = new Guid("test-certificate-guid");
// 3) On any computer:
// Create an Application Cerfificate
// The name of the application is "@assemblyname, PublicKey=key"
// Add the Application Certificate to the project.
// Select the "Copy if newer" action.
// Uncomment the next line to set the Secret with the proper GUID.
//basic.Secret = new Guid("certificate-guid");
// initialize the BasicNoUIObj
basic.Initialize();
bool result;
// turn on sandboxing - only "safe" .NET methods can be used
basic.Sandboxed = true;
// customize the sandbox rules
basic.SandboxRules = new MySandboxRules();
Console.WriteLine("1: NoSyntaxError.bas (RunFile)");
// run the NoSyntaxError script
basic.FileName = root + "NoSyntaxError.bas";
result = basic.RunFile("");
Debug.Assert(result);
Console.WriteLine("1^^^^^^^^^^\n");
// block the MsgBox script instruction
basic.BlockedKeywords = "MsgBox";
Console.WriteLine("2: BlockedKeyword.bas (SyntaxCheck)");
// syntax check a script with the MsgBox instruction
basic.FileName = root + "BlockedKeyword.bas";
result = basic.SyntaxCheck();
Debug.Assert(!result);
Console.WriteLine(basic.Error.ToString());
Console.WriteLine("2^^^^^^^^^\n");
Console.WriteLine("3: SyntaxError.bas (SyntaxCheck)");
// syntax check a script with a normal syntax error
basic.FileName = root + "SyntaxError.bas";
result = basic.SyntaxCheck();
Debug.Assert(!result);
Console.WriteLine(basic.Error.ToString());
Console.WriteLine("3^^^^^^^^^\n");
// turn of sandboxing
basic.Sandboxed = false;
Console.WriteLine("4: CaughtException.bas (RunFile)");
// run script CaughtException.bas
result = basic.RunFile(root + "CaughtException.bas");
Debug.Assert(result);
Console.WriteLine("4^^^^^^^^^\n");
Console.WriteLine("5: UncaughtException.bas (RunFile)");
// run script MacroRun2.bas
result = basic.RunFile(root + "UncaughtException.bas");
Debug.Assert(!result);
Console.WriteLine("5^^^^^^^^^\n");
// set the HiddenCode
// Sub DoIt accessible by all future scripts
basic.HiddenCode =
"""
'#Language "WWB.NET"
Sub DoIt
Debug.Print "HiddenCode DoIt"
End Sub
""";
Console.WriteLine("6: Diagnostic.obm (ModuleInstance)");
// load Diagnostic.obm, a VB6 style object module
// Diagnostic.obm is NOT accessible other scripts
// diagnostic is only accessible by the host application
using (var diagnostic = basic.ModuleInstance(root + "Diagnostic.obm", false))
{
// print the list of public methods in Module1.bas
foreach (var method_name in diagnostic.PublicMethodNames("Module1"))
Console.WriteLine(method_name);
}
Console.WriteLine("6^^^^^^^^^\n");
Console.WriteLine("7: Module1.bas (ModuleInstance)");
// load Module1.bas (not global)
// Module1.bas is NOT accessible by future scripts
// module1 is accessible by the host application
using (var module1 = basic.ModuleInstance(root + "Module1.bas", false))
{
// print the list of '#Uses in Module1.bas
foreach (var uses in module1.Uses)
Console.WriteLine(uses);
// print the list of public classes in Module1.bas
foreach (var module_name in module1.PublicClassNames)
Console.WriteLine(module_name);
// print the list of public methods in Module1.bas
foreach (var method_name in module1.PublicMethodNames("Module1"))
Console.WriteLine(method_name);
// print the list of public properties in Module1
foreach (var method_name in module1.PublicPropertyNames("Module1"))
Console.WriteLine(method_name);
// call Module1.DoIt
module1.Call("Module1.DoIt1");
}
Console.WriteLine("7^^^^^^^^^\n");
// add a "safe" reference to ClassLibrary1
// all public ClassLibrary1 types/methods accessible by all future scripts
result = basic.AddSafeReference(typeof(ClassLibrary1.Class1).Assembly, "ClassLibrary1");
Debug.Assert(result);
// add c2, an instance of ClassLibrary1.Class1
// c1 object is accessible by all future scripts
var c1 = new ClassLibrary1.Class1();
result = basic.AddExtensionObject("c1", c1);
Debug.Assert(result);
// add a "safe" reference to ClassLibrary2
// all public ClassLibrary2 types/methods accessible by all future scripts
result = basic.AddSafeReference(typeof(ClassLibrary2.Class2).Assembly, "ClassLibrary2");
Debug.Assert(result);
// add c2, an instance of ClassLibrary2.Class2
// c2 object is accessible by all future scripts
var c2 = new ClassLibrary2.Class2();
result = basic.AddExtensionObject("c2", c2);
Debug.Assert(result);
// add a "safe" reference to ClassLibrary3
// all public ClassLibrary3 types/methods accessible by all future scripts
result = basic.AddSafeReference(typeof(ClassLibrary3.Class3).Assembly, root + "Macro.bas|ClassLibrary3");
Debug.Assert(result);
// add c3, an instance of ClassLibrary3.Class3
// c3 object is accessible by all future scripts
var c3 = new ClassLibrary3.Class3();
result = basic.AddExtensionObjectWithEvents(root + "Macro.bas|c3", c3);
Debug.Assert(result);
Console.WriteLine("8a: Module1.bas (LoadModule)");
// load Module1.bas (global)
// Module1.bas public symbols are accessible by future scripts
result = basic.LoadModule(root + "Module1.bas");
Debug.Assert(result);
Console.WriteLine("9: Macro.bas (RunFile)");
// run Macro.bas
result = basic.RunFile(root + "Macro.bas");
Debug.Assert(result);
Console.WriteLine("9^^^^^^^^^\n");
Console.WriteLine("10: Module1.bas (ModuleInstance)");
// Module1 has already been loaded globally
// Module1.bas is still accessible by future scripts
// module1 is accessible by the host application
using (var module1 = basic.ModuleInstance(root + "Module1.bas", false))
{
foreach (var uses in module1.Uses)
Console.WriteLine(uses);
foreach (var module_name in module1.PublicClassNames)
Console.WriteLine(module_name);
foreach (var method_name in module1.PublicMethodNames("Module1"))
Console.WriteLine(method_name);
foreach (var method_name in module1.PublicPropertyNames("Module1"))
Console.WriteLine(method_name);
module1.Call("Module1.DoIt1");
}
Console.WriteLine("10^^^^^^^^\n");
Console.WriteLine("8b: Module1.bas (UnloadModule)");
// unload the Module1.bas global script
// module1's public symbols are no longer accessible by future scripts
result = basic.UnloadModule(root + "Module1.bas");
Debug.Assert(result);
Console.WriteLine("8^^^^^^^^^\n");
Console.WriteLine("11: script code (RunThis)");
// run script code (a string, not a file)
result = basic.RunThis("Debug.Print \"RunThis\"");
Debug.Assert(result);
Console.WriteLine("11^^^^^^^^\n");
}
}
}
BlockedKeywords.bas script
'#Language "WWB.NET"
Sub Main
MsgBox "Hi"
End Sub
CaughtException.bas script
'#Language "WWB.NET"
Sub Main
Try
MacroRun MacroDir & "\UncaughtException.bas"
Catch ex As System.Exception
Debug.Print ex.Message
Finally
End Try
End Sub
Class.cls script
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
END
Attribute VB_Name = "Class1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
'#Language "WWB.NET"
Sub DoIt()
Debug.Print "Class1.DoIt"
End Sub
Private Sub Class_Initialize()
Debug.Print "Class_Initialize"
End Sub
Diagnostic.obm script
VERSION 1.0 OBJECT
BEGIN
MultiUse = -1 'True
END
Attribute VB_PredeclaredId = True
Attribute VB_Creatable = True
Attribute VB_Exposed = False
Attribute VB_GlobalNameSpace = False
Attribute VB_Name = "Diagnostic"
'#Language "WWB.NET"
Sub DoIt
Debug.Print "Diagnostic.DoIt"
End Sub
Private Sub Object_Initialize()
Debug.Print "Object_Initialize"
End Sub
Macro.bas script
'#Language "WWB.NET"
Sub Main
Debug.Print Now
Debug.Print c1.Info
Debug.Print c2.Info
Debug.Print c3.Info
Debug.Print GetType(Class1).FullName
Debug.Print GetType(Class2).FullName
Debug.Print GetType(Class3).FullName
DoIt
DoIt1
End Sub
Module1.bas script
'#Language "WWB.NET"
'#Uses "Module2.bas"
Module Module1
Sub DoIt1
Debug.Print "Module1.DoIt1"
DoIt2
End Sub
End Module
Module2.bas script
'#Language "WWB.NET"
Module Module2
Sub DoIt2
Debug.Print "Module2.DoIt2"
End Sub
End Module
Module3.bas script
'#Language "WWB.NET"
Sub DoIt3()
Debug.Print "Module3.DoIt3"
End Sub
NoSyntaxError.bas script
'#Language "WWB.NET"
Sub Main
Debug.Print Now
End Sub
SyntaxError.bas script
'#Language "WWB.NET"
Sub Main
x
End Sub
UncaughtException.bas script
'#Language "WWB.NET"
Sub Main
Throw New System.Exception("Ouch")
End Sub
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- Microsoft.CodeAnalysis.VisualBasic (>= 4.13.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 10.53.27.1 | 214 | 6/26/2025 |
| 10.53.26.1 | 185 | 5/28/2025 |
| 10.53.23.1 | 152 | 5/2/2025 |
| 10.53.22.2 | 194 | 4/27/2025 |