1. Varga Zsolt
  2. PowerBuilder
  3. Monday, 3 July 2023 14:42 PM UTC

Hi,

I try to use some .net Assemblies in PB22. The objects were imported with the DLL importer, everything works fine. The application was deployed, it seems, there was no problem. In the final step, when I gave the application to the user, started the problems. When calling an external function, the program stops without any (error) messages. Anything else is OK. All the files from the Runtime22 and DOTNET libraries were copied to the user's computer. dotnet-runtime-6.0 installed.

The same environment on a computer with PB22 installed, no errors. But of course, I do not want to install PB22 on everyone's computer.

I think, that some files are missing from the standalone environment, but I do not realise which. Any ideas to resolve this problem?

Thanks,

Zsolt

 

Miguel Leeuwe Accepted Answer Pending Moderation
  1. Thursday, 6 July 2023 19:19 PM UTC
  2. PowerBuilder
  3. # 1

You've never answered my initial question "What value do you have in "is_assemblypath" ? Is it a fixed path?"

I'm asking this, because if it is a relative path and you open or save a file somewhere, your relative path no longer works.

Comment
There are no comments made yet.
Varga Zsolt Accepted Answer Pending Moderation
  1. Wednesday, 5 July 2023 11:55 AM UTC
  2. PowerBuilder
  3. # 2

What if we change the angle? Why does not crash the apllication, if I run it on a computer with PB22 installed? There must be some files on that, which is missing on user's. The same files, folders ...

 

Comment
  1. Miguel Leeuwe
  2. Thursday, 6 July 2023 19:16 PM UTC
He'll probably have the runtime files, but not installed, just copied to some folder within the path or where the EXE is. (this is what we do and it works great).
  1. Helpful
  1. Varga Zsolt
  2. Friday, 7 July 2023 08:07 AM UTC
after lots of deploys it seemes that the .net version couses the crash in a function generated by the PB during importing the extension:

ll_status = lnv_assembly.LoadWithDotNetCore(This.is_AssemblyPath)

I tried this with the version parameter set and finally I've got errors that I could handle. installing newer version of .net (yet dotnet-sdk.7.0) seems to resolve the problem. Now testing all the functionalities and hope everything will work. Cross your fingers. :-)

thanks for your help and suggestions.

  1. Helpful
  1. Andreas Mykonios
  2. Friday, 7 July 2023 10:46 AM UTC
Then Miguel is right... You may not be using a relative path...

Andreas.
  1. Helpful
There are no comments made yet.
Varga Zsolt Accepted Answer Pending Moderation
  1. Wednesday, 5 July 2023 07:33 AM UTC
  2. PowerBuilder
  3. # 3

There was .net Core. I will consult with the .net dll developer.

Comment
There are no comments made yet.
Varga Zsolt Accepted Answer Pending Moderation
  1. Wednesday, 5 July 2023 07:29 AM UTC
  2. PowerBuilder
  3. # 4

Checked (again :-) ), all of this files exists.

Comment
There are no comments made yet.
Andreas Mykonios Accepted Answer Pending Moderation
  1. Wednesday, 5 July 2023 06:48 AM UTC
  2. PowerBuilder
  3. # 5

Hi.

Are you sure you deployed all required runtime files?

Can you check that all of them exist in your end user pc (PBDotNet.dll, PBDotNetInvoker.dll, PBDotNetCoreInvoker.dll, PBDotNetFrameworkInvoker.dll, Ijwhost.dll, pbdotnetinvoker.runtimeconfig.json) ?

Andreas.

Comment
There are no comments made yet.
Andreas Mykonios Accepted Answer Pending Moderation
  1. Wednesday, 5 July 2023 06:46 AM UTC
  2. PowerBuilder
  3. # 6

Hi Miguel.

In my installation I do see 3 choices...

Maybe you are using PB 2022 R2 Beta?

Andreas.

Comment
  1. Miguel Leeuwe
  2. Wednesday, 5 July 2023 07:13 AM UTC
Hi Andreas, yes, you are right. It's a new "feature" of the PB2022 R2 beta. Not sure which version Varga is using.

Thanks for pointing this out,

regards
  1. Helpful
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Tuesday, 4 July 2023 16:33 PM UTC
  2. PowerBuilder
  3. # 7

Is this a .Net Framework or a .Net Core DLL? In PB2022 there's no longer a choice to choose .net framework:

That option is gone now. Not sure if this might be some kind of a bug?

If it IS .net Core, then there's a way of generating your .net DLL, adding all of the necessary .net Core dependencies. That way, your end user doesn't need to have .net core installed and you are sure they have the correct version. (I can't remember now which option that was, but I'm sure you can find it).

regards

Comment
There are no comments made yet.
Varga Zsolt Accepted Answer Pending Moderation
  1. Tuesday, 4 July 2023 15:14 PM UTC
  2. PowerBuilder
  3. # 8

Is this, you referred?

 

