Class Libraries Output to Same Directory

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Brian Reed

    #1

    Class Libraries Output to Same Directory

    I have three projects in the same solution that are all class library
    projects. The projects are COM interop objects that will be used within my
    COM framework. It is important to me to have all three projects building to
    the bin directory of my COM framework so that I don't have to use the
    /codebase option when registering the objects.

    Here is my problem, all three projects reference the same COM typelib, which
    will generate an interop.TYPELIB .dll file. Only one of the projects will
    successfully build to the target directory and any code in the other two
    projects that references the COM typelib fails to build as if the reference
    wasn't even there.

    Since one project works successfully, this appears to be a Visual Studio
    ..NET problem. It looks to me like the first project opens the
    interop.TYPELIB with no sharing allowed, so the other projects can't
    reference it.

    Is there any solution to this problem? Can I make VS not hold open (not
    sharing) the referenced interop dll?

    Thanks


  • Val Savvateev

    #2
    Re: Class Libraries Output to Same Directory

    Try setting "Copy Local" to False for the interop.TYPELIB .

    "Brian Reed" <breed2@northro pgrumman.com> wrote in message
    news:uIkfRSWVDH A.2272@TK2MSFTN GP11.phx.gbl...[color=blue]
    > I have three projects in the same solution that are all class library
    > projects. The projects are COM interop objects that will be used within[/color]
    my[color=blue]
    > COM framework. It is important to me to have all three projects building[/color]
    to[color=blue]
    > the bin directory of my COM framework so that I don't have to use the
    > /codebase option when registering the objects.
    >
    > Here is my problem, all three projects reference the same COM typelib,[/color]
    which[color=blue]
    > will generate an interop.TYPELIB .dll file. Only one of the projects will
    > successfully build to the target directory and any code in the other two
    > projects that references the COM typelib fails to build as if the[/color]
    reference[color=blue]
    > wasn't even there.
    >
    > Since one project works successfully, this appears to be a Visual Studio
    > .NET problem. It looks to me like the first project opens the
    > interop.TYPELIB with no sharing allowed, so the other projects can't
    > reference it.
    >
    > Is there any solution to this problem? Can I make VS not hold open (not
    > sharing) the referenced interop dll?
    >
    > Thanks
    >
    >[/color]


    Comment

    • Brian Reed

      #3
      Re: Class Libraries Output to Same Directory

      Thanks. That did hte trick. I just let one unique reference be copied to
      the local area. It seems like a strange error that can be misleading. It
      took me awhile to figure out that the proplem was with sharing the same
      file.


      "Val Savvateev" <1@2.com> wrote in message
      news:eaYn3ZeVDH A.3232@tk2msftn gp13.phx.gbl...[color=blue]
      > Try setting "Copy Local" to False for the interop.TYPELIB .
      >
      > "Brian Reed" <breed2@northro pgrumman.com> wrote in message
      > news:uIkfRSWVDH A.2272@TK2MSFTN GP11.phx.gbl...[color=green]
      > > I have three projects in the same solution that are all class library
      > > projects. The projects are COM interop objects that will be used within[/color]
      > my[color=green]
      > > COM framework. It is important to me to have all three projects[/color][/color]
      building[color=blue]
      > to[color=green]
      > > the bin directory of my COM framework so that I don't have to use the
      > > /codebase option when registering the objects.
      > >
      > > Here is my problem, all three projects reference the same COM typelib,[/color]
      > which[color=green]
      > > will generate an interop.TYPELIB .dll file. Only one of the projects[/color][/color]
      will[color=blue][color=green]
      > > successfully build to the target directory and any code in the other two
      > > projects that references the COM typelib fails to build as if the[/color]
      > reference[color=green]
      > > wasn't even there.
      > >
      > > Since one project works successfully, this appears to be a Visual Studio
      > > .NET problem. It looks to me like the first project opens the
      > > interop.TYPELIB with no sharing allowed, so the other projects can't
      > > reference it.
      > >
      > > Is there any solution to this problem? Can I make VS not hold open[/color][/color]
      (not[color=blue][color=green]
      > > sharing) the referenced interop dll?
      > >
      > > Thanks
      > >
      > >[/color]
      >
      >[/color]


      Comment

      Working...