Vulcan Runtime example

This forum is meant for examples of X# code.

George
Posts: 106
Joined: Thu Nov 05, 2015 9:17 am

Vulcan Runtime example

Post by George »

Hi,

I tried the 'Vulcan Runtime' example in XIDE and VS2015.

In XIDE worked by:
------------------
1. Adding a Reference to VulcanRT (not the VulcanRTFuncs)
2. Using the 'USING':
#USING System
#USING System.Collections.Generic
//#USING System.Linq
//#USING System.Text
//#USING Vulcan
//#USING VulcanRTFuncs
#USING XSharpVulcanTest
//#USING STATIC VulcanRTFuncs.Functions // allows us to use methods of this class as if they were functions

but it wasn't possible to enable the VulcanRTFuncs and use the:
//#USING STATIC VulcanRTFuncs.Functions // allows us to use methods of this class as if
in this case, appears the error:
"error VN2700: expecting ID, found 'STATIC' 13,8 File1.prg XSharpVulcanTest
Build failed"


In VS2015, I succeeded to build the project, (but the result didn't run) with the warning:
1>------ Build started: Project: UseVulcan, Configuration: Debug Any CPU ------
1>C:Program Files (x86)MSBuild14.0binMicrosoft.Common.CurrentVersion.targets(1819,5): warning MSB3270: There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "VulcanRTFuncs", "x86". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project.
1> UseVulcan -> C:UsersGeorgeDocumentsVisual Studio 2015ProjectsXSharpUseVulcanbinDebugUseVulcan.exe
========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========

At that time, I reference also the Vu;canRTFuncs.


Then, I tried to correct it using the XIDE's experience, but now I get:
1>------ Build started: Project: UseVulcan, Configuration: Debug Any CPU ------
1>Program.prg(23,37): error XS0246: The type or namespace name '__VODATE' could not be found (are you missing a using directive or an assembly reference?)
1>Program.prg(23,26): error XS0103: The name 'Today' does not exist in the current context
1>Program.prg(27,29): error XS0246: The type or namespace name '__VODATE' could not be found (are you missing a using directive or an assembly reference?)
1>Program.prg(34,25): error XS0103: The name 'Today' does not exist in the current context
1>Program.prg(34,20): error XS0103: The name 'DTOS' does not exist in the current context
1>Program.prg(39,15): error XS0103: The name 'SubStr' does not exist in the current context
1>Program.prg(43,15): error XS0103: The name 'At' does not exist in the current context
1>Program.prg(47,57): error XS1955: Non-invocable member 'Empty' cannot be used like a method.
1>Program.prg(49,57): error XS1955: Non-invocable member 'Empty' cannot be used like a method.
1>Program.prg(53,15): error XS0103: The name 'Pow' does not exist in the current context
1>Program.prg(57,21): error XS0246: The type or namespace name '__Array' could not be found (are you missing a using directive or an assembly reference?)
1>Program.prg(58,15): error XS0103: The name 'ArrayNew' does not exist in the current context
1>Program.prg(59,10): error XS0103: The name 'AAdd' does not exist in the current context
1>Program.prg(60,10): error XS0103: The name 'AAdd' does not exist in the current context
1>Program.prg(61,10): error XS0103: The name 'AAdd' does not exist in the current context
1>Program.prg(62,64): error XS0103: The name 'ALen' does not exist in the current context
1> XSharp Compilation time: 00:00:03.1294744
========== Build: 0 succeeded or up-to-date, 1 failed, 0 skipped ==========
User avatar
Chris
Posts: 4951
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Vulcan Runtime example

Post by Chris »

Hi George,

The error message (which starts with "VN") when compiling from XIDE means that it comes from the vulcan compiler, not the X# one. I think you are using a normal app for testing, not a standalone .prg file, is that correct? In this case, you need to open the app properties and set the language of the app to X# (combo box next to the app name). You will also need to set the platform target to x86, use references to both VulcanRT and VulcanRTFuncs and also copy them to the bin folder, so the app can find and load them at runtime.

For VS, the best way to run the sample(s) is to go to the UsersPublicDocumentsXSharpExamples folder and just open Examples.sln. Then you can run any of the samples you want without needing to copy/paste code, add references etc, they are already setup. I just tested the vulcan runtime (BYOR) sample, seem to be working fine.

Chris
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
FFF
Posts: 1589
Joined: Fri Sep 25, 2015 4:52 pm
Location: Germany

Vulcan Runtime example

Post by FFF »

Chris wrote:For VS, the best way to run the sample(s) is to go to the UsersPublicDocumentsXSharpExamples folder and just open Examples.sln. Then you can run any of the samples you want without needing to copy/paste code, add references etc, they are already setup.

Chris
Good tip, works a treat. Any chance we might see XIDE learning to read sln? Would make life easier ;)

HAND
Karl
Regards
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
User avatar
Chris
Posts: 4951
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Vulcan Runtime example

Post by Chris »

Hi Karl,

Reading and maintaining it, absolutely not! :-)
But I want to make XIDE be able to read .sln files with its projects and create a XIDE project file which can be used side by side but totally independent of the VS project system. For now, I'll just create a XIDE project file for the X# samples, will send it in the next days.

Chris
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
George
Posts: 106
Joined: Thu Nov 05, 2015 9:17 am

Vulcan Runtime example

