Web Connection
Deploy to Test Server, _Login.wcs Does Not Exist
Gravatar is a globally recognized avatar based on your email address. Deploy to Test Server, _Login.wcs Does Not Exist
  Steve
  All
  Oct 31, 2025 @ 06:04am

Hi Rick,
I have deployed my new WWWC App to a test server so I can ensure everything is working before moving it to production. I followed the Manual Deployment steps from the docs. Everything went fairly well. I can hit the website default page, and I actually see the hits in the WWWC Server window. Cool!

However, I have implemented the UserAuthentication Security, and it works perfectly in development, but I'm getting an error on the test server: Script file doesn't exist: _login.wcs

I verified the file is there in C:\AppFolder\Web\Views...
I verified the script maps are setup like the dev box.
I tried moving the _login.* files into \Web and then into \Deploy as a test, same error.
It's finding and displaying the .htm files, and it tries to run the CustomerList.cwp script. CustomerList.cwp is appearing in the server window as a hit. However, the first thing CustomerList.cwp does is verify the user is logged in, so it calls the Authenticate function. That's when I get the _login.wcs is not found error. I looked at the paths in appname.ini and they all seem ok. Any ideas?

Thanks,
Steve

Gravatar is a globally recognized avatar based on your email address. re: Deploy to Test Server, _Login.wcs Does Not Exist
  Rick Strahl
  Steve
  Oct 31, 2025 @ 01:30pm

Sounds like the Response.ExpandScript() call that from the authentication code is not referencing the right location.

FUNCTION OnShowAuthenticationForm(lcUserName, lcErrorMsg)
Response.ExpandScript("~\views\_login.wcs")

You'll want to make sure that the project root path is resolving correctly. Especially note if you're running out of a virtual folder rather than a root directory in production vs. dev.

This should happen automatically but to be sure you might want to add an explicit requests that does:

FUNCTION ApplicationPath()
Response.WriteLine( Request.GetApplicationPath() )
ENDFUNC

And you want to make sure that's pointing in the right place as that path is pre-pended to the "~\Views_login.wcs" path.

This value should come from the IIS settings (or the Web Connection Web Server settings) in every request. If you're not using IIS (Apache) you'll need to explicitly set this value in Server.oConfig.cHtmlPathPath (via the config setting in YourApp.ini).

You can also check the request log for the data directly - the IIS value should come from APPL_PHYSICAL_PATH server variable if it's automatic and it should represent the Web root folder including the virtual directory if there is one (vs. root dir).

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Deploy to Test Server, _Login.wcs Does Not Exist
  Steve
  Rick Strahl
  Nov 1, 2025 @ 06:43am

Thanks Rick. I am trying to work through your suggestions. As part of a test, I disabled the security on the CustomerList.cwp to see if the data would display without the security call. Nope. The new error is:
Script file doesn't exist: CustomerList.cwp

So, obviously I don't have something setup correctly, I assume with the Virtual Website permissions, or something. Of course, this is all part of what I'm trying to do, learn this stuff!! 😃 I think I will start the setup over and try again. Not sure what I did wrong.

BTW, is it better, at least when getting started, to place the AppFolder under C:\inetpub\wwwroot...? I eventually hope to host multiple clients on the same server. Or, is this better?
C:\AppFolderClient1\Deploy\
C:\AppFolderClient2\Deploy\

Thanks,
Steve

Gravatar is a globally recognized avatar based on your email address. re: Deploy to Test Server, _Login.wcs Does Not Exist
  Steve
  Rick Strahl
  Nov 1, 2025 @ 07:07am

Found it! I had copied over the Web folder as is, and forgot (actually missed) the step where it says to delete or not include any .prg and .fxp files from the Web folder. I removed these files and boom! Onward and upward!

Thanks,
Steve

Gravatar is a globally recognized avatar based on your email address. re: Deploy to Test Server, _Login.wcs Does Not Exist
  Rick Strahl
  Steve
  Nov 1, 2025 @ 09:04am

Yes that can be a problem although that's rare. If the .prg and .fxp are newer than the script files they will not recompile.

What's weird about this though is that it was not finding the template according to the message you posted - that's different from not rendering the template because the compiled code doesn't work right due to differences between the dev and deployed environments.

One recommendation in the update guide is to recompile all templates or else - delete all the .fxp files whenever you update your Web files of the site.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Deploy to Test Server, _Login.wcs Does Not Exist
  Steve
  Rick Strahl
  Nov 1, 2025 @ 12:02pm

Hmmm. Well, after deleting the .prg and .fxp files from the \Web folder, things started working. Here's the step I missed in the instructions:
Exclude for PRG/FXP Script Files
If you're using Web Connection Scripting Pages (via Response.ExpandScript()) make sure you don't publish your PRG or FXP files in your Web folder. When script files compile they embed hardcoded paths into the PRG and if paths change the code will break. Either let the files auto-compile or if you're running pre-compiled scripts use the admin page Compile scripts option to compile your scripts.

I know the above is from the Visual Studio publishing instructions, which I'm not using currently, but it made me realize that I had copied the .prg and .fxp files in the \Web folder to the deployment server. I did verify and .prg files in the \Web folder on the deployment server were old and contained the paths from my Dev box. Doesn't the incorrect path in the .prg files explain the script file does not exist errors?

Anyway, once I got the first instance of the app working, I copied everything into C:\AppFolder2..., changed the settings in AppName.ini to the new folder, and then ran AppName.exe Config utility. Everything worked on the first try! I'm feeling a little more comfortable now with the deployment process. It feels great to get this going!

Thanks for all your help!

Gravatar is a globally recognized avatar based on your email address. re: Deploy to Test Server, _Login.wcs Does Not Exist
  Rick Strahl
  Steve
  Nov 3, 2025 @ 10:25am

There are two things that can cause this:

  • Empty or incomplete compiled files (ie. some sort of failure on the server)
  • Copied files with dev environment specific settings that don't work on the server

I suspect the latter. Initially I thought perhaps the paths are resolved at compile time and hard coded after that, but that's not the case.

It might be useful to take a look at _layoutpage.prg and _login.wcs and check for any hardcoded paths or any relative paths that don't properly use ~/ and use / which might behave differently locally vs remotely (ie. a virtual sub path, vs. root Web site).

+++ Rick ---

© 1996-2025