ActiveVFP 6 LocalHost Installation - Error: Could not load type 'AVFPHandler'.

Topics: Developer Forum, Project Management Forum
Editor
Jul 15, 2013 at 5:46 PM
Hi all,

I'm trying to install ActiveVFP 6.0 on a laptop.

Perhaps I'm making things a bit difficult for myself but for initial testing I'm trying to install it on a virtual machine, details as follows;
  • Windows 8 Pro 64bit
  • 2GB memory
  • IIS 8
I believe that I've followed the installation guide correctly but when I try to run the default demo page, i.e. http://localhost/AFVPDemo/default.avfp, I'm getting a "Could not load type AVFPHandler" error message.
(please see full details below)

Please can somebody tell me what I've done wrong and how I might go about fixing this!

BTW, I'm thinking of creating/publishing some screen casts for this type of installation when I've finally get things working. Please let me know if you think that this would be helpful to others.

Also, I'm very interested in resolving this because I've got some significant plans for setting up some RESTful services using ActiveVFP installed on Server 2008 & 2012!


Thanks & regards
Simon Clark (aka SimpleSimon)

///////////////////////////////////////////////////////////////////////////////////////////////////////////
Server Error in '/' Application.

Could not load type 'AVFPHandler'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: Could not load type 'AVFPHandler'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[HttpException (0x80004005): Could not load type 'AVFPHandler'.]
System.Web.Compilation.BuildManager.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +462
System.Web.Configuration.HandlerFactoryCache.GetTypeWithAssert(String type) +38
System.Web.Configuration.HandlerFactoryCache.GetHandlerType(String type) +14
System.Web.Configuration.HandlerFactoryCache..ctor(String type) +20
System.Web.HttpApplication.GetFactory(String type) +78
System.Web.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +293
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +157

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.17929
///////////////////////////////////////////////////////////////////////////////////////////////////////////
Coordinator
Jul 15, 2013 at 5:56 PM
Is IIS in Full-Trust? That should be the default, but, I'm trying to think of reasons why the AVFP http handler would not work.

The AVFP http handler is a small ASP.NET HTTP Handler written in C# (it's called App_Code.dll in the Bin folder) that simply calls the ActiveVFP DLL and invokes the COM Interop stuff.

If you are running ASP.NET 4 or 4.5, then put the following in your Web.config:

<configuration>

<system.web>
<trust level="Full" />
</system.web>

</configuration>

This works at GoDaddy on their shared hosting so it should work for you too!
Coordinator
Jul 15, 2013 at 8:05 PM
Also, did you use the installer or zip file?

The Web.Config file is slightly different for each of them. So, if the Full-Trust advice above didn't work, try XCOPYing the zip file over to a new directory or the web root, if you originally used the Installer.
Editor
Jul 15, 2013 at 8:30 PM
Hi Claud,

My goodness, that was a quick response!!!

NB: I've hopefully managed to include some images properly? Please let me know if you don't get to see them.

I have done what you suggested which hopefully I've done correctly and that you can see below.

Image

Unfortunately, I'm now getting the following message - please note the highlight which I'm now looking into;
Image

Please me know if you have any other ideas - I'll continue with my investigations too.

Thanks again for your help Claude!
Simon
Editor
Jul 15, 2013 at 8:32 PM
claudefox wrote:
Also, did you use the installer or zip file?

The Web.Config file is slightly different for each of them. So, if the Full-Trust advice above didn't work, try XCOPYing the zip file over to a new directory or the web root, if you originally used the Installer.
Hi,

I did the installation via the zip file.

Thanks,
Simon
Coordinator
Jul 15, 2013 at 8:43 PM
Edited Jul 15, 2013 at 8:43 PM
Ok, if you go into IIS Manager and right click that Virtual Directory ('AVFPDemo'), you should be able to change it to an 'application'. That might be enough to make everything work!
Editor
Jul 15, 2013 at 9:06 PM
claudefox wrote:
Ok, if you go into IIS Manager and right click that Virtual Directory ('AVFPDemo'), you should be able to change it to an 'application'. That might be enough to make everything work!
Hi,

Had just spotted that I set it up as a "Virtual" directory didn't I - I'm a NUMPTY!!!

Had just converted it in IIS to set it up as an "Application" directory just before I saw this message from you and yes all OK now as I'm sure you knew it would be!
Image

You're a star Claude and I do apologise if you feel that I've just wasted some of your time.

Not that I'm very practised at making videos yet, but would it help if I do all this properly again from scratch and make some screen casts as I do it. Perhaps it will help others not to make the same silly mistake that I just did. If you like this idea then I can also do a similar thing when I set up a Server 2008/2012 installation which I am hoping to be able to do in the next week or so?

Thanks again & regards!!!
SimpleSimon (and now you know why I'm known as this)
Coordinator
Jul 15, 2013 at 9:57 PM
Absolutely, many have been asking for videos and what you've done is with the latest and greatest IIS versions, ASP.NET and avfp. Your setup is also similar to how it's now done on GoDaddy, so it will help with that as well!