Quantcast
Channel: West Wind Message Board Messages
Viewing all articles
Browse latest Browse all 10393

Re: web.config vs. wc.ini

$
0
0
Re: web.config vs. wc.ini
Web Connection 5.0
Re: web.config vs. wc.ini
Apr. 22, 2013
09:03 am
3RN0JFIN2Show this entire thread in new window
Gratar Image based on email address
From:Stein Goering
To:Rick Strahl

The web.config in question should be in the root of the virtual or root web and the /bin folder needs to be off that.

What was confusing me is that some of my customers set up classic script maps on the root web and let the virtual inherit them. So you could hit a page as either http://70.167.40.115/testpage.awp or http://70.167.40.115/wconnect/testpage.awp. I was trying to simulate that so put the web.config file in the root folder.

That way it will try to load the pages either way - but for the handler to work, I had to put a bin folder with the DLL in <b>both</b> the root and virtual folders. But with that in place, you can launch the page from either link.

I assume that DCOM setup works the same for the Managed Module as it did under ISAPI.

--stein


If /wconnect is a virtual in your app, then that's the folder the the COM application runs out of.

I suppose *that* might actually a way that you can run multiple virtuals out of a single folder.

Typically you'll want to avoid that though, so I guess you are explicitly referencing URLs in the /wconnect folder.

+++ Rick ---


OK, that worked. But I don't understand why. I originally had the DLL in wwwroot\bin thinking it would look for a bin folder relative to the config file's location, but evidently that's not the case. How the heck does it know to look in inetpub\wwwroot\wconnect\bin? The web.config file resides in wwwroot, and as far as I can see, it has no reference to the project folder's location.

Also, I notice for some of my mapping entries I have preCondition="integratedMode,runtimeVersionv2.0", while others skip the runtimeVersion flag. They seem to work either way. Is there a preference?

--stein


Make sure the module DLL is in the BIN folder of the project...

+++ Rick ---



OK, I copied webconnectionmodule.dll to wwwroot\bin and set up the web config shown below. I tried to replicate the relevant entries from the sample files, but when trying to load one of my app's pages I get the following error:
Could not load type 'Westwind.WebConnection.WebConnectionHandler'.

Anyone see what I might be missing?

--stein

<?xmlversion="1.0" encoding="UTF-8"?><configuration><configSections><sectionname="webConnectionConfiguration" type="System.Configuration.NameValueSectionHandler,System,Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /><sectionname="webConnectionErrorPages" type="System.Configuration.NameValueSectionHandler,System,Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /></configSections><system.web><trustlevel="Full" /><customErrorsmode="Off" /></system.web><system.webServer><handlers><removename="wwc" /><removename="ASPClassic" /><removename="WCS" /><removename="WC" /><removename="aceweb" /><addname="ASPClassic" path="*.asp" verb="*" modules="IsapiModule" scriptProcessor="%windir%\system32\inetsrv\asp.dll" resourceType="Unspecified" requireAccess="Script" /><addname="awp_Aceweb" path="*.awp" verb="*" type="Westwind.WebConnection.WebConnectionHandler" resourceType="Unspecified" preCondition="integratedMode" /><addname="awp1_AcewebAlt1" path="*.awp1" verb="*" type="Westwind.WebConnection.WebConnectionHandler" resourceType="Unspecified" preCondition="integratedMode" /><addname="wc_wconnect" path="*.wc" verb="*" type="Westwind.WebConnection.WebConnectionHandler,WebConnectionModule" preCondition="integratedMode,runtimeVersionv2.0" /><addname="wcsx_wconnect" path="*.wcsx" verb="*" type="Westwind.WebConnection.WebConnectionHandler,WebConnectionModule" preCondition="integratedMode,runtimeVersionv2.0" /><addname="wcs_wconnect" path="*.wcs" verb="*" type="Westwind.WebConnection.WebConnectionHandler,WebConnectionModule" preCondition="integratedMode,runtimeVersionv2.0" /></handlers></system.webServer><appSettings><addkey="FoxProjectBasePath" value="c:\wconnect\" /></appSettings><webConnectionConfiguration><addkey="Timeout" value="300" /><addkey="PollTimeout" value="100" /><addkey="PostBufferLimit" value="0" /><addkey="TempPath" value="c:\temp\wc\" /><addkey="TempFilePrefix" value="WC_" /><addkey="MessagingMechanism" value="Automation" /><addkey="UseCustomManifestLoading" value="False" /><addkey="AdminAccount" value="ANY" /><addkey="AdminPage" value="/wconnect/admin/admin.asp" /><addkey="ExeFile" value="c:\wconnect\aw3.exe" /><addkey="UpdateFile" value="c:\wconnect\updates\aw3.exe" /><addkey="LogDetail" value="False" /><addkey="ValidateRequest" value="False" /><addkey="ComServerProgId" value="aw3.AceWebServer" /><addkey="ServerCount" value="2" /><addkey="AutoStartServers" value="True" /><addkey="ComServerLoadingMode" value="LoadBased" /><addkey="PassAspNetContext" value="False" /><addkey="MessageDisplayFooter" value="<small>Page generated by Web Connection IIS Connector Module</small>" /><addkey="AuthenticationMode" value="Default" /><addkey="FileServerAutoStartAccountMode" value="Interactive" /><addkey="UseCustomManifestLoading" value="False" /></webConnectionConfiguration><webConnectionErrorPages><addkey="Exception" value="" /><addkey="OleError" value="" /><addkey="Timeout" value="" /><addkey="NoOutput" value="" /><addkey="Busy" value="" /><addkey="Maintenance" value="" /><addkey="InvalidRequestId" value="" /><addkey="TranmitFileFailure" value="" /><addkey="PostBufferSize" value="" /></webConnectionErrorPages></configuration>

