Blog Posts
Solved: wwDotnetBridge Load Errors due to Windows File Blocking
Gravatar is a globally recognized avatar based on your email address. Solved: wwDotnetBridge Load Errors due to Windows File Blocking
  Rick Strahl
  All
  Sep 24, 2018 @ 04:30pm

I'm excited that I found a workaround for a nasty problem related to Windows Security when using wwDotnetBridge. Windows marks files downloaded from the Internet either directly or inside of a Zip archive as blocked and wwDotnetBridge is affected by that often resulting in errors when first trying to use wwDotnetBridge.

After reading about some other security related issues in Windows, I by chance ran into some information on how Zone Identifiers work and with that information was able to bake unblocking directly into the wwDotnetBridge FoxPro code.

You find out more in this blog post:

These changes will be in the next updates for Web Connection, West Wind Client Tools and the open source version of wwDotnetBridge shortly.

Enjoy,

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Solved: wwDotnetBridge Load Errors due to Windows File Blocking
  Jeff L
  Rick Strahl
  Sep 25, 2018 @ 07:18am

Congratulations, Rick.

Yep, when I first tried to use wwDotnetBridge I got the blocking error and had to post here on the forum to get the fix.

This sure will make everyone's life easier!

Gravatar is a globally recognized avatar based on your email address. re: Solved: wwDotnetBridge Load Errors due to Windows File Blocking
  Rick Strahl
  Jeff L
  Sep 25, 2018 @ 02:31pm

Yup... I'm pretty excited about this because this has been one of the biggest support issues - I also suspect this makes quite a few people just walk away because they likely never get to the documentation part 😃

Worse - I just realized the wwClientTools were loading wwDotnetBridge by default and if it failed it wouldn't run at all. Added some additional check logic so that it will work now (if for some reason unblocking isn't the problem) even if wwDotnetBridge can't run.

All those little bloody details...

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Solved: wwDotnetBridge Load Errors due to Windows File Blocking
  Jill Lindgren
  Rick Strahl
  Nov 7, 2018 @ 10:14am

Hi. I get this error. I tried putting the code you suggest in several places (in the method in my form, in the load of my form, at the top of the wwdotnetbridge.prg), and nothing changes.
Can you clarify for me where the lines of code that produce the Wahlah! are to be put until your new release comes out? Thanks.

Gravatar is a globally recognized avatar based on your email address. re: Solved: wwDotnetBridge Load Errors due to Windows File Blocking
  Rick Strahl
  Jill Lindgren
  Nov 7, 2018 @ 03:08pm

It has to be done before wwdotnetbridge gets loaded for the first time...

wwDotnetBridge has it inside of it's Load() method (here):

FUNCTION Load(llNoUnblockOnError)
LOCAL lcError, lnSize, lnDispHandle, lcPath, lcCmd

IF VARTYPE(this.oDotNetBridge) != "O"
	this.SetClrVersion(this.cClrVersion)
	
	IF this.lUseCom
		this.oDotNetBridge = CREATEOBJECT("Westwind.wwDotNetBridge")
	ELSE	
		*** Load by filename - assumes the wwDotNetBridge.dll is in the Fox path
	   	DECLARE Integer ClrCreateInstanceFrom IN WWC_CLR_HOSTDLL string, string, string@, integer@

		*** Remove the Zone Identifier to 'Unblock'
	     	DECLARE INTEGER DeleteFile IN WIN32API STRING		  			  			
   	        DeleteFile(FULLPATH("wwDotNetBridge.dll") + ":Zone.Identifier")
		
		#IF IS_WESTWIND
			DeleteFile(FULLPATH("Newtosoft.Json.dll") + ":Zone.Identifier")
			DeleteFile(FULLPATH("Markdig.dll") + ":Zone.Identifier")
		#ENDIF
			
		lcError = SPACE(2048)
		lnSize = 0
		lnDispHandle = ClrCreateInstanceFrom(FULLPATH("wwDotNetBridge.dll"),;
				"Westwind.WebConnection.wwDotNetBridge",@lcError,@lnSize)
...

+++ Rick ---

© 1996-2024