Visual 2010 Express Debugging w/AVFP 5.51 ASP 2.0

Topics: User Forum
Feb 3, 2012 at 11:43 PM

I want to begin a project with ActiveVFP. I've  played around with good success, but I want as many debugging tools as are available.

I read here ( http://activevfp.codeplex.com/discussions/277623 )
that debugging in VFP can be achieved using VS2010 and v.5.51 for asp 2.0.  So I:

A)
- Setup a fresh  Windows 7 32-bit Ultimate  virtual VHD (hyper-v)
- installed Visual Studio Express 2010 and updated the many service packs
- installed VFP 9 sp 2 and Notepad ++
- enabled IIS and ASP & ASP.NET

And saved an image of that virtual machine.

B) Restarted and Installed AVFP 5.51 for ASP 2.0 using the installer - worked perfectly.

C)  Open Command as admin.

C:\WINDOWS\SYSTEM32\REGSVR32 C:\AVFP5.51DEMO\ACTIVEVFP.DLL  (succeeded)

From Visual Studio 2010 > Open Web Site > Open  Default.aspx from Solution Explorer. Click Debug. worked perfecly.

D) From VisualStudio 2010 > Open Web Site > Open  Debug.aspx . Click Debug. > This error:

URL: http://localhost:50705/avfp5.51Demo/debug.aspx

Caught .NET exception, source: ActiveVFP.server activevfp.server message: .error
c:\avfp5.51demo\prg\activevfp.prg Error in line 71 Alias 'OPROP' is not found. 13


E) Downloaded the source code from: http://activevfp.codeplex.com/SourceControl/list/changesets

 This project is for 5.61 , not 5.51, but my guess is the problem is occurring here:
 
 Line 70 of PROXYSTUB.PRG:  lcReturn = loFox.eval("proxystub()")
 
F) I have been able to recreate ACTIVEVFP.DLL from the project manager. ( I tried a few things myself)
 

G) In VFP, while the debugger is working:

CHDIR C:\AVFP5.51DEMO\PRG
SET DEFAULT TO C:\AVFP5.51DEMO\PRG
Open the Debug window and can see activeVFP objects   have been created:
They each are null valued, but intellisense works so VFP is talking to them

I can see:  oRequest, oSession, oResponse, oApplication, oServer... but not oProp.

Coordinator
Feb 4, 2012 at 1:07 AM
Edited Feb 4, 2012 at 1:07 AM

No need to register (regsvr32) anything and that's not in the instructions.  Why did you do that?

Anyway, what exactly is the problem?  You don't see oProp while debugging??  (please make questions short and concise)

Feb 4, 2012 at 1:33 AM

 

No need to register (regsvr32) anything and that's not in the instructions.  Why did you do that?

~~~Why the long setup? I guess I was trying to make the point that the machine I'm working on is as clean as you can get.

Why REGSRV32?  If I don't, I get the same error as Vivek reported in this thread:

http://www.foxite.com/archives/let-us-know-if-avfp551561-works-for-u-0000333989.htm

But that error occurs ONLY when I invoke either Default.aspx or Debug.aspx from VS 2010. Everything's great from a browser.

Anyway, what exactly is the problem?  You don't see oProp while debugging??  (please make questions short and concise)

~~~At letter D in the original post:

From VisualStudio 2010 > Open Web Site > Open  Debug.aspx . Click Debug. > This error:

"Caught .NET exception, source: ActiveVFP.server activevfp.server message: .error
c:\avfp5.51demo\prg\activevfp.prg Error in line 71 Alias 'OPROP' is not found. 13"


In the VFP debug window, at the point of the error, I can see these objects have been  instatiated:
oRequest, oSession, oResponse, oApplication, oServer

and I can get no further

Thanks for asking... really!

 

Coordinator
Feb 4, 2012 at 12:00 PM

Everything needs to be 5.51 for debugging.  .AVFP files won't work past the default page.  This is because I couldn't get the debugger to work with the HTTP Handler.

