Re: Running a VB.NET Application on a Network Drive

From: Shawn Farkas [MS] (shawnfa_at_online.microsoft.com)
Date: 06/25/03


Date: Tue, 24 Jun 2003 15:22:25 -0700


Hi Ray,

    So the files in your project's bin directory are interop libraries that
Visual Studio already "tlbimp-ed" for you. The page I pointed you at refers
to the Microsoft Office Primary Interop Assemblies, which you need to
download and install, (there should be another link on that page)....This
will provide you with the Microsoft.Office.Interop.Excel.dll. What types
are you referencing in the comdll library? I've not ever heard of it
before, so I'm not sure where to find it.

-Shawn

-- 
--------------------------------------------------
This posting is provided "AS IS" with no warranties, and confers no rights
"Ray" <rhartl@tscfinancials.com.au> wrote in message 
news:039001c3393e$bc50bfb0$a601280a@phx.gbl...
>I tried to run tlbimp without success
> Selected the Visual Studio Command Prompt for the Start
> menu.
> In the folder where my project (*.sln file) is in I type:
> tlbimp /keyfile:powerwriterexec.snk comdll.dll
> It comes up with the error
> TlbImp error: Unable to locate input type
> library: 'W:\RHartl\Version6.0
> \PowerWriterExec.NET\comdll.dll'
> I search for this file on my network drive, and on my C
> drive and do not find it. Presumably you mean one of the
> C:\Windows\System32 DLLs.
> I would then be presumably be running this in this folder
> (C:\Windows\System32 DLLs).
> There is not comdll.dll (or anything similar)
> Similarly which Excel DLL do you mean the ones in the bin
> folder under my project folder. This folder contains
> Interop.Excel.dll
> Interop.Microsoft.Office.Core.dll
> Interop.Scripting.dll
> Interop.VBIDE.dll
> If I try the command
> tlbimp /keyfile:..\powerwriterexec.snk interop.excel.dll
> I get the error:
> TlbImp error: The input file 'W:\RHartl\Version6.0
> \PowerWriterExec.NET\bin\inter
> op.excel.dll' is not a valid type library
> The page you refered me to talked about a
> microsoft.office.interop.excel.dll which I cannot find
> either.
>
> I know I am missing the obvious, can you guide me in the
> correct direction.
>
> Thanks in advance
> Ray
>
>>-----Original Message-----
>>My mistake, this option is only available on C#
> projects.  If you are using
>>VB, you have to use tlbimp to manually create the
> interop library, then
>>reference this generated .dll in your VB project,
> instead of referencing the
>>COM component directly.  To use tlbimp, from a command
> prompt (with the SDK
>>tools on the path), run tlbimp /keyfile <snkkey>
> COMDll.dll.  This will
>>generate the interop library you need.  If you have a
> type library to work
>>with, then you can run tlbimp directly on that type
> library.  Since you are
>>using Excel, you should also check out the Microsoft
> Office Primary Interop
>>Assemblies as I believe these come pre-signed.
>>(http://msdn.microsoft.com/library/default.asp?
> url=/library/en-
> us/dv_wrcore/html/wrrefofficeprimaryinteropassemblies.asp)
>>
>>As for your MSI question, to create the policy MSI, goto
> the .Net
>>Adminsitration console (mscorcfg.mmc), and right click
> on your machine
>>security policy level.  One of the options will be to
> create an MSI package.
>>
>>-Shawn
>>
>>-- 
>>
>>--------------------------------------------------
>>This posting is provided "AS IS" with no warranties, and
> confers no rights
>>"Ray" <rhartl@tscfinancials.com.au> wrote in message
>>news:068201c336c9$10627440$a301280a@phx.gbl...
>>> Thanks for the reply. It looks like I am almost there.
>>>
>>> There are a couple of questions.
>>>
>>> You say you can in Visual Studio, under "general"
> project
>>> properties st the Wrapper Key File Assembly. I could
> see
>>> no such options. I must be looking in the wrong place.
> I
>>> right click on the Project in the Solutions Explorer,
> and
>>> get a popup window. This shows the Project Properties.
> On
>>> the left is a tree, I select under Common Properties,
>>> General and see on the right, Assembly Name, Output
> Type
>>> (Windows Application) etc - but nothing about Wrapper
> Key
>>> File Assembly. Am I looking in the correct place ?
> (Help
>>> About shows Microsoft Development Environment Version
>>> 7.0.9466, .NET Framework Version 1.0.3705, Microsoft
>>> Visual Basic .NET   55537-640-6669627-18086).
>>>
>>> Also what steps do I take to create and apply a .MSI
> file
>>> if I were to build and deploy this application using
>>> Visual Studio.
>>>
>>> Thanks in advance
>>> Ray
>>>
>>>
>>>>-----Original Message-----
>>>>Hi Ray,
>>>>
>>>>> I have read a lot about Security and .NET and
>>> understand
>>>>> the issue of UNC drives / Intranet etc. The best
>>> approach
>>>>> seems to be to create a "strong name". Will this
> work?
>>>>
>>>>Yep, that would be the way to go.
>>>>
>>>>> When I compile it now comes up with the error:
>>>>> Unable to emit assembly: Referenced
>>>>> assembly "Interop.Excel" does not have a strong name.
>>>>>
>>>>> I cannot seem to find a way around this. What do I
> need
>>>>> to do to get around this error?
>>>>
>>>>You can work around this in one of two ways, depending
>>> on if you are using
>>>>Visual Studio or not.  If you are generating your COM
>>> interop library with
>>>>tlbimp on the command line, then you can use
>>> the /keyfile parameter to have
>>>>it sign the generated interop libarary.  If you are
>>> using Visual Studio,
>>>>then you need to go to your project properties, and
>>> under "general", set the
>>>>Wrapper Assembly Key File to a strong name key.
>>>>
>>>>>
>>>>> Presumably once I get around this, my next steps
> would
>>> be
>>>>> to add this strong name to my .NET Framework
>>>>> Configuration.
>>>>> This is presumably a matter of adding this Strong
>>>>> Name "power" to the Machine Permission Set with the
>>>>> relevant permissions (eg "FullTrust").
>>>>>
>>>>> My executable would then run on the network drive.
>>>>> Correct?
>>>>
>>>>Correct.  If you use the MMC snapin to modify your
>>> security policy, adding a
>>>>new code group will start a wizard that will allow you
>>> to actually pull the
>>>>strong name right off your assembly.
>>>>
>>>>
>>>>>Will running "donetfx.exe" install
>>>>> the .NET Framework?
>>>>
>>>>Yes.
>>>>
>>>>> The other issue in distributing my application on a
>>>>> client PC is how to add the Strong Name to their .NET
>>>>> Framework Configuration. How do I go about automating
>>> the
>>>>> distribution of this? I have read about creating
>>> an .msi
>>>>> file. Is this what I need to do and how to I apply in
>>> on
>>>>> the Client PC.
>>>>
>>>>Creating an MSI would be the easist way to distribute
>>> your modified policy.
>>>>I'm not sure how InstallShield works, so you'll have to
>>> check with them to
>>>>figure out how to run an external MSI package.
>>>>
>>>>-Shawn
>>>>-- 
>>>>
>>>>--------------------------------------------------
>>>>This posting is provided "AS IS" with no warranties,
> and
>>> confers no rights
>>>>
>>>>
>>>>.
>>>>
>>
>>
>>.
>> 


