G
Guest
I've tried to debug this every way I can think of, but I can't figure out
this strange compile problem I am having. Any help is greatly appreciated.
I have a generic collection class that inherits from
System.Collections.ObjectModel.Collection(Of T) called
MatrixGenericCollectionBase (Matrix is the name of our project). Despite
it's name it is actually an instantiable class that is used widely in our
application to hold objects of many types. There is some additional
functionality in the class but for the most part it is just a normal
implementation of a generic collection, not a ton of additional code.
In one instance I need a type specific collection because I need to add a
function at the collection level that is specific for that type. In this
case I have created a new class that inherits from
MatrixGenericCollectionBase(Of TypeX) and named the new collection class
TypeXCollection. The only code this class contains is the new function,
which basically just loops through the collection and looks for specific
members based on some parameters passed in.
This compiles and runs fine when I compile through Visual Studio on my local
machine. It also compiles fine when I run my nAnt build scripts on my local
machine. It compiles fine when compiled in the VS IDE on the build server.
BUT, it fails when the nAnt build script is run on the build server. The
compile error I receive is "error BC30311: Value of type 'T' cannot be
converted to 'Matrix.TypeX'". This error is received on a line of code that
is iterating through the collection in a for each statement.
I have mapped a drive to the code on the build server and run the nAnt
scripts locally against the build server code and it compiles fine. I have
copied the command line call to vbc that is shown in the output window of
Visual Studio when I compile in release mode and run it from a command line
and it fails with the same error. That's right, the same thing that is
succeeding for Visual Studio on the same box is failing for me. I've now
even gone as far as uninstalling and reinstalling the .Net 2.0 framework.
I'm frustrated and ready to go back to the old non-generic base collection
just to be able to compile on my build server. If you have any ideas, please
help.
this strange compile problem I am having. Any help is greatly appreciated.
I have a generic collection class that inherits from
System.Collections.ObjectModel.Collection(Of T) called
MatrixGenericCollectionBase (Matrix is the name of our project). Despite
it's name it is actually an instantiable class that is used widely in our
application to hold objects of many types. There is some additional
functionality in the class but for the most part it is just a normal
implementation of a generic collection, not a ton of additional code.
In one instance I need a type specific collection because I need to add a
function at the collection level that is specific for that type. In this
case I have created a new class that inherits from
MatrixGenericCollectionBase(Of TypeX) and named the new collection class
TypeXCollection. The only code this class contains is the new function,
which basically just loops through the collection and looks for specific
members based on some parameters passed in.
This compiles and runs fine when I compile through Visual Studio on my local
machine. It also compiles fine when I run my nAnt build scripts on my local
machine. It compiles fine when compiled in the VS IDE on the build server.
BUT, it fails when the nAnt build script is run on the build server. The
compile error I receive is "error BC30311: Value of type 'T' cannot be
converted to 'Matrix.TypeX'". This error is received on a line of code that
is iterating through the collection in a for each statement.
I have mapped a drive to the code on the build server and run the nAnt
scripts locally against the build server code and it compiles fine. I have
copied the command line call to vbc that is shown in the output window of
Visual Studio when I compile in release mode and run it from a command line
and it fails with the same error. That's right, the same thing that is
succeeding for Visual Studio on the same box is failing for me. I've now
even gone as far as uninstalling and reinstalling the .Net 2.0 framework.
I'm frustrated and ready to go back to the old non-generic base collection
just to be able to compile on my build server. If you have any ideas, please
help.