Post by George »

Hi Chris,

for the XIDE you are right: the selected language was Vulcan.NET.
Now it works after choosing x86 in properties and selecting X#.

The VS2015 also worked as you described.

thanks
George
George
Posts: 106
Joined: Thu Nov 05, 2015 9:17 am

Vulcan Runtime example

Post by George »

I am also happy for the: using
instead of: #using

as well as for the VAR type and the Generics creation!

regards
George
George
Posts: 106
Joined: Thu Nov 05, 2015 9:17 am

Vulcan Runtime example

Post by George »

Following the X# examples project, I succeded to modify the my most important project Library (referenced by all my projects) from .vnproj targeting .NET 4 to .xsproj.

The project opens correctly, but I cannot build it targeting .NET 4.

Errors:

Severity Code Description Project File Line Suppression State
Error MSB4036 The "CreateXSharpManifestResourceName" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "C:Program Files (x86)MSBuild14.0bin" directory. Softway.Common C:Program Files (x86)MSBuildXSharpXSharp.targets 61
Warning MSB3253 The currently targeted framework ".NETFramework,Version=v4.0" does not include "System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which the referenced assembly "CrystalDecisions.CrystalReports.Engine, Version=11.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" depends on. This caused the referenced assembly to not resolve. To fix this, either (1) change the targeted framework for this project, or (2) remove the referenced assembly from the project. Softway.Common C:Program Files (x86)MSBuild14.0binMicrosoft.Common.CurrentVersion.targets 1819
Warning MSB3253 The currently targeted framework ".NETFramework,Version=v4.0" does not include "System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which the referenced assembly "CrystalDecisions.Enterprise.Framework, Version=11.5.3300.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" depends on. This caused the referenced assembly to not resolve. To fix this, either (1) change the targeted framework for this project, or (2) remove the referenced assembly from the project. Softway.Common C:Program Files (x86)MSBuild14.0binMicrosoft.Common.CurrentVersion.targets 1819
Warning MSB3253 The currently targeted framework ".NETFramework,Version=v4.0" does not include "System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which the referenced assembly "CrystalDecisions.Enterprise.InfoStore, Version=11.5.3300.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" depends on. This caused the referenced assembly to not resolve. To fix this, either (1) change the targeted framework for this project, or (2) remove the referenced assembly from the project. Softway.Common C:Program Files (x86)MSBuild14.0binMicrosoft.Common.CurrentVersion.targets 1819
Warning MSB3253 The currently targeted framework ".NETFramework,Version=v4.0" does not include "System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which the referenced assembly "CrystalDecisions.ReportSource, Version=11.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" depends on. This caused the referenced assembly to not resolve. To fix this, either (1) change the targeted framework for this project, or (2) remove the referenced assembly from the project. Softway.Common C:Program Files (x86)MSBuild14.0binMicrosoft.Common.CurrentVersion.targets 1819
Warning MSB3253 The currently targeted framework ".NETFramework,Version=v4.0" does not include "System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which the referenced assembly "CrystalDecisions.Shared, Version=11.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" depends on. This caused the referenced assembly to not resolve. To fix this, either (1) change the targeted framework for this project, or (2) remove the referenced assembly from the project. Softway.Common C:Program Files (x86)MSBuild14.0binMicrosoft.Common.CurrentVersion.targets 1819
Warning MSB3253 The currently targeted framework ".NETFramework,Version=v4.0" does not include "System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which the referenced assembly "CrystalDecisions.Windows.Forms, Version=11.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" depends on. This caused the referenced assembly to not resolve. To fix this, either (1) change the targeted framework for this project, or (2) remove the referenced assembly from the project. Softway.Common C:Program Files (x86)MSBuild14.0binMicrosoft.Common.CurrentVersion.targets 1819



Also, the same error appears when if I select: <inherit from parent or project defaults>.

Please note I don't reference to System.Web at all into my project.
Even I add a reference to it, the same error appears.

regards
George
George
Posts: 106
Joined: Thu Nov 05, 2015 9:17 am

Vulcan Runtime example

Post by George »

I remember that I had the same problem to compile this Library with Vulcan 4 for .NET 4.
Then, I set targeting frameworg 4.5 and it worked.

The problem is the existance of Crystal libraries (.NET 2) that request for the System.Web.
The System.Web cannot anyway be referenced into the project.
User avatar
Chris
Posts: 4951
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Vulcan Runtime example

Post by Chris »

Hi George!

In principle, this should work fine, as I tried creating a CLR2 library that uses classes from the System.Web assembly, then referenced it and used it from a X# project in VS and it worked fine.

I'd suggest doing your test step by step: first just create a small X# project that references some Crystal library and uses something from it. I that works try referencing more, add some of your real code etc. I think this will probably reveal what went wrong with your first attempt, too.

Chris
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
User avatar
robert
Posts: 4552
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Vulcan Runtime example

Post by robert »

George,

The "CreateXSharpManifestResourceName" error is correct. This is a task which is included in the XSharp.Targets file but is not implemented (yet) in the XSharp.Build.dll.

I had totally forgotten about this task.

This is the task that generates managed resources for .resx files.
We do not have support for .resx files yet, since that also requires the code generator for the code behind prg.

Did you have an .resx file in your project ?
I am almost certain that this particular error will disappear if you exclude the .resx files.


Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
Post Reply