1. Bernie Rivera
  2. PowerBuilder
  3. Wednesday, 21 August 2019 20:27 PM UTC

I am getting the following error when attempting create a .net datastore in a deployed environment:

Could not load file or assembly 'System.ComponentModel.Annotations, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

The Dll it is saying it cannot find is in the same folder of the dll that is trying to create the datastore.  Actually every file and folder that was in the Bin folder has been deployed.

When I run it in Visual Studio it works fine, but when it is deployed it does not.

Does anyone know what might be wrong?

 

Oh, by the way this issue is happening when using Appeon's PowerBuilder 2019 .net DataStore in a C# dll project.

Accepted Answer
Bernie Rivera Accepted Answer Pending Moderation
  1. Tuesday, 27 August 2019 19:36 PM UTC
  2. PowerBuilder
  3. # Permalink

Well I have resolved the issue.  Though, the solution is an oxymoron.  On one hand the solution makes sense, but on the other hand it makes no sense because it only complained in one scenario.

The error itself actually contained the clue.

Could not load file or assembly 'System.ComponentModel.Annotations, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

The PowerBuilder C# DataStore for some reason is looking for an older version of a dependency dll.  The strange think is that it did not complain about the version of the dll when instantiated outside of our ETM product.  

Never-the-less, when I replaced the dll with the version it was looking for, it functioned as designed.

We never considered the dll was the wrong version since it worked elsewhere using the very dll it was complaining about and it was the version that the NuGet package loaded (4.3.0).  Also, the PowerBuilder.Data NuGet package wouldn't even let me load the older dll since it complained that it needed the newer version.  I had to get the older version by loading the NuGet package for that specific dll into a different project.

I will consider this question resolved, but it seems like Appeon should probably fix this oddball dll reference that is an older version than the rest of the dependency dlls.  

Thanks.

 

 

 

Comment
There are no comments made yet.
Mark Lee @Appeon Accepted Answer Pending Moderation
  1. Friday, 23 August 2019 06:15 AM UTC
  2. PowerBuilder
  3. # 1

Hi Bernie,

 

Please refer to the following link and see if it can resolve your problem.

https://stackoverflow.com/questions/47803812/could-not-load-file-or-assembly-system-componentmodel-annotations-in-published

https://developercommunity.visualstudio.com/content/problem/167539/could-not-load-file-or-assembly-systemcomponentmod-1.html

 

Are you using the PB 12.6 .NET project?

Please note that PowerBuilder .NET has been removed since PowerBuilder 2017.

We suggest you upgrade your project to PB 2017 R3 or PB2019, there is a new object RESTClient in these versions. 

The RESTClient object provides the functionality to access the RESTful Web APIs.

You can refer to the link below for details:

https://www.appeon.com/support/documents/appeon_online_help/pb2019/objects_and_controls/ch02s85.html

 

You can also use SnapDevelop (PB Edition) 2019 with C# code to create Web API in PB 2019:

https://www.appeon.com/support/documents/appeon_online_help/snapdevelop2019/Create_a_Web_API/index.html

 

BTW,  it seems that the PowerBuilder.Data.XmlSerializers.dll is not a PowerBuilder's dll, maybe you can get some information from the link below:

https://answers.sap.com/questions/10427830/how-to-reduce-the-service-reponse-time-in-powerbui.html

 

Regards,

Comment
  1. Bernie Rivera
  2. Saturday, 24 August 2019 16:17 PM UTC
Hmmm, those links seem to be similar, but not the same issue. I have been struggling to figure out the problem, and have added another clue that makes the mystery even more strange. Like I said before, when instantiating using our restful service it fails, but when instantiating the dll from the same folder using an executable it works fine. I ended up creating a simpler restful service in an attempt to use it to submit to Appeon so they could duplicate the issue but the simple web service ended up working without issue. This doesn't make any sense really, since they are all running from the same folder. One thing might be a factor is that it is using a new Windows 2019 server and our restful web service product may be bumping heads with something. I will be attempting to set up a test on another server and see issue remains.
  1. Helpful
  1. Bernie Rivera
  2. Saturday, 24 August 2019 17:53 PM UTC
Nope it has the same problem in Windows Server 2016, so it doesn't look like it is related to the OS. Looks like I have hit another dead end. This issue just seems to want to remain a mystery. Thanks for the suggestions.



Oh, by the way this issue is happening when using Appeon's PowerBuilder 2019 .net DataStore in a C# dll project.
  1. Helpful
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Thursday, 22 August 2019 20:33 PM UTC
  2. PowerBuilder
  3. # 2

Sorry Bernie, I'm kind of a noob but will try to help if no one else can.

But ... I'd use "process monitor" to see where it's failing. Process Monitor generates a lot of output, but you can apply filters.

Do you have a sample application, I'll try to see if I help you out as that would also be good practice for me and I'm having 4 days off.

 

regards,

 

Comment
  1. Bernie Rivera
  2. Saturday, 24 August 2019 16:23 PM UTC
As I mentioned in my comment to Mark Lee, I created a simple web service project to duplicate the problem and it ended up not being helpful since it worked using the new web service. It is a strange situation since I have even specifically told the AppDomain how to resolve the location by telling it the exact path for the dll and it still said it could not find it. Thanks for the offer.
  1. Helpful
There are no comments made yet.
Bernie Rivera Accepted Answer Pending Moderation
  1. Thursday, 22 August 2019 20:20 PM UTC
  2. PowerBuilder
  3. # 3

OK, so unfortunately it looks like no one has any idea of what may be causing this problem.

Well the mystery increases as I keep troubleshooting this issue with my dll.

If I instantiate the dll that is trying to create a .net datastore with an Executable it works fine, but if I instantiate it using a restful web service it fails.  And both are instantiating the same dll from the same folder.

It also seem to be looking for a non-existing dll, PowerBuilder.Data.XmlSerializers.dll, but I don't see how that makes a difference since it works fine when using the executable file.

I desperately need to solve this issue, so any help would be appreciated.

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.