Interop.Excel

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

    Interop.Excel

    I have created a .dll in C# which has a reference to Excel. When I add a
    strong name to the .dll in the AssemblyInfo.cs and try to rebuild, I get the
    following error:

    Assembly generation failed -- Referenced assembly 'Interop.Excel' does not
    have a strong name

    How can this be resolved?
    --
    Robert Hill

  • Nicholas Paldino [.NET/C# MVP]

    #2
    Re: Interop.Excel

    Robert,

    What you will have to do is create the interop dll through the command
    line tool TLBIMP. It will allow you to specify a strong name which you can
    use to sign the interop assembly.

    Hope this helps.


    --
    - Nicholas Paldino [.NET/C# MVP]
    - mvp@spam.guard. caspershouse.co m

    "Robert" <rhill938@hotma il.com> wrote in message
    news:ACFB893B-4C5E-4093-AA53-B8BC811AB1F6@mi crosoft.com...[color=blue]
    >I have created a .dll in C# which has a reference to Excel. When I add a
    > strong name to the .dll in the AssemblyInfo.cs and try to rebuild, I get
    > the
    > following error:
    >
    > Assembly generation failed -- Referenced assembly 'Interop.Excel' does not
    > have a strong name
    >
    > How can this be resolved?
    > --
    > Robert Hill
    >[/color]


    Comment

    • Robert

      #3
      Re: Interop.Excel

      Thanks.
      I looked up TLBIMP and am trying to get the syntax correct. This is what I
      typed in at the command prompt:

      tlbimp C:\Dev\Excel\Ex cel\bin\Release \Interop.Excel. dll
      /keyfile:"\\nlde v\DotNet Deployment\Prod \SoftDev.snk"

      I get the following error:
      TlbImp error: The input file
      'C:\Dev\Excel\E xcel\bin\Releas e\Interop.Excel .dll' is not a valid type library

      Is it syntax?

      --
      Robert Hill



      "Nicholas Paldino [.NET/C# MVP]" wrote:
      [color=blue]
      > Robert,
      >
      > What you will have to do is create the interop dll through the command
      > line tool TLBIMP. It will allow you to specify a strong name which you can
      > use to sign the interop assembly.
      >
      > Hope this helps.
      >
      >
      > --
      > - Nicholas Paldino [.NET/C# MVP]
      > - mvp@spam.guard. caspershouse.co m
      >
      > "Robert" <rhill938@hotma il.com> wrote in message
      > news:ACFB893B-4C5E-4093-AA53-B8BC811AB1F6@mi crosoft.com...[color=green]
      > >I have created a .dll in C# which has a reference to Excel. When I add a
      > > strong name to the .dll in the AssemblyInfo.cs and try to rebuild, I get
      > > the
      > > following error:
      > >
      > > Assembly generation failed -- Referenced assembly 'Interop.Excel' does not
      > > have a strong name
      > >
      > > How can this be resolved?
      > > --
      > > Robert Hill
      > >[/color]
      >
      >
      >[/color]

      Comment

      • Nicholas Paldino [.NET/C# MVP]

        #4
        Re: Interop.Excel

        Robert,

        You don't run TLBIMP on the interop dll, you run TLBIMP on the type
        library of the COM server that you want to produce the interop library for.
        TLBIMP will produce a DLL which you then set a reference to in your program.


        --
        - Nicholas Paldino [.NET/C# MVP]
        - mvp@spam.guard. caspershouse.co m

        "Robert" <rhill938@hotma il.com> wrote in message
        news:D6DDC081-700D-46BA-A367-DA64B398E1E1@mi crosoft.com...[color=blue]
        > Thanks.
        > I looked up TLBIMP and am trying to get the syntax correct. This is what
        > I
        > typed in at the command prompt:
        >
        > tlbimp C:\Dev\Excel\Ex cel\bin\Release \Interop.Excel. dll
        > /keyfile:"\\nlde v\DotNet Deployment\Prod \SoftDev.snk"
        >
        > I get the following error:
        > TlbImp error: The input file
        > 'C:\Dev\Excel\E xcel\bin\Releas e\Interop.Excel .dll' is not a valid type
        > library
        >
        > Is it syntax?
        >
        > --
        > Robert Hill
        >
        >
        >
        > "Nicholas Paldino [.NET/C# MVP]" wrote:
        >[color=green]
        >> Robert,
        >>
        >> What you will have to do is create the interop dll through the
        >> command
        >> line tool TLBIMP. It will allow you to specify a strong name which you
        >> can
        >> use to sign the interop assembly.
        >>
        >> Hope this helps.
        >>
        >>
        >> --
        >> - Nicholas Paldino [.NET/C# MVP]
        >> - mvp@spam.guard. caspershouse.co m
        >>
        >> "Robert" <rhill938@hotma il.com> wrote in message
        >> news:ACFB893B-4C5E-4093-AA53-B8BC811AB1F6@mi crosoft.com...[color=darkred]
        >> >I have created a .dll in C# which has a reference to Excel. When I add
        >> >a
        >> > strong name to the .dll in the AssemblyInfo.cs and try to rebuild, I
        >> > get
        >> > the
        >> > following error:
        >> >
        >> > Assembly generation failed -- Referenced assembly 'Interop.Excel' does
        >> > not
        >> > have a strong name
        >> >
        >> > How can this be resolved?
        >> > --
        >> > Robert Hill
        >> >[/color]
        >>
        >>
        >>[/color][/color]


        Comment

        • Robert

          #5
          Re: Interop.Excel

          Okay. I have done some more digging and reading and have come up with the
          following:

          TlbImp "C:\Program Files\Microsoft Office\Office11 \XL5EN32.OLB"
          /keyfile:"\\nlde v\DotNet Deployment\Prod \SoftDev.snk" /out:SoftDevExce l.dll

          I get:
          TlbImp error: System.IO.IOExc eption - Access denied.

          I think I have the correct file and I am administrator on this machine.
          Any suggestions?
          Thanks!
          --
          Robert Hill



          "Nicholas Paldino [.NET/C# MVP]" wrote:
          [color=blue]
          > Robert,
          >
          > You don't run TLBIMP on the interop dll, you run TLBIMP on the type
          > library of the COM server that you want to produce the interop library for.
          > TLBIMP will produce a DLL which you then set a reference to in your program.
          >
          >
          > --
          > - Nicholas Paldino [.NET/C# MVP]
          > - mvp@spam.guard. caspershouse.co m
          >
          > "Robert" <rhill938@hotma il.com> wrote in message
          > news:D6DDC081-700D-46BA-A367-DA64B398E1E1@mi crosoft.com...[color=green]
          > > Thanks.
          > > I looked up TLBIMP and am trying to get the syntax correct. This is what
          > > I
          > > typed in at the command prompt:
          > >
          > > tlbimp C:\Dev\Excel\Ex cel\bin\Release \Interop.Excel. dll
          > > /keyfile:"\\nlde v\DotNet Deployment\Prod \SoftDev.snk"
          > >
          > > I get the following error:
          > > TlbImp error: The input file
          > > 'C:\Dev\Excel\E xcel\bin\Releas e\Interop.Excel .dll' is not a valid type
          > > library
          > >
          > > Is it syntax?
          > >
          > > --
          > > Robert Hill
          > >
          > >
          > >
          > > "Nicholas Paldino [.NET/C# MVP]" wrote:
          > >[color=darkred]
          > >> Robert,
          > >>
          > >> What you will have to do is create the interop dll through the
          > >> command
          > >> line tool TLBIMP. It will allow you to specify a strong name which you
          > >> can
          > >> use to sign the interop assembly.
          > >>
          > >> Hope this helps.
          > >>
          > >>
          > >> --
          > >> - Nicholas Paldino [.NET/C# MVP]
          > >> - mvp@spam.guard. caspershouse.co m
          > >>
          > >> "Robert" <rhill938@hotma il.com> wrote in message
          > >> news:ACFB893B-4C5E-4093-AA53-B8BC811AB1F6@mi crosoft.com...
          > >> >I have created a .dll in C# which has a reference to Excel. When I add
          > >> >a
          > >> > strong name to the .dll in the AssemblyInfo.cs and try to rebuild, I
          > >> > get
          > >> > the
          > >> > following error:
          > >> >
          > >> > Assembly generation failed -- Referenced assembly 'Interop.Excel' does
          > >> > not
          > >> > have a strong name
          > >> >
          > >> > How can this be resolved?
          > >> > --
          > >> > Robert Hill
          > >> >
          > >>
          > >>
          > >>[/color][/color]
          >
          >
          >[/color]

          Comment

          Working...