Search Results

Search found 3 results on 1 pages for 'llea'.

Page 1/1 | 1 

  • InvalidCastException for two Objects of the same type

    - by LLEA
    hi, I have this weird problem that I cannot handle myself. A class in the model of my mvp-project designed as singleton causes an InvalidCastException. The source of error is found in this code line where the deserialised object is assigned to the instance variable of the class: engineObject = (ENGINE)xSerializer.Deserialize(str); It occurs whenever I try to add one of my UserControls to a Form or to a different UC. All of my UCs have a special presenter that access the above mentioned instance variable of the singleton class. This is what I get when trying to add a UC somewhere: 'System.TypeInitializationException: The type initializer for 'MVP.Model.EngineData' threw an exception. ---- System.InvalidCastException: [A]Engine cannot be cast to [B]Engine. Type A originates from 'MVP.Model, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' in the context 'LoadNeither' at location '[...]\AppData\Roaming\Microsoft\VisualStudio\9.0\ProjectAssemblies\uankw1hh01\MVP.Model.dll'. Type B originates from 'MVP.Model, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' in the context 'LoadNeither' at location '[...]\AppData\Roaming\Microsoft\VisualStudio\9.0\ProjectAssemblies\u_hge2de01\MVP.Model.dll'... So I somehow have two assemblies and they are not accessed from my project folder, but from a VS temp folder? I googled a lot and only found this: IronPython Exception: [A]Person cannot be cast to [B]Person. There is a solution offered, but first it concerns IronPhyton and second I don't know where to use it within my project? It would be just great, if u could help me out here :-) thx

    Read the article

  • prevent the designer from calling a getter (VS 2008, WinForms)

    - by LLEA
    hi, I have a simple UserControl containing a ComboBox which is empty at first. The setter for that CB adds items to it and the getter returns the selected item. When adding this UC to a Form, the designer automatically calls the getter for the CB which is empty. The method to fill up the CB with items is called later. I can think of one or two ways to bypass this problem by "messing around" in the code. But before I start that I'd like to ask you if there is a way to stop the designer from calling the getter method. Maybe with a attribute similar to Browsable or Bindable? thx

    Read the article

  • (nested) user controls within a mvp pattern causing sporadic problems

    - by LLEA
    hi everyone, I have a serious problem with nested user controls (UCs) in WinForms while trying to implement the mvp pattern (passive view). The project consists of one model (designed as a singleton) and a set of different presenters with corresponding view interfaces. To avoid one huge view interface and therefore an overloaded main UI, I decided to make use of a set of different UCs. Each UC has one view interface and one presenter that can access the model. But there are nested UCs: meaning that one specialised UC implements sort of a basic UC. The main UI just represents a container for all those UCs. So far, so good (if not, please ask)?! There are two problems that I am facing now (but I guess both are of the same origin): From time to time it is not possible anymore to load the UCs and test them within the Visual Studio 2008 User Control Test Container. The error message just says that a project with an output type of class library cannot be started directly etc. I can "handle" that by unloading all UC projects and reloading them afterwards. (I guess the references to all mvp components and other UCs are then updated). Assuming that the implementation of my mvp pattern is okay and all those UCs are testable within the VS Test Container at a certain time - there is the biggest problem still left: I am not able to add any UC (even the basic and unnested ones) to a simple Form (UI). The error message: error message.jpg Could it be that my basic UC causes all these Problems?! It consists of two simple ComboBoxes and implements a basic presenter and basic view interface. Whenever I add this UC to a different UC the VS designer adds two references to the public getter methods of the UC as resources. I then manually remove those resources from the resx-file and commend the corresponding lines in the designer file. thx in advance

    Read the article

1