Napló neve: Application
Forrás: Application Error
Dátum: 2023.07.04. 17:06:27
Eseményazonosító:1000
Feladatkategória:(100)
Szint: Hiba
Kulcsszavak: Klasszikus
Felhasználó: n.a.
Számítógép: DESKTOP-O1UKMRF
Leírás:
A hibát okozó alkalmazás neve: genir.exe, verzió: 1.0.0.1, időbélyeg: 0x63764527
A hibát okozó modul neve: pbdotnet.dll, verzió: 22.0.0.1892, időbélyeg: 0x63763d74
Kivételkód: 0xc0000005
Hiba pozíciója: 0x00011178
A hibát okozó folyamat azonosítója: 0x2d58
A hibát okozó alkalmazás indításának időpontja: 0x01d9ae8911ef2512
A hibát okozó alkalmazás elérési útja: C:\_Gensoft_verziok\V220\V220_20230415\GENIR\genir.exe
A hibát okozó modul elérési útja: C:\_Gensoft_verziok\V220\V220_20230415\GENIR\pbdotnet.dll
Jelentés azonosítója: 4afc59be-459d-4e4e-a044-f31c477d9a2d
A hibát okozó csomag teljes neve:
A hibát okozó csomag relatív alkalmazásazonosítója:
Esemény XML:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="Application Error" />
<EventID Qualifiers="0">1000</EventID>
<Version>0</Version>
<Level>2</Level>
<Task>100</Task>
<Opcode>0</Opcode>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2023-07-04T15:06:27.7372310Z" />
<EventRecordID>194223</EventRecordID>
<Correlation />
<Execution ProcessID="0" ThreadID="0" />
<Channel>Application</Channel>
<Computer>DESKTOP-O1UKMRF</Computer>
<Security />
</System>
<EventData>
<Data>genir.exe</Data>
<Data>1.0.0.1</Data>
<Data>63764527</Data>
<Data>pbdotnet.dll</Data>
<Data>22.0.0.1892</Data>
<Data>63763d74</Data>
<Data>c0000005</Data>
<Data>00011178</Data>
<Data>2d58</Data>
<Data>01d9ae8911ef2512</Data>
<Data>C:\_Gensoft_verziok\V220\V220_20230415\GENIR\genir.exe</Data>
<Data>C:\_Gensoft_verziok\V220\V220_20230415\GENIR\pbdotnet.dll</Data>
<Data>4afc59be-459d-4e4e-a044-f31c477d9a2d</Data>
<Data>
</Data>
<Data>
</Data>
</EventData>
</Event>

Comment
There are no comments made yet.
Varga Zsolt Accepted Answer Pending Moderation
  1. Tuesday, 4 July 2023 14:54 PM UTC
  2. PowerBuilder
  3. # 9

yes, dotnet-runtime-6.0.16.

Comment
  1. Francisco Martinez @Appeon
  2. Tuesday, 4 July 2023 14:59 PM UTC
There should be a Windows Event Viewer log entry containing more information about the crash. Can you tell the user to get this log?
  1. Helpful
There are no comments made yet.
Francisco Martinez @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 4 July 2023 14:31 PM UTC
  2. PowerBuilder
  3. # 10

Hi Varga,

Does the client PC have the appropriate version of the .NET Runtime installed?

 

Regards,
Francisco

Comment
  1. Miguel Leeuwe
  2. Wednesday, 5 July 2023 08:02 AM UTC
Also, does the client PC have the correct PB Runtime installed?
  1. Helpful
There are no comments made yet.
Varga Zsolt Accepted Answer Pending Moderation
  1. Tuesday, 4 July 2023 13:55 PM UTC
  2. PowerBuilder
  3. # 11

Hi, Miguel,

I tried your version with the difference, that the external dll is in the same folder with the executable. Nothing has changed, the application stops without any message.

The most annoying thing is, that everything is OK on a computer, on which the PB22 is installed, no matter in which folder the executable and all other needed files are copied.

Zsolt

 

Comment
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Monday, 3 July 2023 14:58 PM UTC
  2. PowerBuilder
  3. # 12

What value do you have in "is_assemblypath" ? Is it a fixed path?

I've set it in the constructor to be a relative path like:

string ls_currentDir

if isvalid(gnv_app) then
	ls_currentDir = GetCurrentDirectory() // later we restore to the active/current (at this moment) directory.
	if len(gnv_app.is_appdir) > 0 then
		// is_appdir is where the EXE is (or pbt when running from the IDE)
		ChangeDirectory ( gnv_app.is_appdir )
	end if
end if

if handle(getapplication()) = 0 then
	// running from the IDE
	is_assemblypath = "..\..\SHARED\MyDll.dll"
else
	// running the executable
	is_assemblypath = "..\SHARED\MyDll.dll"
end if
	
// make sure the object has been loaded too:
this.of_createondemand( )

if len(ls_currentDir) > 0 then
	ChangeDirectory ( ls_currentDir )
end if

SHARED is a subfolder of where my EXE is distributed.

To make sure that the relative path "../" is correct, I call the

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.