xsharp.eu • Questions about X# definition - Page 2
Page 2 of 2

Questions about X# definition

Posted: Tue May 16, 2017 4:00 am
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)....

Questions about X# definition

Posted: Tue May 16, 2017 7:11 am
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>

Questions about X# definition

Posted: Tue May 23, 2017 7:20 am
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

Questions about X# definition

Posted: Tue May 23, 2017 7:25 am
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

Questions about X# definition

Posted: Tue May 23, 2017 8:08 am
by beerhand
Hi Wolfgang and others,

please find attached the project files.

Thanks,
Michael

Questions about X# definition

Posted: Tue May 23, 2017 8:21 am
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

Questions about X# definition

Posted: Tue May 23, 2017 8:22 am
by wriedmann
Hi Michael,

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

Wolfgang

Questions about X# definition

Posted: Tue May 23, 2017 12:26 pm
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]

Questions about X# definition

Posted: Tue May 23, 2017 12:33 pm
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