New to X# and need some direction
New to X# and need some direction
Isn't it right? I think XIDE did it itself, I just browsed for it
- Attachments
-
- JSon.JPG (42.34 KiB) Viewed 468 times
New to X# and need some direction
Hi Tom,
it could be that your system has one version of the library in the GAC, and the MYOB library needs a newer one.
With NuGet this works automatically.
Wolfgang
it could be that your system has one version of the library in the GAC, and the MYOB library needs a newer one.
With NuGet this works automatically.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
- lumberjack
- Posts: 727
- Joined: Fri Sep 25, 2015 3:11 pm
- Location: South Africa
New to X# and need some direction - the XIDE Error
Hi Tom,
Look again at your error message, it tells you exactly what it needs, V7 of NwtonJSON. Problem is MYOB is looking for it in the same relative path as in your VS folder structure or you need the V7 JSON in the same folder as the MYOB assembly.
HTH,
I think you need to copy the whole folder structure from VS not only the Assemblies. You do not need to add a Reference to NewtonJSON. MYOB will handle that part.tom@dieselworks.com.au wrote: the only issue I have is that I have no idea what to copy where? I have located two folders in the project that I have set up in C# / Vs and copied them over into a new folder under the XIDE test project. Then I set up the references.
Both of these, the MYOB and JSON has a number of subfolders and to be honest I have no clue what to do here. I have copied the v4.0 folder of the JSon DLL into the v4.0 version of MYOB SDK but I still have the message
Look again at your error message, it tells you exactly what it needs, V7 of NwtonJSON. Problem is MYOB is looking for it in the same relative path as in your VS folder structure or you need the V7 JSON in the same folder as the MYOB assembly.
Code: Select all
System.IO.FileLoadException: Could not load file or assembly 'Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies.
______________________
Johan Nel
Boshof, South Africa
Johan Nel
Boshof, South Africa
New to X# and need some direction
Thanks Wolfgang but I have fetched both using the VS NuGet - Command Line. what concerns me is that I have the code compiled and running it VS C# but that gets stuck half way through - while the XIDE will not even compile - same libraries
New to X# and need some direction
Tom,
If a C# or X# project in VS uses NuGet then usually the necessary packages are copied to a packages subfolder in the solution.
The source for these packages is in the folder users<Currentuser>.nugetPackages
That last folder will have all versions of packages you have ever used. The packages folder in the solution will only have the package versions that are used in the solution.
Robert
If a C# or X# project in VS uses NuGet then usually the necessary packages are copied to a packages subfolder in the solution.
The source for these packages is in the folder users<Currentuser>.nugetPackages
That last folder will have all versions of packages you have ever used. The packages folder in the solution will only have the package versions that are used in the solution.
Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
The Netherlands
robert@xsharp.eu
New to X# and need some direction
Hi Tom,
I have now tried to build a VS project. After building and running it, I had the follwing files in my bin folder:
You should add exactly these DLL as references to your XIDE project.
Wolfgang
I have now tried to build a VS project. After building and running it, I had the follwing files in my bin folder:
You should add exactly these DLL as references to your XIDE project.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
New to X# and need some direction
Thanks Robert, that is what I have found following your note. So what do I do with it? I can see 2 versions, 7.0.1 and 11.0.2
- Attachments
-
- nuget.JPG (18.97 KiB) Viewed 468 times
-
- nuget_json_7.0.1.JPG (22.9 KiB) Viewed 468 times
New to X# and need some direction
Thanks Wolgang, what is the rule? Which one do I add? I can see a few versions
New to X# and need some direction
Hi Tom,
I have now tried to build a Console application in X# Core, with the following references (taken from the VS solution bindebug folder):
The following X# code compiles for me:
The last line does not compile because I don't have the variable companyFile in my code.
Wolfgang
I have now tried to build a Console application in X# Core, with the following references (taken from the VS solution bindebug folder):
The following X# code compiles for me:
Code: Select all
using System.Linq
using MYOB.AccountRight.SDK
using MYOB.AccountRight.SDK.Services
using MYOB.AccountRight.SDK.Services.GeneralLedger
function TestMYOB() as void
var configuration := ApiConfiguration{"http://localhost:8080/accountright"}
var cfService := CompanyFileService{configuration}
var companyFiles := cfService.GetRange()
//Next step in the flow is to select a company file that supports v2 contracts
// for the AccountRight API - anything from 2013.3 and up will do here.
var companyFile := companyFiles.FirstOrDefault( { x => Version{ x:ProductVersion } >= Version{"2013.3"} } )
//The company file credentials are an AccountRight requirement with the SDK providing the
//CompanyFileCredentials class to encapsulate these. For our example the company file
//login details in use are username: Administrator with no password on the admin account.
var credentials := CompanyFileCredentials{"Administrator",""}
//Now you are ready to start accessing resources directly from the API
var accountService := AccountService{configuration}
//var accounts := accountService.GetRange(companyFile,null,credentials)
return
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
New to X# and need some direction
Hi Tom,
the rule is simple: you need to use what the MYOB people used to build their assembly.
You can look also with . NET Reflector or ILSpy to see what version is needed.
The NuGet should retrieve the right DLL.
Wolfgang
the rule is simple: you need to use what the MYOB people used to build their assembly.
You can look also with . NET Reflector or ILSpy to see what version is needed.
The NuGet should retrieve the right DLL.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it