423,674 Members | 1,946 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 423,674 IT Pros & Developers. It's quick & easy.

IWshRuntimeLibrary Question

P: n/a
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 'IWshRuntimeLibrary' could not
be found (are you missing a using directive or an assembly
reference?)

The error line is right at the begninning:

using IWshRuntimeLibrary;

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
Nov 15 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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]
- mv*@spam.guard.caspershouse.com
"Dale Magnuson" <ma***********@mayo.edu> wrote in message
news:28****************************@phx.gbl...
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 'IWshRuntimeLibrary' could not
be found (are you missing a using directive or an assembly
reference?)

The error line is right at the begninning:

using IWshRuntimeLibrary;

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

Nov 15 '05 #2

P: n/a
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 (IWshRuntimeLibrary). 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
IWshRuntimeLibrary;

Thank you!

-----Original Message-----
Dale,

You probably have set a reference to a COM dll in your project and theinterop 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 ofyour project. If you find the interop assembly and move it to the networkdrive, then you should be ok.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Dale Magnuson" <ma***********@mayo.edu> wrote in message
news:28****************************@phx.gbl...
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 'IWshRuntimeLibrary' could not be found (are you missing a using directive or an assembly reference?)

The error line is right at the begninning:

using IWshRuntimeLibrary;

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

.

Nov 15 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.