Feisty toolbox

N

Nak

Hi there,

I'm having problems with the Toolbox in VB.NET 2002 Standard. I have 2
class libraries, 1 contains licensing classes and references nothing but
standard namespaces and the other references my first library in order to
protect the exposed components. To make things easier I'll refer to my
licensing library as licensinglibrary.dll and my control library as
controllibrary.dll.

When I try to add mycontrollibrary to the toolbox so that I can drag and
drop my components I recieve the following error,

"File or assembly name licensinglibrary, or one of its dependencies, was
not found."

I've tested for several issues I had encountered in the past when
encountering this message but they have returned false. None of the classes
in licensinglibrary are protected via license providers but the license
provider class *does* need a license embdedded into the executing assembly,
although it is designed to be 100% free at design time.

Anyway, regardless of that I can remove this class from the equation as
the getLicense method never actually gets called during the creation of the
icons before the error message is recieved. So has anyone any idea what the
problem could be? It's a shame the error message can't be a little more
specific!

Thanks loads in advance.

Nick.
 
N

Nak

Hi again (but to whome I don't know),

I've tested my licensinglibrary.dll by exposing a public user control
and then adding this library to my toolbox. The usercontrol appears as
expected. Therefore the error message,

"File or assembly name licensinglibrary, or one of its dependencies, was
not found."

*Must* be a load of cr4p surely? Maybe it's just a generic error
message for "Something is wrong, VS.NET can't add the icon to your
toolbox.".

Has anyone any ideas on how to resolve this? Or maybe does anyone know
how to add items to your toolbox manually? I'm sure if I know where the
information is stored I could find out how to add this. Anyway, thanks in
advance! Copy and pasting is solving my current problem but I have added
new controls to the library that I can't use at the moment. I wish I hadn't
reset my toolbox now!

Nick.
 
N

Nak

Right,

C:\Documents and Settings\Nick Pateman\Application
Data\Microsoft\VisualStudio\7.0\DotNetToolbox.log

^ This contains a detailed log of the errors encountered and this provides a
little more information than

"File or assembly name licensinglibrary, or one of its dependencies, was not
found."

I haven't sorted the issue yet but at least this gives me something to work
on.

Nick.
 
N

Nak

Right again!

Definite bug if you ask me, I can resolve the issue by copying my
licensinglibrary.dll to

C:\Program Files\Microsoft Visual Studio
..NET\Common7\IDE\PrivateAssemblies

It seems that the IDE is looking in all the wrong places for the
assembly for some reason.

LOG: Private path hint found in configuration file:
PublicAssemblies;PrivateAssemblies.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft
Visual Studio .NET/Common7/IDE/licensinglibrary.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft
Visual Studio .NET/Common7/IDE/licensinglibrary/licensinglibrary.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft
Visual Studio .NET/Common7/IDE/PublicAssemblies/licensinglibrary.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft
Visual Studio
..NET/Common7/IDE/PublicAssemblies/licensinglibrary/licensinglibrary.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft
Visual Studio .NET/Common7/IDE/PrivateAssemblies/licensinglibrary.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft
Visual Studio
..NET/Common7/IDE/PrivateAssemblies/licensinglibrary/licensinglibrary.DLL.

LOG: Attempting download of new URL file:///C:/Program Files/Microsoft
Visual Studio .NET/Common7/IDE/licensinglibrary.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft
Visual Studio .NET/Common7/IDE/licensinglibrary/licensinglibrary.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft
Visual Studio .NET/Common7/IDE/PublicAssemblies/licensinglibrary.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft
Visual Studio
..NET/Common7/IDE/PublicAssemblies/licensinglibrary/licensinglibrary.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft
Visual Studio .NET/Common7/IDE/PrivateAssemblies/licensinglibrary.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft
Visual Studio
..NET/Common7/IDE/PrivateAssemblies/licensinglibrary/licensinglibrary.EXE.

Nick.
 
B

Bill Henning

Did you ever find an answer to this issue? I'm running into the same thing
where I have a three assembly setup where the dependencies are like this:

TopLevelAssembly -> LibraryAssembly -> BaseLibraryAssembly

When I try and add the TopLevelAssembly to the ToolBox, it gives me the
"File or assembly name TopLevelAssembly, or one of its dependencies, was not
found."

I've been unable to find a way around this. I looked at the
DotNetToolbox.log and see this:

1/23/2005 7:58:35 PM: *** ERROR: System.IO.FileNotFoundException: File or
assembly name BaseLibraryAssembly, or one of its dependencies, was not
found.
File name: "BaseLibraryAssembly"
at System.Reflection.CustomAttribute.CreateCAObject(Int32& propNum,
Assembly& assembly)
at System.Reflection.CustomAttribute.GetObject()
at
System.Reflection.CustomAttribute.CheckConsistencyAndCreateArray(CustomAttribute
caItem, Type caType)
at System.Reflection.CustomAttribute.GetCustomAttributes(MemberInfo
member, Type caType, Boolean inherit)
at System.Reflection.CustomAttribute.GetCustomAttributes(Type type, Type
caType, Boolean inherit)
at System.RuntimeType.GetCustomAttributes(Boolean inherit)
at System.ComponentModel.TypeDescriptor.GetCustomAttributes(Type type)
at System.ComponentModel.MemberList.ReflectGetCustomAttributes(Type
classToReflect, Type metadataType)
at System.ComponentModel.MemberList.GetAttributes()
at System.ComponentModel.ComponentEntry.GetAttributes(Object component)
at System.ComponentModel.TypeDescriptor.GetAttributes(Type componentType)
at
Microsoft.VisualStudio.Designer.Service.ToolboxService.CreateToolboxItem(Type
type, AssemblyName name)
at
Microsoft.VisualStudio.Designer.Service.ToolboxEnumeratorDomainObject.EnumerateToolboxElementsLocal(String
fileName, String typeName)

Bill
 
N

Nak

Hi Bill,

I found that if I stick a copy of the latest build of the assembly that
the IDE is moaning for in

"C:\Program Files\Microsoft Visual Studio
..NET\Common7\IDE\PrivateAssemblies"

It locates it and uses it without issue. I *think* there may be some
way of referncing a path within the assembly that the IDE should look in,
but I have not found any documentation to say this. If this does not solve
your issue then it is something else that is at fault, so you may want to
consider the following,

* Do your controls/components use a custom context? If so the IDE is
not necessarily setting this before attempting to create an instance of the
object. I believe a custom attribute specifying the type of context to use
can be implemented, but again I found no documentation saying how to achieve
this.

* This may sound crude but try message box debugging each component
that is created in order to enumerate your icons in the toolbox, you may
find that an object is having difficulty in being created, the error message
you are recieving is probably got nothing to do with locating an assembly,
the message is rather crud. Or altenatively write debug messages to a file
on the local hard drive, message boxes are rather annoying when used in this
context, writing to the console would be pointless as you wouldn't see any
output as the IDE is not attached to the stream at that point in time.

If your still having problems or haven't managed to locate the control
which the error is first occuring in you have a big mountain in front of
you. Sorry to say that but the .NET IDE can get like that sometimes. As a
matter of interest what version are you using?

Nick.
 
B

Bill Henning

Yes, our controls use licensing but the strange thing is that I have another
product that has the exact same setup and it works fine. The only
difference is the top-level assembly.

So essentially this does not work:
TopLevelAssembly -> LibraryAssembly -> BaseLibraryAssembly

But this works ok:
OtherTopLevelAssembly -> LibraryAssembly -> BaseLibraryAssembly

Go figure! :) It has to be something in the specific project that is
compiled into the assembly itself. I have yet to turn off all ToolBox
attributes to see if that helps or not. I also might try recreating the
project from scratch to see if that helps.

I'm using VS 2002 / .NET 1.0. Which do you use?

Bill
 
N

Nak

Hi Bill,
Yes, our controls use licensing but the strange thing is that I have
another product that has the exact same setup and it works fine. The only
difference is the top-level assembly.
Hmmm...

So essentially this does not work:
TopLevelAssembly -> LibraryAssembly -> BaseLibraryAssembly

But this works ok:
OtherTopLevelAssembly -> LibraryAssembly -> BaseLibraryAssembly

Go figure! :) It has to be something in the specific project that is
compiled into the assembly itself. I have yet to turn off all ToolBox
attributes to see if that helps or not. I also might try recreating the
project from scratch to see if that helps.

This certainly sounds strange. One thing I found that I had issues with
was my licensed user controls that had other licensed classes within them,
these other classes did not have free design time licensing enabled so an
error was occuring while attempting to make the objects. If the licensing
code is your own I would suggest possibly putting some debugging code in the
GetLicense method of the provider, maybe this is causing an issue, if it
doesn't even get in there then it's definitely not the licensing code at
fault.
I'm using VS 2002 / .NET 1.0. Which do you use?

VB.NET 2002 Standard.

Nick.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top