1. Mathieu Normandeau
  2. PowerBuilder
  3. Friday, 16 July 2021 18:34 PM UTC

Hi,

I'm using Powerbuilder 2019 R2 and import a .NET Framework DLL 4.6 (Created Custom), encapsulate the dotnetassembly in the dotnet object as recommended.

 

When I run the program on the server side, i'm getting this error (Locally, i don't have any problem): 

"

Error Text: An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information."
 
I try few ways of fixing this, but none fixed it:
 
1) Create  a properties files for my dll (myDLL.config) like this:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<runtime>
<loadFromRemoteSources enabled="true"/>
</runtime>
</configuration>
 
2) create a properties files for my powerbuilder executable (myPowerbuilderApp.config) (didn't think it will work, but try it...) like this:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<runtime>
<loadFromRemoteSources enabled="true"/>
</runtime>
</configuration>
 
 
3) set true to the propertie "customappdomain " in the .net object
lnv_assembly = Create DotNetAssembly
ll_status = lnv_assembly.LoadWithDotNetFramework(This.is_AssemblyPath,true)

 

I cannot put a config file on the server side.

 

Any ideas?

 

Thanks,

Who is viewing this page
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Saturday, 17 July 2021 06:33 AM UTC
  2. PowerBuilder
  3. # 1

On this page https://code-examples.net/en/q/514d92 there's someone saying he solved it by (also?) doing the following:

"

I was having this same issue. The reason was that the Assembly file was blocked by Windows. I resolved it by right clicking on the Assembly file and selecting properties. In the Properties dialog, click Unblock button under the General tab and click Apply and then OK.

Reference: http://blogs.msdn.com/b/drew/archive/2009/12/24/xunit-and-td-net-fixing-the-attempt-was-made-to-load-an-assembly-from-a-network-location-problem.aspx

"

Comment
  1. CRISTIAN MEDINA
  2. Monday, 19 July 2021 15:05 PM UTC
You have to create the .config file for your .exe like app.config
  1. Helpful
  1. Miguel Leeuwe
  2. Monday, 19 July 2021 15:38 PM UTC
Hi Luis, That's exactly what Mathieu has been trying without success if I understood well.
  1. Helpful
  1. Miguel Leeuwe
  2. Monday, 19 July 2021 15:39 PM UTC
but ... at the same time he's also saying "I cannot put a config file on the server side." so I'm confused.
  1. Helpful
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.