Project.Load Method is failing when try to load the 5.8 llblgen project

Posts   
 
    
Posts: 6
Joined: 24-Jun-2022
# Posted on: 24-Jun-2022 14:46:18   

Hi Team, I am getting below error while try to load the llblgen 5.8 Project file. I am writing the code in C#. I am using all the 5.8 assemblies as a references and valid license file. The code is failing on Project.Load method. Any help here is highly appreciated. Thanks!

            var configurationToUse = System.Configuration.ConfigurationManager.OpenExeConfiguration(Application.StartupPath + @"\ConsoleApp1.exe");
            CoreStateSingleton.GetInstance().ConfigurationSettings = new ApplicationConfiguration(configurationToUse,Application.StartupPath);
            CoreStateSingleton.GetInstance().LoadObjectsAndConfigData();
            UserConfiguration preferences = LoadPreferences();

            SD.LLBLGen.Pro.ApplicationCore.ProjectClasses.Project.Load(filename);

Error I am getting :- Object reference not set to an instance of an object at SD.LLBLGen.Pro.ApplicationCore.ProjectClasses.Project.DeserializeFromFile(String filename, String additionalTypeConverterFolder) at SD.LLBLGen.Pro.ApplicationCore.ProjectClasses.Project.Load(String filename, String additionalTypeConverterFolder) at SD.LLBLGen.Pro.ApplicationCore.ProjectClasses.Project.Load(String filename)

Attachments
Filename File size Added on Approval
ProjectLoadIssue.jpg 499,069 24-Jun-2022 14:51.11 Approved
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39747
Joined: 17-Aug-2003
# Posted on: 24-Jun-2022 15:18:18   

Please post the full stacktrace (so with inner exceptions!), as it's likely the inner exception is the one you need to look at.

Frans Bouma | Lead developer LLBLGen Pro
Posts: 6
Joined: 24-Jun-2022
# Posted on: 24-Jun-2022 16:05:58   

Thanks Otis for your quick response. Appreciate!! Here find the full stack trace - at SD.LLBLGen.Pro.ApplicationCore.ProjectClasses.Project.DeserializeFromFile(String filename, String additionalTypeConverterFolder) at SD.LLBLGen.Pro.ApplicationCore.ProjectClasses.Project.Load(String filename, String additionalTypeConverterFolder) at SD.LLBLGen.Pro.ApplicationCore.ProjectClasses.Project.Load(String filename) at ConsoleApp1.Program.Main(String[] args) in C:\Users\kondep\source\repos\ConsoleApp1\ConsoleApp1\Program.cs:line 46

There is no Inner exception. Attaching the screenshot for your reference. Thanks!

Attachments
Filename File size Added on Approval
LoadIssue.jpg 159,763 24-Jun-2022 16:06.13 Approved
ProjectLoad1.jpg 181,832 24-Jun-2022 16:37.45 Approved
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39747
Joined: 17-Aug-2003
# Posted on: 24-Jun-2022 17:08:05   

Hmm. Please check the Clicodegenerator sourcecode and check if you've done the same setup steps. The sourcecode is in the source archive available in the extras' section of the downloads for a particular version.

Frans Bouma | Lead developer LLBLGen Pro
Posts: 6
Joined: 24-Jun-2022
# Posted on: 24-Jun-2022 17:32:49   

Sure Thanks Otis. Let me check for the source code and see what I am missing here. I will get back to you. Thanks!

Posts: 6
Joined: 24-Jun-2022
# Posted on: 24-Jun-2022 18:04:33   

We got reference from the source code and it's loading the project. Setting up the preferences in the CoreStateSingleton instance was missing. See the below code for your reference. Thanks for all your help!

UserConfiguration preferences = LoadPreferences(); CoreStateSingleton.GetInstance().PreferencesRetrievalFunc = () => preferences;