Web Connection
Error on Scriptmap
Gravatar is a globally recognized avatar based on your email address. Error on Scriptmap
  Joy Tan
  All
  Mar 8, 2019 @ 11:48am

Hi Rick,

I'm trying to setup a scriptmap. Got it working on a new server with simple setup for wc, wwd etc. but it was set up under /wconnect virtual directory now I want to make it work on the root but when I copy the scriptmap setting for the virtual folder and try the same query, it gives me "Could not load file or assembly 'WebConnectionModule' or one of its dependencies. The system cannot find the file specified." Error.

e.g. http://[domain]/wconnect/TestPage.wwd?Name=Rick&Company=West+Wind ==> works

http://[domain]/TestPage.sa?Name=Rick&Company=West+Wind ==> fails with the above error.

can I just copy or use the web.config from virtual "wconnect" to the root?

Thanks, Joy

Gravatar is a globally recognized avatar based on your email address. re: Error on Scriptmap
  Rick Strahl
  Joy Tan
  Mar 8, 2019 @ 11:56am

Don't know without more info.

Did you go through proper configuration for the site? You have to do the same configuration for the root as the virtual. If you did this manually check here:

Web Connection IIS Configuration

Make sure you set the Application Pool and .NET 4.0 for the .NET runtime for the Application Pool.

If this is a new application built with the new project system you should just be able to change the virtual in the app.ini file.

Deploy with Server Configuration Script

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Error on Scriptmap
  Joy Tan
  Rick Strahl
  Mar 8, 2019 @ 01:04pm

HI Rick,

I didn't build a new application yet. I was using wcdemomain.prg with your samples from default.html all I wanted was to get the root domain running with your samples using a scriptmap

Joy

Gravatar is a globally recognized avatar based on your email address. re: Error on Scriptmap
  Joy Tan
  Joy Tan
  Mar 8, 2019 @ 01:26pm

Hi Rick,

I was trying to setup the same scriptmap at the root domain level.

Joy

Gravatar is a globally recognized avatar based on your email address. re: Error on Scriptmap
  Rick Strahl
  Joy Tan
  Mar 8, 2019 @ 01:30pm

That should work unless .NET is not set up for that application pool. You should just be able to copy all your script maps from the virtual's web.config and paste them into the web.config at the root.

I think the error may actually have to do with the fact that you are now nesting your applications. The root will push all of its settings into the virtual that sits below it - the error might actually be because of the child application not knowing which DLL to use. I would move the virtual to a separate Web site or create a new Web Site in IIS and configure either in isolation first to make sure you get the configuration right individually.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Error on Scriptmap
  Joy Tan
  Rick Strahl
  Mar 8, 2019 @ 01:51pm

Hi Rick,

