CSWorks: web-based industrial automation

Of CSWorks and software development

CSWorks Light - no IIS required

clock September 2, 2010 18:08 by author Sergey Sorokin

Some people who are willing to try CSWorks have no possibility or desire to install IIS (Internet Information Services). Starting today, to make their lives a bit easier, we offer a special distribution of CSWorks called "CSWorks Light" that does not require IIS. A couple of highlights:

  • this distribution uses Microsoft Cassini web server - a very simple and limited-functionality, lightweight alternative to IIS;
  • this distribution misses some samples that work with IIS-hosted CSWorks;
  • this distribution should not be used in production environment, it is for demo purposes only.

Cassini-based deployment has the following limitations:

  • it can host only one ASP.NET application per port;
  • it does not support HTTPS;
  • it does not support authentication;
  • it responds only to localhost requests.

Cassini was designed as a simple tool for debugging .NET applications and it is not officially supported by Microsoft (read full story here), so please do not expect stellar performance and production-grade reliability from CSWorks Light.

The link to CSWorks Light download will be provided in the email you will receive after submitting our
download form.



Error: LiveData Web Service is not available

clock July 22, 2010 02:41 by author Sergey Sorokin

The remote server returned an error: NotFound.

In some rare cases, after installing CSWorks and running Pipes and Tanks Demo, you can see the following error:



This means one simple thing: ASP.NET cannot run LiveData Web Service code. There can be different reasons for this. The first thing you should do in this case is to get as much additional error information as possible. Check application event log - it may give you some clues. Also, try to get LiveData Web Service definition from your browser at http://localhost/CSWorksDemo/LiveDataWebService/Service.asmx.

The browser will probably give you some more details about the error. Consider the following example.
 


The problem in this particular case is that ASP.NET cannot write temporary binary it compiles for a specific page or web service. There can be several root causes for that, for example: error in the ASP.NET installation, changing ASP.NET  worker process account without modifying temp folder privileges etc. There is a lot of information about this issue in the net, here are some good sources:

http://forums.asp.net/p/1060279/1520411.aspx
http://weblogs.asp.net/rchartier/archive/2006/01/05/434626.aspx

The idea is to give the account ASP.NET runs under, say NETWORK SERVICE, or LocalSystem, or "ASP.NET v4.0 Classic" account (depends on which account you are using, see your IIS Manager settings, Application Pools, "ASP.NET v4.0 Classic" pool properties) full access to all temporary folder it may use while compiling ASP.NET page or service. Those folders include:

c:\WINDOWS\Microsoft.NET\...\Temporary ASP.NET Files
c:\windows\temp

One would assume that ASP.NET setup (or aspnet_regiis command executed manually) should do that, but it looks like there is no 100% guarantee. Fixing folder access manually seems to be the best option. Unfortunately, there is nothing CSWorks installer can do here - it's ASP.NET setup problem.

The remote server returned an error: NotFound. (again)

Another scenario, same symptoms: LiveData Web Service is not available. The remote server returned an error: NotFound.

Navigating to http://localhost/CSWorksDemo/LiveDataWebService/Service.asmx gives the following error on a 64-bit system:

It sounds like ASP.NET worker process did not expect 64-bit code in the "bin" folder, so it cannot execute web service code. Let's open server manager and check Classic 4.0 Application pool settings:

Set "Enable 32-Bit Applications" to "False" and it solves the problem.


[HttpWebRequest_WebException_RemoteServer]

Another kind of error is common: LiveData Web Service is not available. [HttpWebRequest_WebException_RemoteServer]



This is usually caused by CSWorksDemo virtual directory ASP.NET version mismatch: CSWorks binaries require version 4.0, but the virtual directory uses another version. If you are using XP or 2003, right-click CSWorksDemo in IIS management console, select "Properties" and select ASP.NET 4.0 in the "ASP.NET" tab. If you are using 2008 or Windows 7, make sure you have selected "ASP.NET v4.0 Classic" application pool in CSWorksDemo virtual directory basic settings.

Another possible reason for this problem is: ASP.NET 4.0 web service extension (Windows 2003) or ASP.NET 4.0 ISAPI extension (2008,Vista, W7) is disabled. Please follow the instructions at
http://www.controlsystemworks.com/iis.html and enable correspondent extension manually.



Setup error: Failed while processing WebVirtualDirs. (-2147024894 )

clock March 10, 2010 04:02 by author Sergey Sorokin

Symptoms

A few customers were getting the following message when running CSWorks installation:

Failed while processing WebVirtualDirs. (-2147024894 ) (see screenshot)

