Compact Framework project - assemblies not found

Posts   
 
    
KazR
User
Posts: 8
Joined: 16-Jan-2006
# Posted on: 17-Jan-2006 15:39:12   

Hi,

I'm attempting to generate code for a Compact Framework project based on a SQLServer database that's also present on a HP iPaq running SQLServerCE 2.0.

I generate the code from the SQL database schema using the 'SelfServicing 2 class scenario (Full/Safe) vs.net 2003 CF.NET' configuration and the 'C# SQLServerCe and CF.Net (PocketPC) template set. No problems. (I realise that you recommend the adapter configuration, I'm testing the relative speeds of the 2 options on the PDA).

When I open the generated project file in VS 2003, I recieve 2 error messages:

The .Net assembly 'SD.LLBLGen.Pro.ORMSupportClasses.CF11' could not be found.

The .Net assembly 'SD.LLBLGen.Pro.DQE.SqlServerCE.CF11' could not be found.

Once past these errors, the project loads but without the above references.

I them attempt to add them - none of the SD..... .Net components are listed (which seems odd as I would have thought that components available for the target platform would appear in the list), the only way to add the references is to Browse for the DLL's (c:\Program Files\Solutions Design\LLBLGen Pro\RunTimeLibraries\DotNet11... - this path is the same as the one specified in the generated project file HintPath attribute)

I then receive a warning:

The reference 'SD.LLBLGen.Pro.DQE.SqlServerCE.CF11.dll' may or may not be valid for the active platform. Add references with care to ensure your application will run correctly.

If I generate code for a standard Windows app target, I do not get these problems. Any ideas what may be causing this issue? It in itself is fairly minor, however I am having major problems with some code that is using LLBLGen generated code on the PDA and I would like to get this minor problem sorted, just in case it is partially responsible for the runtime problems I'm having - which I will post about once this is resolved simple_smile

I'm using:

Visual Studio 2003 LLBLGen 1.0.2005.1 Final (Jan 12th, 2006) Designer/Generator CF11 DQE DLL 1.0.2005.1 CF11 ORMSupportClasses DLL 1.0.2005.1 .Net Framework 1.1 SP1 OpenNetCF SDF v1.4 SQLCE 2.0

I have just installed these onto a clean system, to ensure that I've not introduced conflicts.

Any ideas???? I've spent ages trying to get to the bottom of this! cry

Thanks!!!

Paul.Lewis
User
Posts: 147
Joined: 22-Aug-2005
# Posted on: 18-Jan-2006 05:01:17   

KazR,

Typically these errors occur when OpenCFNet 1.4 is either not installed or not referenced in the project. This requirement is mentioned in this LLBLGenPro.chm page: ** Compact Framework / Sql CE support**

Please confirm OpenCFNet 1.4 is installed and referenced.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 18-Jan-2006 10:52:19   