Tried to use this at the root level....

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <configSections>
    <section name="webConnectionConfiguration" type="System.Configuration.NameValueSectionHandler,System,Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
    <section name="webConnectionVisualStudio" type="System.Configuration.NameValueSectionHandler,System,Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
  </configSections>
  <appSettings>
    <add key="enableSimpleMembership" value="false" />
  </appSettings>
  <webConnectionConfiguration>
    <!-- NOTE: These settings apply only to the Web Connection Managed Module! -->
    <add key="MessagingMechanism" value="File" />
    <add key="Timeout" value="90" />
    <add key="TempPath" value="~\..\temp\" />
    <add key="TempFilePrefix" value="WC_" />
    <add key="ComServerProgId" value="wcdemo.wcdemoServer" />
    <add key="ComServerLoadingMode" value="LoadBased" />
    <add key="ServerCount" value="2" />
    <add key="AutoStartServers" value="False" />
    <add key="ExeFile" value="~\..\wcdemo.exe" />
    <add key="UpdateFile" value="~\..\wcdemo_Update.exe" />
    <add key="AdminAccount" value="ANY" />
    <add key="AdminPage" value="/admin/admin.aspx" />
    <add key="LogDetail" value="False" />
    <add key="ValidateRequest" value="False" />
    <add key="MessageDisplayFooter" value="Generated by Web Connection IIS .NET Connector Module" />
    <add key="UseStaComServers" value="False" />
    <add key="UseCustomManifestLoading" value="False" />
    <add key="AuthenticationMode" value="Default" />
    <add key="PassAspNetContext" value="False" />
  </webConnectionConfiguration>
  <webConnectionVisualStudio>
    <!-- Configuration Settings for the Web Connection Visual Studio Add-in 
       Not used at runtime, only at the design time -->
    <add key="FoxProjectBasePath" value="d:\webware70\" />
    <add key="WebProjectBasePath" value="d:\webware70\web\" />
    <add key="WebProjectVirtual" value="http://localhost/wconnect" />
    <!-- Optional PRG launched when VFP IDE launches -->
    <add key="IdeOnLoadPrg" value="" />
    <!-- The editor used to edit FoxPro code - blank means FoxPro Editor is used -->
    <add key="FoxProEditorAlternate" value="%LocalAppData%\Programs\Microsoft VS Code\Code.exe" />
  </webConnectionVisualStudio>
  <system.web>
    <compilation defaultLanguage="c#" debug="true" targetFramework="4.0" />
    <!-- ASP.NET Request Limit Configuration for POST buffer and Script Timeout -->
    <httpRuntime maxRequestLength="10000000" executionTimeout="120" requestValidationMode="2.0" />
    <!-- Web Connection Managed Module requires that it runs in FULL TRUST (COM Interop) -->
    <trust level="Full" />
    <httpHandlers>
    </httpHandlers>
    <httpModules>
    </httpModules>
  </system.web>
  <!-- IIS 7 Script Map Configuration -->
  <system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <!-- use this on IIS 7.5 and later to bypass IIS default Error handlers for failures -->
    <!-- httpErrors existingResponse="PassThrough" /-->
    <!-- IIS 7 Script Map Configuration -->
    <handlers>
      <add name=".wc_wconnect-module" path="*.wc" verb="*" type="Westwind.WebConnection.WebConnectionHandler,WebConnectionModule" preCondition="integratedMode" />
      <add name=".wcs_wconnect-module" path="*.wcs" verb="*" type="Westwind.WebConnection.WebConnectionHandler,WebConnectionModule" preCondition="integratedMode" />
      <add name=".md_wconnect-module" path="*.md" verb="*" type="Westwind.WebConnection.WebConnectionHandler,WebConnectionModule" preCondition="integratedMode" />
      <add name=".wwd_wconnect-module" path="*.wwd" verb="*" type="Westwind.WebConnection.WebConnectionHandler,WebConnectionModule" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode" />
      <add name=".ms_wconnect-module" path="*.ms" verb="*" type="Westwind.WebConnection.WebConnectionHandler,WebConnectionModule" preCondition="integratedMode" />
      <add name=".blog_wconnect-module" path="*.blog" verb="*" type="Westwind.WebConnection.WebConnectionHandler,WebConnectionModule" preCondition="integratedMode" />
    </handlers>
    <defaultDocument>
            <files>
                <remove value="default.aspx" />
                <remove value="iisstart.htm" />
                <remove value="index.html" />
                <remove value="index.htm" />
                <remove value="Default.asp" />
                <remove value="Default.htm" />
                <add value="indexv3.html" />
            </files>
    </defaultDocument>
    <!-- 
      EXTENSIONLESS URL HANDLING
      - Requires IIS Url Rewrite Module 2.0 (Web Platform Installer)

      matches any URLs that do not have a '.' in the path    
  -->
    <!--
    <rewrite>
      <rules>

        <rule name="Redirect to HTTPS" stopProcessing="true">
          <match url="(.*)" />
          <conditions>
            <add input="{HTTPS}" pattern="^OFF$" />
          </conditions>
          <action type="Redirect" url="https://{HTTP_HOST}{URL}" redirectType="SeeOther" />
        </rule>

        <rule name="Extensionless Urls" patternSyntax="ECMAScript" stopProcessing="true">
          <match url="^((?!\.).)*$" />
          <conditions>
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
          </conditions>
          <action type="Rewrite" url="UrlRewriteHandler.wwd" appendQueryString="true" />
        </rule>

      </rules>
  </rewrite>
  -->
  </system.webServer>