Setup log file contains the following entry:

ConfigureIIsExec:  Error 0x80070002: Failed to find Web base

Why does this happen?

CSWorks installer installs demo application to IIS (Internet Information Services) website with following properties:

  • IP address: all unassigned;
  • Port: 80;
  • Header: <empty>

These are the default settings for “Default Web Site” created by IIS installer, and they usually remain unchanged unless system administrator edits them manually. CSWorks installer assumes there is a web site with those properties running on this machine, otherwise it throws the error above.

A similar issue is discussed with WiX installer developers at http://www.mail-archive.com/wix-users@lists.sourceforge.net/msg30278.html, here is an excerpt:

“Make sure the IP, Port and Header all exactly match the website on the machine. These are the 3 things we use to determine if we've found the right website or not.”

Is it possible to improve CSWorks installer so it can handle more complex scenarios? We probably can do that, but:

  • it will increase installer complexity and decrease its reliability;
  • installer will have to make some changes in demo applications’ settings on-the-fly which is a risky thing.

We may consider adding support for those complex scenarios, but this is not a top priority at the moment. We are sorry about the inconvenience caused and we appreciate your understanding in this regard.

Workaround

Before installing CSWorks, make sure that “Default Web Site” is configured to run on port 80 for all unassigned IP addresses, and host header name for this configuration is empty, as shown at this screenshot (Windows XP). When done, run CSWorks installer and make sure CSWorks demo applications work properly. All demo applications are configured to run from http://localhost/CSWorksDemo, and they won’t run if you change port or header for the web site that hosts CSWorksDemo virtual folder.



Installing IIS and ASP.NET

clock February 22, 2010 15:33 by author Sergey Sorokin

Users who are new to .NET web development keep asking asking questions about CSWorks installation errors related to IIS and ASP.NET, here are some of them:

Cannot connect to Internet Information Server. (-2147221164)

IIS (Internet Information Services) version 5 or higher must be installed

IIS (Internet Information Services) version 7 or higher and IIS 6 Management Compatibility (appcmd.exe) must be installed

Also, you may experience ASP.NET-related problems even after CSWorks installation: Pipes and Tanks Demo is not running and shows The remote server returned an error: NotFound (click to see troubleshooting guide).

All these messages signal about the same thing: IIS/ASP.NET is not working properly on this machine. Please follow the steps below to install IIS/ASP.NET on your machine

Windows 7, Windows Server 2008, Vista

I will describe the process for Windows Server 2008. Windows 7 interface is very similar, Vista interface is slightly different, but names and descriptions are pretty much the same.

In "Programs and Features", click on "Turn Windows features on or off". See screenshot.

Add Web Server Role if needed, and click on it to configure. See screenshot.

Select all Web Server role service required for ASP.NET application hosting as on the screenshot below. Please pay special attention to the "Application Development" and "Management Tools" sections. See W2K8 screenshot , or Windows 7 screenshot.

You may need to enable ASP.NET ISAPI extension manually. Find "ISAPI and CGI Restrictions" under IIS properties (see screenshot), and enable ASP.NET extensions (see screenshot).

Windows XP

Go to Settings -> Control Panel ->Add or Remove Programs -> Add/Remove Windows Components. Select "Internet Information Services", and select required components - see screenshot.

Navigate to your Microsoft .NET windows directory which is usually C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319 and run aspnet_regiis -i and aspnet_regiis -c.

Go to My Computer -> Manage -> Services and Applications -> Internet Information Services, Select "Default Web Site", right-click on it and modify ASP.NET tab of site properties so it uses ASP.NET 4.0. See screenshot.

Windows Server 2003

Go to Settings -> Control Panel ->Add or Remove Programs -> Add/Remove Windows Components. Select "Internet Information Services", and select required components - see screenshot.

Navigate to your Microsoft .NET windows directory which is usually C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319 and run aspnet_regiis -i and aspnet_regiis -c.

Go to My Computer -> Manage -> Services and Applications -> Internet Information Services, Select "Default Web Site", right-click on it and modify ASP.NET tab of site properties so it uses ASP.NET 4.0. See screenshot.

Select "Web Service Extensions" node of local IIS server and enable ASP.NET v4.0 extension.See screenshot.


Update (August 2010):

On XP or 2003, use DefaultAppPool for all CSWorks virtual directories. On Vista, 2008 and Windows 7 platforms, use "ASP.NET v4.0 Classic" for CSWorksDemo virtual directory, and "ASP.NET v4.0" for CSWorksM2MDemo virtual directory.