Questions about X# definition

This forum is meant for questions and discussions about the X# language and tools
User avatar
wriedmann
Posts: 3757
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Questions about X# definition

Post by wriedmann »

Hi Michael,

sorry, but I don't think that something is going terrible wrong.

In VO, you have to add libraries to your application, and in X#, you have to add assemblies to your references. In VO, most libraries were from the VO development team, and therefore documented inside the help. In X#, most libraries are from the .NET framework, and documented there.
As other "complication" in .NET you have the namespaces. It is not enough to add the assemblies (DLLs) to you application, but you need to declare also the namespaces with the "using" statement.

I can only point you again to the .NET API Browser:

https://docs.microsoft.com/de-de/dotnet/api/

It seems you have not included the right assembly to your project: System.Data.Linq is the library where most Linq functionality resides. Try to add this assembly and recompile.

Wolfgang

P.S. I were very confused in the beginning by all these terms.... And there are so many assemblies in the GAC (the global assembly cache)....
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
FFF
Posts: 1581
Joined: Fri Sep 25, 2015 4:52 pm
Location: Germany

Questions about X# definition

Post by FFF »

Wolfgang,
i suppose, Michael started using the WPF-App template, insofar i think he is justified in thinking, that all prerequisites are in place. But the template contains only references to System.Data and System.XML.Linq, but NOT to System.Data.Linq...

BTW, thx for the link, this is finally a seemingly quick reacting Ms site ;)

@Michael: for good help you have to provide better bug report <g>
Regards
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
beerhand

Questions about X# definition

Post by beerhand »

Hi Karl,

you are correct. I used the WPF-App template. Unfortunately I am still not able to reproduce Phil's examples (third try). I included all libraries/assemblies by hand into the code. Still getting the error messages as stated below. Next I have replaced the code with Phil's code. No success so far. I have checked and compared all settings (at least the obvious ones in the properties) but could not find any differences.

Maybe a question for Phil (when he is back): Did you use the WPF-App template?

Regards,
Michael
User avatar
wriedmann
Posts: 3757
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Questions about X# definition

Post by wriedmann »

Hi Michael,

maybe you should do a clean on your project, zip it up and attach it to your message, so someone of us could check and give you the solution.

Without seeing exactly the dependencies it is almost impossible to give you the right indications.

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
beerhand

Questions about X# definition

Post by beerhand »

Hi Wolfgang and others,

please find attached the project files.

Thanks,
Michael
Attachments
L2S_XS_WPF_forumDemo2.zip
(36.65 KiB) Downloaded 66 times
User avatar
robert
Posts: 4529
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Questions about X# definition

Post by robert »

Michael,

You seem to be trying to use Entity Framework, but you have no reference to Entity Framework in your project.

That is most likely why it fails.

You should be able to add a Nuget package for EntityFramework.

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
User avatar
wriedmann
Posts: 3757
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Questions about X# definition

Post by wriedmann »

Hi Michael,

you have to add "System.Data.Linq" to your references.

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
FFF
Posts: 1581
Joined: Fri Sep 25, 2015 4:52 pm
Location: Germany

Questions about X# definition

Post by FFF »

Wolfgang, Robert,
got me Michael's sln, installed, added Data.Ling & EF.
Still compile fails with (only):

Code: Select all

..XS1061	'WPFWindow1' does not contain a definition for 'myDG_SelectionChanged' and no extension method 'myDG_SelectionChanged' accepting a first argument of type 'WPFWindow1' could 
be found (are you missing a using directive or an assembly reference?)...
Hopping around in the soluton expl. i opend packaces.config - from now on (not prior)
compile throughs an additional:
[map type=HYBRID zoom=2]

Code: Select all

...Warning: packages-Element wurde nicht deklariert...
[/map]
Regards
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
User avatar
wriedmann
Posts: 3757
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Questions about X# definition

Post by wriedmann »

Hi Karl,

I had the same error even without adding the Entity Framework - the code is not complete, maybe a typing error - and I have not the time to research all posts where the difference between Phils and Michaels code is. It would be enough that the declaration of this code is wrong, or that Phil has forgotten to show this method....

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Post Reply