Yes that's about it.

You DO need to add the script mappings into the web.config file. The mappings point each script map at the Web Connection Module.

<system.webServer><httpErrors existingResponse="PassThrough" /><!-- IIS 7 Script Map Configuration --><handlers><addname=".wc_wconnect-module" path="*.wc" verb="*" type="Westwind.WebConnection.WebConnectionHandler,WebConnectionModule" preCondition="integratedMode"/><addname=".wcs_wconnect-module" path="*.wcs" verb="*" type="Westwind.WebConnection.WebConnectionHandler,WebConnectionModule" preCondition="integratedMode"/><addname=".wcsx_wconnect-module" path="*.wcsx" verb="*" type="Westwind.WebConnection.WebConnectionHandler,WebConnectionModule" preCondition="integratedMode"/><addname=".wwsoap_wconnect-module" path="*.wwsoap" verb="*" type="Westwind.WebConnection.WebConnectionHandler,WebConnectionModule" preCondition="integratedMode"/><addname=".wwd_wconnect-module" path="*.wwd" verb="*" type="Westwind.WebConnection.WebConnectionHandler,WebConnectionModule" preCondition="integratedMode"/><addname=".blog_wconnect-module" path="*.blog" verb="*" type="Westwind.WebConnection.WebConnectionHandler,WebConnectionModule" preCondition="integratedMode"/></handlers></system.webServer>


etc.

You can look at the generate maps in the new project to see exactly other things are needed in your web.config file.


+++ Rick ---


Rick,

Can you provide a quick step by step for converting an existing ISAPI setup to the managed module? (What I found in the docs addresses setting up a new project to run under the MM.)

This is under IIS7 on Server 2008 so I already have a web.config file in wwwroot pointing my script maps to wc.dll. Do I just modify (or replace) those to follow this format?
<add name="*.wc_wconnect" path="*.wc" verb="*" type="Westwind.WebConnection.WebConnectionHandler,WebConnectionModule" preCondition="integratedMode,runtimeVersionv2.0" />

I would then add <webConnectionConfiguration> and <webConnectionErrorPages> sections that replicate my wc.ini settings.

Finally I need to copy WebConnectionModule.dll to the server - since the above mapping are defined in the root, do I make a bin folder under wwwroot for it?

Am I missing anythng? I gather that I don't have to explicitly register the dll - how does IIS recognize it given that there's no mapping that points directly to the file location?

--stein


Hi Kirk,

If you're running ISAPI the INI file is used for Web Connection settings. If running the managed module web.config is used for Web Connection settings.

For development with Visual Studio web.config is used to hold some environment settings - those settings are not required at runtime.

However, IIS 7 stores virtual directory configuration information in web.config. So even if you're running ISAPI, any IIS settings like script maps, permission settings (anything from the Managemnet Console) will end up in Web.config. On IIS 7 you will most likely have a web.config file, but if you're using ISAPI messaging no Web Connection settings are stored there.

This is actually a very good thing although it can seem confusing. On IIS 7 all local configuration settings can be localized in a web.config file that travels with the application and can be xcopy deployed. Especially if you use the managed module no further configuration beyond copying the web.config file to the server is required as virtuals, scriptmaps and permissions are all set in the .config file.

If you're runing on IIS 7 and you are running your application in a single virtual directory (or the root) using the managed module is highly recommended as it's more stable, slightly more efficient and tuned for IIS 7 and later.

I hope this helps,

+++ Rick ---


Hello.

I recently upgraded from 4.xx to 5.65 and I'm a little confused about which configuration files Web Connection uses and when it uses them. I'm running 5.65, Win2008/IIS7, using ISAPI script-mapping and not the managed handler.

Does WC use the wc.ini file or the web.config file, or both? And what about the myserver.ini file?

Thanks!
Kirk Allen














Viewing all articles
Browse latest Browse all 10393

Trending Articles