If all your files are .htm instead of .avfp, everything should work and you should be able to go from page to page in the debugger.

There may be little issues with seeing values in the debugger but I don't think I can be anymore help with that.  If you could determine the problem, that would be great. 

Feb 4, 2012 at 5:03 PM

ONLY the "5.51 Demo for ASP 2.0" files are installed - the one posted on 1-18-2012. No .AVFP files.

I don't have DEBUG.ASPX working for 5.51 for ASP 2 yet.

It looks like ACTIVEVFP.DLL , WEB.CONFIG and ACTIVEVFP_DOTNETPROXY.DLL  were changed for 1-18-2012 update.

Do you have copies of those files from before that update?  And/or a full Project file from before the 1-18-2012 updates. I'd be happy to compare the 5.51 and 5.61 projects - one that is working and one that isn't.

What is the benefit to .AVFP vs .HTML files? They'll behave the same, right?

Coordinator
Feb 4, 2012 at 5:23 PM

I  just downloaded the source into my \avfp5.51Demo\prg, fired up Visual Studio 2010 and the vfp ide and everything is working in the Debug window in Foxpro...   so I guess I just don't see the problem     ...

1.)  Does it hit the Set Step ON in proxystub.prg??

2.) Can you Set Step ON in your script files?? 

all this works for me.

Feb 4, 2012 at 9:08 PM

Good to know that debugger works in 5.51 but you have a windows configuration/setting somewhere that I don't

I just tried exactly the same sequence as in the initial post in a Win8-32 virtual machine. and exactly the same behavior as Win7 32.

1.)  Does it hit the Set Step ON in proxystub.prg??

No - the debug.aspx file hits

    Response.Write(x.Debugger());

and then immediately jumps to the

catch(Exception ex)

and the browser shows the:  Caught .NET exception, source: ActiveVFP.server activevfp.server message: .error......

I don't have the 5.51 source code, but I'll bet line 70 of proxystub.prg is the: lcReturn = loFox.eval("proxystub()")

I only have the 5.61 source. Is the 5.61 and 5.51 source similar enough that I can add debugs and recompile and copy the generated ACTIVEVFP.DLL file to C:\AVFP5.51Demo folder (overwriting the original)

I'd have to regsvr the new DLL too.

 

Feb 4, 2012 at 9:16 PM

By the way, I setup a win8-32 machine today too (w/VFP9 sp2/ VS2010 express)

and installed AVFP5.51 for ASP 2.0 and got exactly the same errors:

I had to regsvr32 the activevfp.dll  to get the demo to work from VS2010

I ran into the same: c:\avfp5.51demo\prg\activevfp.prg Error in line 71 Alias 'OPROP' is not found. 13

error when opening  DEBUG.ASPX and running pressing the Debug in VS2010

Coordinator
Feb 4, 2012 at 9:39 PM

It works for me with no special configuration , no regsvr32, or anything,  I'm not seeing the probs so I can't help. sorry

Feb 5, 2012 at 2:56 AM

 

Well I got debugging working with v5.51 for ASP 2.0 and here's how I did it.

I downloaded the source code and unzipped it to c:\source

In the VFP IDE:

SET DEFAULT TO C:\SOURCE\PRG

oProp=NEWOBJECT('AVFPproperties','activevfp.prg')

Then switch to VS 2010 and Run the Debug.aspx file.. and voila.

VFP just wanted  the object" Oprop" to exist first. That worked for both the Win 7-32 and Win 8-32 machines.

Coordinator
Feb 5, 2012 at 8:01 AM

Thanks.  I'm glad you got it to work!

Feb 5, 2012 at 11:50 AM

Yeah.. well I was pretty pleased.

So if your install doesn't need activevfp.dll registered, then can you still run your c:\avfp5.51demo\default.aspx   from VS2010  if you:

c:\windows\system32\regsvr32   c:\avfp5.51demo\activevfp.dll   /U

which will unregister acvtivfp.dll ?

(remove the /U to re-register)

By the way, I just stumbled upon this project last month and it's pretty cool. Thanks for sticking with it.