also, 'not valid on the active platform' indicates taht the project is not for the CF.NET framework but for regular .NET (at least that's the only time I ran into it).

Frans Bouma | Lead developer LLBLGen Pro
KazR
User
Posts: 8
Joined: 16-Jan-2006
# Posted on: 18-Jan-2006 12:03:43   

Paul.Lewis wrote:

KazR,

Typically these errors occur when OpenCFNet 1.4 is either not installed or not referenced in the project. This requirement is mentioned in this LLBLGenPro.chm page: ** Compact Framework / Sql CE support**

Please confirm OpenCFNet 1.4 is installed and referenced.

Hi,

Thanks for the response. OpenNetCF Smart Device Framework 1.4 is installed and referenced in the project. No warnings/errors are issued due to missing OpenNetCF references.

Otis - the project I'm opening is the one generated by LLBLGen - I've included the project file content below:


<?xml version="1.0" encoding="utf-8"?>

<VisualStudioProject>

  <ECSHARP ProjectType="Local" ProductVersion="7.10.3077" SchemaVersion="1.0" ProjectGuid="{3F4827A5-8128-493A-9D9C-B1878744B691}">

    <Build>

      <Settings ApplicationIcon="" AssemblyKeyContainerName="" AssemblyName="TMSSS.PDA.TEST" AssemblyOriginatorKeyFile="" DelaySign="false" OutputType="Library" OutputFileFolder="" RootNamespace="TMSSS.PDA.TEST" StartupObject="">

        <Platform Name="Pocket PC" />

        <Config Name="Debug|Pocket PC" AllowUnsafeBlocks="false" BaseAddress="0" CheckForOverflowUnderflow="false" ConfigurationOverrideFile="" DefineConstants="DEBUG;TRACE;CF" DocumentationFile="" DebugSymbols="true" FileAlignment="4096" IncrementalBuild="false" Optimize="false" OutputPath="bin\Debug\" RegisterForComInterop="false" RemoveIntegerChecks="false" TreatWarningsAsErrors="false" WarningLevel="4" />

        <Config Name="Release|Pocket PC" AllowUnsafeBlocks="false" BaseAddress="0" CheckForOverflowUnderflow="false" ConfigurationOverrideFile="" DefineConstants="TRACE;CF" DocumentationFile="" DebugSymbols="false" FileAlignment="4096" IncrementalBuild="false" Optimize="true" OutputPath="bin\Release\" RegisterForComInterop="false" RemoveIntegerChecks="false" TreatWarningsAsErrors="false" WarningLevel="4" />

      </Settings>

      <References>

        <Reference Platform="Pocket PC" Name="MSCorLib" AssemblyName="mscorlib" Private="False" />

        <Reference Platform="Pocket PC" Name="System" AssemblyName="System" Private="False" />

        <Reference Platform="Pocket PC" Name="System.XML" AssemblyName="System.Xml" Private="False" />

        <Reference Platform="Pocket PC" Name="System.Data" AssemblyName="System.Data" Private="False" />

        <Reference Platform="Pocket PC" Name="System.Data.Common" AssemblyName="System.Data.Common" />

        <Reference Platform="Pocket PC-Designer" Name="System.CF.Design" AssemblyName="System.CF.Design" Private="False" />

        <Reference Platform="Pocket PC-Designer" Name="System.CF.Design.UI" AssemblyName="System.CF.Design.UI" Private="False" />

        <Reference Platform="Pocket PC-Designer" Name="System.CF.Windows.Forms" AssemblyName="System.CF.Windows.Forms" Private="False" />

        <Reference Platform="Pocket PC-Designer" Name="System.CF.Drawing" AssemblyName="System.CF.Drawing" Private="False" />

        <Reference Platform="Pocket PC-Designer" Name="System" AssemblyName="System" Private="False" />

        <Reference Platform="Pocket PC" Name="System.Data.SqlServerCe" AssemblyName="System.Data.SqlServerCe" />

        <Reference Platform="Pocket PC" Name="OpenNETCF" AssemblyName="OpenNETCF" />

        <Reference Platform="Pocket PC" Name="SD.LLBLGen.Pro.ORMSupportClasses" AssemblyName="SD.LLBLGen.Pro.ORMSupportClasses.CF11" HintPath="C:\Program Files\Solutions Design\LLBLGen Pro\RuntimeLibraries\DotNet11\" />

        <Reference Platform="Pocket PC" Name="SD.LLBLGen.Pro.DQE.SqlServerCE" AssemblyName="SD.LLBLGen.Pro.DQE.SqlServerCE.CF11" HintPath="C:\Program Files\Solutions Design\LLBLGen Pro\RuntimeLibraries\DotNet11\" />

      </References>

    </Build>

    <Files>

      <Include>

        <File RelPath="CollectionClasses\PartDetailCollection.cs" BuildAction="Compile" />

        <File RelPath="CollectionClasses\UserNameCollection.cs" BuildAction="Compile" />

        <File RelPath="CollectionClasses\RefQuantityTypeCollection.cs" BuildAction="Compile" />

        <File RelPath="CollectionClasses\RefUnitCollection.cs" BuildAction="Compile" />

        <File RelPath="DaoClasses\PartDetailDAO.cs" BuildAction="Compile" />

        <File RelPath="DaoClasses\UserNameDAO.cs" BuildAction="Compile" />

        <File RelPath="DaoClasses\RefQuantityTypeDAO.cs" BuildAction="Compile" />

        <File RelPath="DaoClasses\RefUnitDAO.cs" BuildAction="Compile" />

        <File RelPath="DaoClasses\TypedListDAO.cs" BuildAction="Compile" />

        <File RelPath="EntityBaseClasses\PartDetailEntityBase.cs" BuildAction="Compile" />

        <File RelPath="EntityBaseClasses\UserNameEntityBase.cs" BuildAction="Compile" />

        <File RelPath="EntityBaseClasses\RefQuantityTypeEntityBase.cs" BuildAction="Compile" />

        <File RelPath="EntityBaseClasses\RefUnitEntityBase.cs" BuildAction="Compile" />

        <File RelPath="EntityClasses\PartDetailEntity.cs" BuildAction="Compile" />

        <File RelPath="EntityClasses\UserNameEntity.cs" BuildAction="Compile" />

        <File RelPath="EntityClasses\RefQuantityTypeEntity.cs" BuildAction="Compile" />

        <File RelPath="EntityClasses\RefUnitEntity.cs" BuildAction="Compile" />

        <File RelPath="FactoryClasses\DaoFactory.cs" BuildAction="Compile" />

        <File RelPath="FactoryClasses\EntityFactories.cs" BuildAction="Compile" />

        <File RelPath="FactoryClasses\EntityFieldFactory.cs" BuildAction="Compile" />

        <File RelPath="FactoryClasses\EntityFieldsFactory.cs" BuildAction="Compile" />

        <File RelPath="FactoryClasses\PredicateFactory.cs" BuildAction="Compile" />

        <File RelPath="FactoryClasses\PropertyDescriptorFactory.cs" BuildAction="Compile" />

        <File RelPath="FactoryClasses\SortClauseFactory.cs" BuildAction="Compile" />

        <File RelPath="HelperClasses\DbUtils.cs" BuildAction="Compile" />

        <File RelPath="HelperClasses\ResultsetFields.cs" BuildAction="Compile" />

        <File RelPath="HelperClasses\Transaction.cs" BuildAction="Compile" />

        <File RelPath="HelperClasses\TypeDefaultValue.cs" BuildAction="Compile" />

        <File RelPath="HelperClasses\InheritanceInfoProvider.cs" BuildAction="Compile" />

        <File RelPath="HelperClasses\FieldCreationClasses.cs" BuildAction="Compile" />

        <File RelPath="RelationClasses\PartDetailRelations.cs" BuildAction="Compile" />

        <File RelPath="RelationClasses\UserNameRelations.cs" BuildAction="Compile" />

        <File RelPath="RelationClasses\RefQuantityTypeRelations.cs" BuildAction="Compile" />

        <File RelPath="RelationClasses\RefUnitRelations.cs" BuildAction="Compile" />

        <File RelPath="ValidatorClasses\PartDetailValidator.cs" BuildAction="Compile" />

        <File RelPath="ValidatorClasses\UserNameValidator.cs" BuildAction="Compile" />

        <File RelPath="ValidatorClasses\RefQuantityTypeValidator.cs" BuildAction="Compile" />

        <File RelPath="ValidatorClasses\RefUnitValidator.cs" BuildAction="Compile" />

        <File RelPath="AssemblyInfo.cs" BuildAction="Compile" />

        <File RelPath="ConstantsEnums.cs" BuildAction="Compile" />

        <File RelPath="App.config" BuildAction="None" />

      </Include>

    </Files>

  </ECSHARP>

</VisualStudioProject>


When the missing references are added manually, the project builds successfully. However I am then having runtime problems - which may or may not be related to this issue.

Thanks!

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 19-Jan-2006 09:56:43   

very strange. Could you please check in vs.net when you click the 'System' reference in the project, if the path is to the CF.NET system assembly in the compact framework SDK path?

Frans Bouma | Lead developer LLBLGen Pro
KazR
User
Posts: 8
Joined: 16-Jan-2006
# Posted on: 19-Jan-2006 10:50:03   

The System reference points to:

c:\Program files\Microsoft Visual Studio .Net 2003\CompactFrameworkSDK\v1.0.5000\Windows CE\System.dll

Version 1.0.5000.0

We've not had any problems with LLBLGen before when using it as part of standard Windows Forms and ASP.Net applications. Odd indeed!

Thanks.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 19-Jan-2006 11:52:14   

Ok, which runtime problems do you experience? Do you upload all assemblies to the pda/emulator, including opencfnet ?

Frans Bouma | Lead developer LLBLGen Pro
KazR
User
Posts: 8
Joined: 16-Jan-2006
# Posted on: 19-Jan-2006 14:59:13   

Ok, I'm writing a test/benchmark application to determine what sort of performance hit we can expect on the PDA if we migrate our current data access code to LLBLGen. This app basically performs multiple Selects/Inserts/Updates/Deletes on a table using both SelfService and Adapter configurations (if I can get it working simple_smile ).

Now, the basic Select/Insert/Update/Delete benchmarks using LLBLGen (SelfServicing), work fine and produce timing results. The final test was to write a more complex query, similar to one we perform in one of our PDA apps, by using the LLBLGen Collections.

This involved multiple joins and filters. When executed, this generated a 'NullReferenceException' when GetMulti is called.

I removed all the joins and filters and basically ended up with:


PartDetailCollection pdc = new PartDetailCollection();

pdc.GetMulti(null);

This still generates the same exception. However, all database interactions using Entities work fine! confused

So, this code below, works fine:



DbUtils.ActualConnectionString = @"data source=\Temp\test.sdf;Password="

for(int loop = 1; loop < 500; loop++)
{
   PartDetailEntity pde = new PartDetailEntity(loop);
}

As for assemblies, the PDA has the following items installed:

OpenNetCF SDF v1.4 Microsoft SQL Client Microsoft SQLCE 2.0 Dev Microsoft SQLCE 2.0 Microsoft .Net CF 1.0 ENU

The LLBLGen Dll's are copied across into the application directory when the app is deployed/debugged.

Any ideas??? Cheers!

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 19-Jan-2006 16:06:29   

Is PartDetail in a hierarchy? (inheritance)

Frans Bouma | Lead developer LLBLGen Pro
KazR
User
Posts: 8
Joined: 16-Jan-2006
# Posted on: 19-Jan-2006 17:22:57   

No, it's a fairly simple table containing a list of parts, here's the SQL from the SQL Server database:


CREATE TABLE [dbo].[Part_Detail]
(
  [Part_Detail_Id] [int] NOT NULL,
  [NSN] [nvarchar] (30) COLLATE Latin1_General_CI_AS Not NULL,
  [Designation] [nvarchar] (200) COLLATE Latin1_General_CI_AS Not NULL,
  [Alias_Designation] [nvarchar] (255) COLLATE Latin1_General_CI_AS Not NULL,
  [Serial_Number_Required] [nchar] (1) COLLATE Latin1_General_CI_AS Not NULL,
  [Quantity_Type_Id] [int] NOT NULL,
  [To_Be_Checked] [nchar] (1) COLLATE Latin1_General_CI_AS Not NULL,
  [Picture_Count] [int] NOT NULL,
  [Marked_For_Deletion] [nchar] (1) COLLATE Latin1_General_CI_AS Not NULL

  CONSTRAINT [PK5] PRIMARY KEY NONCLUSTERED
  (
    [Part_Detail_Id]
  ) ON [PRIMARY]

) ON [PRIMARY]


Cheers!

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 19-Jan-2006 18:49:50   

My testapp does exactly that, and it works. Do you by any chance forgot to set the connection string when calling getmulti() ?

(edit) the testapp is rather old, I'll setup a new one and re-test.

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 19-Jan-2006 21:40:35   

I can't reproduce it:


AddressCollection addresses = new AddressCollection();
addresses.GetMulti(null);
_theGrid.DataSource = addresses;

Works. Be sure to set the connection string before anything else. It's a static setting, so for example in your main form's constructor, set DbUtils.ActualConnectionString to the right value.

Frans Bouma | Lead developer LLBLGen Pro
KazR
User
Posts: 8
Joined: 16-Jan-2006
# Posted on: 20-Jan-2006 09:57:57   

The ActualConnectionString is set right at the start of the benchmarking method. It goes something like this:


Set ActualConnectionString

Perform 500 entity inserts - OK

Perform 500 entity selects - OK

Perform 500 entity updates - OK

Perform 500 entity deletes - OK

Perform GetMulti

BANG!!!!!

simple_smile

The table already contains approx 600 rows before the insert/select/update/delete operations so the GetMulti should return valid information.

I will try to reproduce this behaviour with another database/app from scratch and let you know.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 20-Jan-2006 11:04:20   

Also try using adapter, it's more sufficient on the compact framework, as you can serialize entities to xml on the service, send them to the pda, deserialize them there and persist them etc.

Frans Bouma | Lead developer LLBLGen Pro
KazR
User
Posts: 8
Joined: 16-Jan-2006
# Posted on: 23-Jan-2006 15:26:53   

Ok,

I've generated a new project and a new SQLCe database with a single simple table:

NameTable

id - int (Primary Key) name - nvarchar 255

Using the SelfServicing model - I performed some simple SELECTS and INSERTS against this database on the PDA - no problem. However, once again the Collection GetMulti(null) method threw the same exception as before.

I then followed your advice and implemented the same schema using the Adapter configuration - this time the FetchEntityCollection method of the DataAccessAdapter worked!!


EntityCollection ec =new EntityCollection(new NameTableEntityFactory())
DataAccessAdapter da = new DataAccessAdapter(@"data source=\temp\testdb.sdf;Password=");
da.FetchEntityCollection(ec, null);
da.CloseConnection();

In both cases, I still have the missing references problem I initially indicated.

This is very odd - we are probably going to implement the Adapter configuration anyway, but it would be useful to see both working to compare! Would be interesting to get to the bottom of the SelfServicing problem.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 23-Jan-2006 15:53:16   

I also got the 'this isn't the right platform'-like messages btw, so I could reproduce that, but my selfservicing code worked, so I can't find what's causing the error on your setup. disappointed

I've to say I really don't know where the 'this isn't the right platform' error comes from, as the projects are proper CF.NET projects...

Frans Bouma | Lead developer LLBLGen Pro
KazR
User
Posts: 8
Joined: 16-Jan-2006
# Posted on: 23-Jan-2006 16:27:34   

Glad you could reproduce that. I'll carry on poking around when I have time to see if I can get to the bottom of the thrown exception. - I'll post if I find anything.

Thanks for your help! smile