views:

702

answers:

4

oOo a highly exciting build issue. Compact framework occasionally goes funny when building. Usually when messing with xmta files but this is the first time i've seen it go awry in this scenario.

I created a abstract base class with an abstract method. Placed this in one of my core dlls. This was fine. I then, in a "later" .dll inherited from it. Now I get this error:

Error 1150 genasm.exe(1) : error There was an error finalizing type . Method 'DoParse' in type 'MyComanyName.PlatformName.ProductName.Configuration.ConfigurationParser' from assembly 'UICore.WindowsCE.asmmeta, Version=1.0.3187.17348, Culture=neutral, PublicKeyToken=null' does not have an implementation. UICore

And yes, I have implemented this method in this class. I have also tried a full clean and rebuild and a close and restart VS.

Out of interest, I also have a warning that is "Object not set to instance of object" which is slightly unusual.

Update: If I make the method virtual as opposed to abstract the problem disappears.

Update:

  • CF 2.0 SP1
  • Visual Studio 2005 SP1
  • The method is not generic
  • However I do give an object with a generic method to the constructor of this object.
A: 

What version of the CF are you targeting? Using which IDE at what SP level? Is the method Generic?

ctacke
CF 2.0 SP1Visual Studio 2005 SP1The method is not generic
Quibblesome
+2  A: 

It's an issue with genasm in Visual Studio 2005/2008, that it must instantiate types to generate the asmmeta files, so you can't have public abstract types, unfortunately.

Check this MSDN thread with a similar issue,(with generics). There's also some workarounds discussed.

Pop Catalin
Interesting.... that thread discusses that it must be a generic method. Mine is not, however I do give an object with a generic method to the constructor. Perhaps this is why I fall into this scenario...
Quibblesome
The issue described in that thread I have also encountered and WAS fixed with SP1. This "new" issue is different and doesn't appear to be fixed with SP1.
Quibblesome
A: 

Not sure if this will be related but if you include the DesignTimeAttributes.xmta file you get a similar issue.

You'd be getting that DesignTimeAttributes if you were using a base form and inheriting for it. There's a bug in the designer that means you won't see the inherited form at all so this is generated as part of the fix..

You can solve this one by excluding the file from the project.

TreeUK
A: 

Thanks for the tip with making the methods virtual! Worked great for me.

Epaga