Relevant Pages

  • Re: Running a VB.NET Application on a Network Drive
    ... To use tlbimp, from a command prompt (with the SDK ... Assemblies as I believe these come pre-signed. ... As for your MSI question, to create the policy MSI, goto the .Net ... > You say you can in Visual Studio, ...
    (microsoft.public.dotnet.security)
  • Re: ActiveX Question Revisited
    ... into managed assemblies. ... Tlbimp lets you create a managed wrapper (sometimes ... might want to find out if the vendor has a PIA (Primary Interop Assembly) ...
    (microsoft.public.dotnet.languages.vc)
  • Re: Strange problem on runtime
    ... FooCOM.dll is in the same directory with interop and ... > the wrapper (which is what TLBIMP creates) and use that, ... >> application on prod machine exits straignt after loading. ... What the difference between (from assemblies point of view) computer ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: adodb.dll
    ... Assemblies. ... it will use the adodb.dll in the GAC. ... a new adodb.dll which is a interop of msado21.tlb. ... Using the Primary Interop Assembly for ADO in Visual Studio .NET ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Newbie to COM Interop
    ... Studio will create you an InterOp Assembly that allows you to call the methods on the COM object and wires up any necessary data type conversions and the like. ... you're looking at the "tlbimp" utility (if you need to put /your/ Assemblies into the Global Assembly Cache then you'll need tlbimp to "Strongly Name" the generated InterOp Assembly). ...
    (microsoft.public.dotnet.framework.interop)

Quantcast