</configuration>

But this web.config causes an error

Joy

Gravatar is a globally recognized avatar based on your email address. re: Error on Scriptmap
  Rick Strahl
  Joy Tan
  Mar 8, 2019 @ 03:16pm

What is the exact error and are you sure you have the bin folder with webconnectionmodule.dll in it?

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Error on Scriptmap
  Joy Tan
  Rick Strahl
  Mar 10, 2019 @ 03:23pm

HI Rick,

To re-create this error:

  1. run setup and setup a virtual /wconnect with the root
  2. test wcdemomain.prg with default.html in /wconnect/default.html
  3. so I know that scriptmap .wwd works
  4. go to the root in IIS, add managed handler, create same scriptmap for .wwd
  5. test the same url: localhost/TestPage.wwd?Name=Rick&Company=West+Wind

Note the url is in the root and not using the /wconnect

  1. Error occurs as follows:
Server Error in '/' Application.
Could not load file or assembly 'WebConnectionModule' or one of its dependencies. The system cannot find the file specified.
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.IO.FileNotFoundException: Could not load file or assembly 'WebConnectionModule' or one of its dependencies. The system cannot find the file specified.

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.

Assembly Load Trace: The following information can be helpful to determine why the assembly 'WebConnectionModule' could not be loaded.


WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].


Stack Trace:


[FileNotFoundException: Could not load file or assembly 'WebConnectionModule' or one of its dependencies. The system cannot find the file specified.]
   System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type) +0
   System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName) +70
   System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark) +40
   System.Type.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +37
   System.Web.Compilation.BuildManager.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +65
   System.Web.Configuration.HandlerFactoryCache.GetTypeWithAssert(String type) +38
   System.Web.Configuration.HandlerFactoryCache.GetHandlerType(String type) +13
   System.Web.Configuration.HandlerFactoryCache..ctor(String type) +21
   System.Web.HttpApplication.GetFactory(String type) +86
   System.Web.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +224
   System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +48
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +159


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.3282.0 

Joy

Gravatar is a globally recognized avatar based on your email address. re: Error on Scriptmap
  Rick Strahl
  Joy Tan
  Mar 10, 2019 @ 08:35pm

I don't know but there's something different. Make sure the site is bound to an application pool and the pool has a .NET version configured. Also make sure the root site has permissions to read in the bin folder. In fact make sure that the /bin folder exists and that WebConnectionModule.dll is in there.

Something is not working in resolving that path to find the DLl as the File not Found exception points out.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Error on Scriptmap
  Joy Tan
  Rick Strahl
  Mar 11, 2019 @ 11:02am

HI Rick,

In trying to setup script map for my root domain, There are three ways to add a scriptmap for WC:

  1. Add Managed Handler

Where type is "Westwind.WebConnection.WebConnectionHandler,WebConnectionModule"

  1. Add Script Map

Where Executable points to : wc.dll or WebconnectionModule.dll

For # 1, adding a scriptmap fails with the application error For # 2, adding WebConnectionModule.dll fails with error 500 For # 2, adding wc.dll works (that's the old way that I was used to)

In short, I am not sure how to get the WebConnectionModule.dll or Managed Handler set up properly.

Thanks, Joy

Gravatar is a globally recognized avatar based on your email address. re: Error on Scriptmap
  Rick Strahl
  Joy Tan
  Mar 11, 2019 @ 01:14pm

Joy,

You don't need to use the IIS Manager - the settings are set in web.config:

Script Map Configuration

I maintain that you either are missing the /bin folder with the WebConnectionModule.dll or you have the root pointed at an invalid folder. Make sure that your Web path points at the right folder!

I can't help you beyond what I already told you other than looking at it and seeing what you are actually doing.

+++ Rick ---

© 1996-2024