Inherited forms in CF2 VS2005 can't compile

J

J.Edwards

Hi,

I am using form inheritance in VS2005 professional and all was going well -
I used the "DesktopCompatible(true)" workaround to get the designer behaving
correctly.

However, when I added a reference to System.Data.SqlServerCe it now causes
this error on build:

Error 1 genasm.exe(1) : error There was an error initializing
MyProject.MySqlCeDatabase. Type 'System.Data.SqlServerCe.SqlCeConnection,
System.Data.SqlServerCe, Version=3.0.3600.0, Culture=neutral,
PublicKeyToken=3be235df1c8d2ad3, Retargetable=Yes' was loaded in the
ReflectionOnly context but the AssemblyBuilder was not created as
AssemblyBuilderAccess.ReflectionOnly. ClassLibrary1

"MySqlCeDatabase" is just a wrapper I've built around the sql server ce
stuff to make it easier to work with.

It's a fairly large class library and I thought it must be some of the code
in it somewhere, so to try and reproduce the problem I've created a new
class library from scratch and added all of the same files and references -
it compiled perfectly with all files until I added the
"DesktopCompatible(true)" workaround (i.e. through the class designer). Once
that was done the error happened and I can't seem to "undo" that change -
I've removed the attribute and saved, and deleted the class diagram file
completely and the error happens still - modifying the class diagram must
change some code somewhere, but I can't find it.

NOTE: it's not the "DesktopCompatible(true)" workaround by itself causing
the problem - it's the combination of it and System.Data.SqlServerCe
reference.

Anyhow, does anyone know what I can do to get around this - I would really
like to have designer support for inherited forms working happily with an
sql server db :) otherwise what's the point of vs2005? actually there are
other points, but that is not the point! :)
 
J

J.Edwards

A bit more info ...

It's not the reference that kills it - it's if I have anywhere declared a
variable of type SqlCeConnection.

Also, I'm using VB.NET, VS 2005 professional on XP prof SP2, building class
library for Pocket PC 2003 to test in the 2003SE emulator.
 
J

J.Edwards

Now this is really odd ...

It successfully builds if I declare as a private,protected,public FIELD, but
won't compile if I try to use the type SqlCeConnection as a PROPERTY.

The "private" line below will compile fine, but if I include the property
(doesn't matter if readonly or full property) it will give the error and not
build.

Public Class SqlCeDatabase
Private moConn As SqlCeConnection

ReadOnly Property Conn() As SqlCeConnection
Get
Return moConn
End Get
End Property
End Class
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top