views:

136

answers:

1

Using Visual Studio 2008 and VB.Net:

I have a working web app that uses an ASMX web service which is compiled into its separate assembly. I have another class library project compiled as a separate assembly that serves as a proxy to this web service. This all seems to work at runtime but I am getting this warning at compile time which I don't understand and would like to fix:

Type of member 'wsZipeee' is not CLS-compliant

I have dozens of webforms in the main project that reference the proxy class with no compile time complaints as this snippet shows:

Imports System.Data
Partial Class frmZipeee
    Inherits System.Web.UI.Page

    Public wsZipeee As New ProxyZipeeeService.WSZipeee.Zipeee
    Dim dsStandardMsg As DataSet

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) 
          Handles MyBase.Load

And yet I have one webform (also in the root of the main project) which gives me the "not CLS-compliant" message but yet attempts to reference the proxy class just like the other ASPX files. I get the compile time warning on the line annoted by me with 'ERROR here..

Imports System.Data
Partial Class frmHome
    Inherits System.Web.UI.Page

    Public wsZipeee As New ProxyZipeeeService.WSZipeee.Zipeee   ERROR here 
    Dim dsStandardMsg As DataSet

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) 
         Handles MyBase.Load

This makes no sense to me. The file with the warning is called frmHome.aspx.vb; all others in the project declare things the same way and have no warning. BTW, the webservice itself returns standard datatypes: integer, string, and dataset.

A: 

I traced this problem to the <%@ Page declarative of the "problem" file using Codebehind while the other file(s) used the CodeFile attribute. When I changed it, it triggered some new issues but I solved them and in turn the original complaint about nonCLScompliance went away.

John Galt