Designer error "could not find type..."

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Daniel Billingsley

    #1

    Designer error "could not find type..."

    I've got a project I've been working on for a few weeks. I've been using
    the BindingSource control - I've got four of them on this particular form.

    This morning I went to view the report in the designer and got:

    Could not find type 'LandarcBL.Budg et'. Please make sure that the
    assembly that contains this type is referenced. If this type is a part of
    your development project, make sure that the project has been successfully
    built.
    Hide Edit

    at
    System.Componen tModel.Design.S erialization.Co deDomSerializer Base.Error(IDes ignerSerializat ionManager
    manager, String exceptionText, String helpLink)
    at
    System.Componen tModel.Design.S erialization.Co deDomSerializer Base.Deserializ eExpression(IDe signerSerializa tionManager
    manager, String name, CodeExpression expression)
    at
    System.Componen tModel.Design.S erialization.Co deDomSerializer Base.Deserializ eAssignStatemen t(IDesignerSeri alizationManage r
    manager, CodeAssignState ment statement)
    at
    System.Componen tModel.Design.S erialization.Co deDomSerializer Base.Deserializ eStatement(IDes ignerSerializat ionManager
    manager, CodeStatement statement)


    When I click Edit it takes me to the MainForm.Design er.CS line:
    this.budgetBind ingSource.DataS ource = typeof(LandarcB L.Budget);

    When I hover the mouse over LandarcBL.Budge t is shows me the intellisense.
    It's finding it just fine of course.

    I can hit F5 and run the form just fine. I added another form, added a
    BindingSource, set its DataSource to the same class and that form loads in
    the designer just fine.

    This morning I did a bunch of stuff - ran the form, closed VS, and I don't
    know what else, and it started working again. Now none of that is having
    any affect.

    I've found many reports of this problem with google but no real solution to
    my exact circumstances.

    Anyone have any ideas?


  • Joanna Carter [TeamB]

    #2
    Re: Designer error "could not find type..."

    "Daniel Billingsley" <DanielBillings ley@newsgroup.n ospam> a écrit dans le
    message de news: ePJH2FwEGHA.532 @TK2MSFTNGP15.p hx.gbl...

    | I've got a project I've been working on for a few weeks. I've been using
    | the BindingSource control - I've got four of them on this particular form.
    |
    | This morning I went to view the report in the designer and got:
    |
    | Could not find type 'LandarcBL.Budg et'. Please make sure that the
    | assembly that contains this type is referenced. If this type is a part of
    | your development project, make sure that the project has been successfully
    | built.
    | Hide Edit

    I would like to know the answer to this as well.

    Using VS2005

    I have declared a type : Carter.Framewor k.Test.Customer List. I set the
    DataSource property of a CustomerListBin dingSource to this value. Like you,
    I just come back to the form a day or so later and get this error. Changing
    the DataSource to just CustomerList seems to make it work - sometimes :-(

    There seems to be no consistency to what causes this, but I would definitely
    like to fix it.

    Joanna

    --
    Joanna Carter [TeamB]
    Consultant Software Engineer


    Comment

    • [MSFT]

      #3
      RE: Designer error &quot;could not find type...&quot;

      Hello Daniel,

      What is the version of the VS.NET you work with, 2003 or 2005? Normally,
      such a problem can be resolved by rebuilding the whole solution.

      Luke

      Comment

      • Daniel Billingsley

        #4
        Re: Designer error &quot;could not find type...&quot;

        It's VS2005 (C#). I've closed and re-opened VS several times, selected
        Build/Clean Build/Rebuild Solution from the menu several times... all to no
        avail.

        "[MSFT]" <lukezhan@onlin e.microsoft.com > wrote in message
        news:pvIujlPFGH A.3944@TK2MSFTN GXA02.phx.gbl.. .[color=blue]
        > Hello Daniel,
        >
        > What is the version of the VS.NET you work with, 2003 or 2005? Normally,
        > such a problem can be resolved by rebuilding the whole solution.
        >
        > Luke
        >[/color]


        Comment

        • Daniel Billingsley

          #5
          Re: Designer error &quot;could not find type...&quot;

          A have stumbled across a solution - for my case anyway.

          I remove all the ".DataSourc e = " lines on the BindingSources in the
          MainForm.Design er.cs code. That allowed the form to load.

          Then when I went to reset the DataSource for the BindingSources in the
          designer I kept getting an error "...not sent to an insance". I googled
          that and found a suggestion that the project DataSources were messed up.

          Sure enough, I removed a couple of DataSources that weren't really used and
          everything is back to normal.

          "Daniel Billingsley" <DanielBillings ley@newsgroup.n ospam> wrote in message
          news:%23%23wIUY TFGHA.1032@TK2M SFTNGP15.phx.gb l...[color=blue]
          > It's VS2005 (C#). I've closed and re-opened VS several times, selected
          > Build/Clean Build/Rebuild Solution from the menu several times... all to
          > no avail.
          >
          > "[MSFT]" <lukezhan@onlin e.microsoft.com > wrote in message
          > news:pvIujlPFGH A.3944@TK2MSFTN GXA02.phx.gbl.. .[color=green]
          >> Hello Daniel,
          >>
          >> What is the version of the VS.NET you work with, 2003 or 2005? Normally,
          >> such a problem can be resolved by rebuilding the whole solution.
          >>
          >> Luke
          >>[/color]
          >
          >[/color]


          Comment

          • Luke Zhang [MSFT]

            #6
            Re: Designer error &quot;could not find type...&quot;

            Hello,

            Glad to hear that the problem has been removed. From the description, it
            seems the source code of the project has been corrupted somewhere. And
            re-creating some components fixed the issue.

            Luke

            Comment

            • Joanna Carter [TeamB]

              #7
              Re: Designer error &quot;could not find type...&quot;

              "Luke Zhang [MSFT]" <lukezhan@onlin e.microsoft.com > a écrit dans le message
              de news: D1cypdbFGHA.124 0@TK2MSFTNGXA02 .phx.gbl...

              | Glad to hear that the problem has been removed. From the description, it
              | seems the source code of the project has been corrupted somewhere. And
              | re-creating some components fixed the issue.

              Hi Luke

              Actually, all that this procedure of removing, correcting and replacing the
              references only removes the problem for that session. Next time, or maybe a
              couple of times later, the problem comes back just the same.

              Unfortunately, this does not yet appear to be reliably reproducible.

              Joanna

              --
              Joanna Carter [TeamB]
              Consultant Software Engineer


              Comment

              • Marc Gravell

                #8
                Re: Designer error &quot;could not find type...&quot;

                I had this problem (or one very similar) back in December; my workaround
                (not fix) was to cut the data-binding code from the designer code into my
                own method that is called in the ctor outside of InitializeCompo nent().

                The downside is that I can't amend my bindings in the IDE, but generally
                once I have set them up I'm doing much of this anyway... and when I do need
                to change them I can do it in source-code easily enough. Plus it gives me
                more flexibility to use converters etc.

                Marc

                "Joanna Carter [TeamB]" <joanna@not.for .spam> wrote in message
                news:%23cwI$VdF GHA.1032@TK2MSF TNGP15.phx.gbl. ..[color=blue]
                > "Luke Zhang [MSFT]" <lukezhan@onlin e.microsoft.com > a écrit dans le
                > message
                > de news: D1cypdbFGHA.124 0@TK2MSFTNGXA02 .phx.gbl...
                >
                > | Glad to hear that the problem has been removed. From the description, it
                > | seems the source code of the project has been corrupted somewhere. And
                > | re-creating some components fixed the issue.
                >
                > Hi Luke
                >
                > Actually, all that this procedure of removing, correcting and replacing
                > the
                > references only removes the problem for that session. Next time, or maybe
                > a
                > couple of times later, the problem comes back just the same.
                >
                > Unfortunately, this does not yet appear to be reliably reproducible.
                >
                > Joanna
                >
                > --
                > Joanna Carter [TeamB]
                > Consultant Software Engineer
                >
                >[/color]


                Comment

                • Joanna Carter [TeamB]

                  #9
                  Re: Designer error &quot;could not find type...&quot;

                  "Marc Gravell" <mgravell@rm.co m> a écrit dans le message de news:
                  uID6e0dFGHA.221 2@TK2MSFTNGP15. phx.gbl...

                  |I had this problem (or one very similar) back in December; my workaround
                  | (not fix) was to cut the data-binding code from the designer code into my
                  | own method that is called in the ctor outside of InitializeCompo nent().
                  |
                  | The downside is that I can't amend my bindings in the IDE, but generally
                  | once I have set them up I'm doing much of this anyway... and when I do
                  need
                  | to change them I can do it in source-code easily enough. Plus it gives me
                  | more flexibility to use converters etc.

                  I suppose the only real downside to this is not being able to layout the
                  columns in a grid by using the designer provided columns. Presumably this
                  works with database driven datasources ? If so, then it really ought to work
                  with objects as well; if not, then it is obviously a pretty major bug that
                  really should be fixed.

                  Joanna

                  --
                  Joanna Carter [TeamB]
                  Consultant Software Engineer


                  Comment

                  • Marc Gravell

                    #10
                    Re: Designer error &quot;could not find type...&quot;

                    Not to mention the bug where the IDE gets confused and thinks there are
                    multiple "column1" (etc) definitions and then refuses to load...

                    I've only really used this approach with objects. Generally I find that if I
                    lay the bindings out *once* in the IDE (and then cut the bindings code etc),
                    I actually find it *easier*, not harder, to use. I can live without seeing
                    the bindings at design time (re your grid point, most of the time when I am
                    using columns, the exact columns and sequence is dynamic anyway, so the
                    designer isn't much use), and I find that not having all those extra
                    variables around makes life much easier.

                    And yes I know you can turn off the variable declaration in 2005 (for some
                    elements), but they still annoy me. Another benefit of the approach of
                    cutting the binding code is that I can essentially write a void
                    SetupBindings(B indingSource source) method, and bind via that from the
                    calling code; this means I can then share a BindingSource at runtime, which
                    allows me to do some very neat things:
                    * Multiple non-modal forms all using the same cursor position without any
                    extra code
                    * Complex forms where each tab has been written as a control; each control
                    can (again) use the same BindingSource

                    It means I have a lot less code to mess with when I change the current
                    object being displayed.

                    Now... back to reading your OPF stuff... <g>

                    Marc

                    "Joanna Carter [TeamB]" <joanna@not.for .spam> wrote in message
                    news:erR8klgFGH A.752@TK2MSFTNG P12.phx.gbl...[color=blue]
                    > "Marc Gravell" <mgravell@rm.co m> a écrit dans le message de news:
                    > uID6e0dFGHA.221 2@TK2MSFTNGP15. phx.gbl...
                    >
                    > |I had this problem (or one very similar) back in December; my workaround
                    > | (not fix) was to cut the data-binding code from the designer code into
                    > my
                    > | own method that is called in the ctor outside of InitializeCompo nent().
                    > |
                    > | The downside is that I can't amend my bindings in the IDE, but generally
                    > | once I have set them up I'm doing much of this anyway... and when I do
                    > need
                    > | to change them I can do it in source-code easily enough. Plus it gives
                    > me
                    > | more flexibility to use converters etc.
                    >
                    > I suppose the only real downside to this is not being able to layout the
                    > columns in a grid by using the designer provided columns. Presumably this
                    > works with database driven datasources ? If so, then it really ought to
                    > work
                    > with objects as well; if not, then it is obviously a pretty major bug that
                    > really should be fixed.
                    >
                    > Joanna
                    >
                    > --
                    > Joanna Carter [TeamB]
                    > Consultant Software Engineer
                    >
                    >[/color]


                    Comment

                    • Daniel Billingsley

                      #11
                      Re: Designer error &quot;could not find type...&quot;

                      Yeah, my fix was temporary. And I've seen that one too where the
                      DataGridView goes off wild reloading all the columns even though I've
                      explicity set them already.

                      The BindingSource bindings are getting hosed about once or twice a day, and
                      I have to go through the procedure of removing the binding code and then
                      resetting it. I'm not going to use the IDE any more for that either (at
                      least as a permanent setup).

                      It's pretty pathetic though because that destroys a big chuch of the benefit
                      of using the BindingSource components in the first place. You have to
                      wonder how such significant bugs get through.

                      "Marc Gravell" <mgravell@rm.co m> wrote in message
                      news:epf7%23IjF GHA.1088@tk2msf tngp13.phx.gbl. ..[color=blue]
                      > Not to mention the bug where the IDE gets confused and thinks there are
                      > multiple "column1" (etc) definitions and then refuses to load...
                      >
                      > I've only really used this approach with objects. Generally I find that if
                      > I lay the bindings out *once* in the IDE (and then cut the bindings code
                      > etc), I actually find it *easier*, not harder, to use. I can live without
                      > seeing the bindings at design time (re your grid point, most of the time
                      > when I am using columns, the exact columns and sequence is dynamic anyway,
                      > so the designer isn't much use), and I find that not having all those
                      > extra variables around makes life much easier.
                      >
                      > And yes I know you can turn off the variable declaration in 2005 (for some
                      > elements), but they still annoy me. Another benefit of the approach of
                      > cutting the binding code is that I can essentially write a void
                      > SetupBindings(B indingSource source) method, and bind via that from the
                      > calling code; this means I can then share a BindingSource at runtime,
                      > which allows me to do some very neat things:
                      > * Multiple non-modal forms all using the same cursor position without any
                      > extra code
                      > * Complex forms where each tab has been written as a control; each control
                      > can (again) use the same BindingSource
                      >
                      > It means I have a lot less code to mess with when I change the current
                      > object being displayed.
                      >
                      > Now... back to reading your OPF stuff... <g>
                      >
                      > Marc
                      >
                      > "Joanna Carter [TeamB]" <joanna@not.for .spam> wrote in message
                      > news:erR8klgFGH A.752@TK2MSFTNG P12.phx.gbl...[color=green]
                      >> "Marc Gravell" <mgravell@rm.co m> a écrit dans le message de news:
                      >> uID6e0dFGHA.221 2@TK2MSFTNGP15. phx.gbl...
                      >>
                      >> |I had this problem (or one very similar) back in December; my workaround
                      >> | (not fix) was to cut the data-binding code from the designer code into
                      >> my
                      >> | own method that is called in the ctor outside of InitializeCompo nent().
                      >> |
                      >> | The downside is that I can't amend my bindings in the IDE, but
                      >> generally
                      >> | once I have set them up I'm doing much of this anyway... and when I do
                      >> need
                      >> | to change them I can do it in source-code easily enough. Plus it gives
                      >> me
                      >> | more flexibility to use converters etc.
                      >>
                      >> I suppose the only real downside to this is not being able to layout the
                      >> columns in a grid by using the designer provided columns. Presumably this
                      >> works with database driven datasources ? If so, then it really ought to
                      >> work
                      >> with objects as well; if not, then it is obviously a pretty major bug
                      >> that
                      >> really should be fixed.
                      >>
                      >> Joanna
                      >>
                      >> --
                      >> Joanna Carter [TeamB]
                      >> Consultant Software Engineer
                      >>
                      >>[/color]
                      >
                      >[/color]


                      Comment

                      • Joanna Carter [TeamB]

                        #12
                        Re: Designer error &quot;could not find type...&quot;

                        "Marc Gravell" <mgravell@rm.co m> a écrit dans le message de news:
                        epf7%23IjFGHA.1 088@tk2msftngp1 3.phx.gbl...

                        | Now... back to reading your OPF stuff... <g>

                        Please bear in mind that it is a bit old now and I really must update it to
                        C# sometime :-)

                        Joanna

                        --
                        Joanna Carter [TeamB]
                        Consultant Software Engineer


                        Comment

                        Working...