Silverlight - problem compiling

Silverlight - problem compiling

Old forum URL:

griff posted on Wednesday, September 15, 2010


I have used Blake's PetShop silverlight example as a template.

I have my two projects MyApp.Business and MyApp.Business.Silverlight. 

MyApp.Business.Silverlight has csla  (silverlight) correctly referenced and BOs linked etc. but I get compile errors e.g.

Error 5 'Fetch' is not a member of 'Csla.DataPortal'.

I have noticed looking at Blake's example that the code below #If Not SILVERLIGHT is greyed out in the MyApp.Business.Silverlight and mine isn't - hence the compile errors I think - could this be my problem and can someone please advise on how to correct.

Code Snippet


Option Explicit On

Option Strict On


Imports System

Imports System.Data

Imports System.Data.SqlClient

Imports Csla

Imports Csla.Data

Namespace PetShop.Business

    Partial Public Class AccountInfoList

        Private Shadows Sub DataPortal_Fetch(ByVal criteria As AccountCriteria)

            IsReadOnly = False

            Dim cancel As Boolean = False

            OnFetching(criteria, cancel)

            If (cancel) Then


            End If


JonnyBee replied on Thursday, September 16, 2010

Check if you have declared a compiler variable named SILVERLIGHT in your SL project?

The line
is a compiler command as to whether the code should be included or excluded at compiletime.



griff replied on Thursday, September 16, 2010


how do I do this?



griff replied on Thursday, September 16, 2010


now sorted, thanks

Copyright (c) Marimer LLC