IWshRuntimeLibrary Question

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

    #1

    IWshRuntimeLibrary Question

    I originally had all of my C# work on my local PC.
    Because this is dangerous I moved it off to a network
    drive. Since I did this I can no longer compile my code -
    I get the error below.

    The type or namespace name 'IWshRuntimeLib rary' could not
    be found (are you missing a using directive or an assembly
    reference?)

    The error line is right at the begninning:

    using IWshRuntimeLibr ary;

    I use this library to create a shortcut on the users
    desktop. This worked fine when all the source was on my
    local PC, but now that it is on the network I receive the
    error.

    Any help is greatly appreciated!

    Thanks,
    Dale
  • Nicholas Paldino [.NET/C# MVP]

    #2
    Re: IWshRuntimeLibr ary Question

    Dale,

    You probably have set a reference to a COM dll in your project and the
    interop assemblies that were created weren't moved when you moved your code.
    Basically, there should be a dll (with Interop in the name) that was part of
    your project. If you find the interop assembly and move it to the network
    drive, then you should be ok.

    Hope this helps.


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


    "Dale Magnuson" <magnuson.dale@ mayo.edu> wrote in message
    news:280401c3af 8a$c13faff0$a60 1280a@phx.gbl.. .[color=blue]
    > I originally had all of my C# work on my local PC.
    > Because this is dangerous I moved it off to a network
    > drive. Since I did this I can no longer compile my code -
    > I get the error below.
    >
    > The type or namespace name 'IWshRuntimeLib rary' could not
    > be found (are you missing a using directive or an assembly
    > reference?)
    >
    > The error line is right at the begninning:
    >
    > using IWshRuntimeLibr ary;
    >
    > I use this library to create a shortcut on the users
    > desktop. This worked fine when all the source was on my
    > local PC, but now that it is on the network I receive the
    > error.
    >
    > Any help is greatly appreciated!
    >
    > Thanks,
    > Dale[/color]


    Comment

    • Dale Magnuson

      #3
      Re: IWshRuntimeLibr ary Question

      Found the answer online
      (http://www.codeproject.com/dotnet/shelllink.asp):

      The Windows Scripting Host (WSH) enables a number of file
      system and network operations to be performed from a
      script file. Fortunately, it is very simple to directly
      program the WSH in a .NET program by including a reference
      to the WSH runtime library (IWshRuntimeLib rary). To do
      this within the Visual Studio .NET IDE, do the following:
      after creating a new project, right-click on the project
      name within the Solution Explorer, select "Add Reference",
      select the "COM" tab, find and select the "Windows Script
      Host Object Model" in the listbox, click "Select", and
      then click "OK". Next, include a reference to the library,
      for example, within a C# file use the following: using
      IWshRuntimeLibr ary;

      Thank you!

      [color=blue]
      >-----Original Message-----
      >Dale,
      >
      > You probably have set a reference to a COM dll in[/color]
      your project and the[color=blue]
      >interop assemblies that were created weren't moved when[/color]
      you moved your code.[color=blue]
      >Basically, there should be a dll (with Interop in the[/color]
      name) that was part of[color=blue]
      >your project. If you find the interop assembly and move[/color]
      it to the network[color=blue]
      >drive, then you should be ok.
      >
      > Hope this helps.
      >
      >
      >--
      > - Nicholas Paldino [.NET/C# MVP]
      > - mvp@spam.guard. caspershouse.co m
      >
      >
      >"Dale Magnuson" <magnuson.dale@ mayo.edu> wrote in message
      >news:280401c3a f8a$c13faff0$a6 01280a@phx.gbl. ..[color=green]
      >> I originally had all of my C# work on my local PC.
      >> Because this is dangerous I moved it off to a network
      >> drive. Since I did this I can no longer compile my[/color][/color]
      code -[color=blue][color=green]
      >> I get the error below.
      >>
      >> The type or namespace name 'IWshRuntimeLib rary' could[/color][/color]
      not[color=blue][color=green]
      >> be found (are you missing a using directive or an[/color][/color]
      assembly[color=blue][color=green]
      >> reference?)
      >>
      >> The error line is right at the begninning:
      >>
      >> using IWshRuntimeLibr ary;
      >>
      >> I use this library to create a shortcut on the users
      >> desktop. This worked fine when all the source was on my
      >> local PC, but now that it is on the network I receive[/color][/color]
      the[color=blue][color=green]
      >> error.
      >>
      >> Any help is greatly appreciated!
      >>
      >> Thanks,
      >> Dale[/color]
      >
      >
      >.
      >[/color]

      Comment

      Working...