on 03-14-2013 9:29 PM
Hi
I'm trying to run an app (on the PB IDE) on a network drive (as users will do), and my app calls a webservice thru a wcf client and I get a Error: Fail to load the assembly for the Web Service.
On my network drive I copied all my app .pbds and .exe, and also:
At first I thought it was a problem with my 64bits PC, but it does the same for a 32bits PC, locally the app runs fine, but not on the network drive.
I tried executing CASPol -all -resolveperm networkPath\n_picfews.dll but I'm getting a ERROR: Unable to load assembly.
I also found something about having the bin folder of the 32 bit .Net framework on the System Path, but first of all there's no BIN folder there
and second, the SYSTEM PATH variable has the framework 4 for 32 bits path
C:\app32\cperez\product\11.2.0\client_32\bin;C:\app\cperez\product\11.2.0\client_32\bin;C:\app\cperez\product\11.2.0\client_1\bin;
C:\oracle\orav11r2\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;
C:\Windows\Microsoft.NET\Framework\v2.0.50727;C:\Windows\Microsoft.NET\Framework\v4.0.30319;C:\Program Files (x86)\Sybase 10.5\Shared\PowerBuilder;C:\Program Files (x86)\Sybase 10.5\Shared\DataDirect;C:\Program Files (x86)\Sybase 10.5\Shared\DataDirect52;C:\Program Files (x86)\Sybase 11.5\Shared\PowerBuilder;C:\Program Files (x86)\Java\jre7\bin;C:\Program Files (x86)\Java\jre7\bin\client;C:\Program Files (x86)\Sybase 11.5\Shared\PowerBuilder\;C:\Program Files (x86)\Sybase 11.5\PowerBuilder 11.5;C:\Program Files (x86)\Sybase 12.5\Shared\PowerBuilder;C:\Program Files (x86)\Sybase 12.5\PowerBuilder 12.5;C:\Program Files\Microsoft\Web Platform Installer\
.Net has a restriction on running managed code from a network drive. You have to do a bit of work in order to overcome that security restriction.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
ok... but by "rename" I mean in the wcf client project ... I only saw the option to sign the assembly when you deploy an app, I just want to run my desktop app thru the IDE on a network drive? (cause thats the version when another developer and I are leaving our work, Source Control didn't work.. in fact, it create a mess (that's another discussion)).
I'm not even deploying yet.
All I can suggest is using Process Monitor and perhaps the Fusion Log Viewer to get more specifics about why the assembly isn't loading.
Hi Bruce
I tried to sign my webservice, but this webservice calls 3 different webservices (2 from a 3rd-party) and are not signed, so PB returns an error for each webservice internally called and doesn't allow me to sign mine.
All of our apps (classic) are deployed on a network drive, is there anything else I can do??
Ummm, yes I'm calling actually 4 webservices (2 from a 3rdparty, 1 made on PB11.5 (our property), and 1 made with Java (our property)), and PB12.5.1 don't let me sign my webservice on PB12.5.1 because the DLLs created with the wcf client are not signed.
The Java webservice seems to be signed cause there's no error for it.
I tried to signed the PB11.5 webservice on its deploy and got a success deploy, for the other 2 webservices (3rd party), I followed a document from someone I believe you know very well: http://brucearmstrong.sys-con.com/node/2133766/mobile.
So, I thought I had it done, but if I deploy the PB12.5.1 webservice including its signature, I get the same 3 errors saying that 3 of the webservices I'm calling are not signed, I also tried taking the 4 dlls created by the wcf clients and following the disassembly, re-assembly (with signature), and adding to the GAC, etc etc. that's on http://brucearmstrong.sys-con.com/node/2133766/mobile.
Then I tried by not signing my PB12.5.1 on deploy, but applying it (again) the steps on
http://brucearmstrong.sys-con.com/node/2133766/mobile
Let's call this webservice mywebservice.dll
And on my PB12.5.1 CLASSIC app I created my .dll with another name mywebservice_client.dll and did the same process.
I'm really lost here, 'cause I have never work with .Net, I don't know what's the difference between my dll created on PB12.5.1 and the one created by its client, are they the same??
I'm not really happy with the steps I have done 'til now, 'cause PB11.5 seems not to be signing, and there's no information on the dll about the company, product name, version, etc., because I did a fake signing, as for the PB12.5.1 dlls (webservice and its client).
UPDATE:
Ok Bruce, now it works on a network drive but only thru the PB IDE, my EXE has the bug from the another discussion when evaluating error 0 (zero) is different from 0 (zero) and the messagebox that crashes PB because there's no error message (NULL), I know it because I added a previous messagebox on the else clause... so... Why This Fails???
Message was edited by: Claudia Perez
OK, I understand the issue now. You're right, the WCF proxy assembly that PowerBuilder.Net creates isn't signed. I actually covered that issue in my last PowerBuilder.TV webcast on creating a WCF wrapper for the WCF client and using it from PowerBuilder Classic.
When you signed your wrapper assembly, PowerBuilder creates a strong name key file for you. You need that and 2 other utilities to resolve the issue. The first utility is ILDASM, which is part of the Windows SDK. It allows you to disassembly an assembly into Intermediate Language (IL) format. The second utility is ILASM, which is part of the .Net Framework. It allows you to compile an IL file back into an assembly. You should already have both on your development machine.
What you're going to do is decompile the proxy assemblies that PowerBuilder.Net generated. Then you're going to immediately recompile them again, but when you do it you're going to reference that strong key name file that PowerBuilder generated so that the newly recompiled assembly is strong name signed.
In the example from PowerBuilder.TV, my assembly name was amazonservice.dll and the strong name key file was called amazonwrapper.snk. I simply ran this:
"C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\x64\ildasm.exe" /all /out=amazonservice.il amazonservice.dll
Followed by this:
ilasm /dll /key=amazonwrapper.snk amazonservice.il
And voila! the assembly is now signed.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.