Groups | Blog | Home
all groups > dotnet windows forms designtime > november 2005 >

dotnet windows forms designtime : Could not load File or assembly...


Sebastian Lampka
11/30/2005 8:38:49 AM
Hi,

In my project, which I develop under VS 2005, I have a form, on which I put
a FlashObject.
Everything is fine so far and works. Then I copied the project to a
different computer and open it with VS 2005 and the designer of this form
shows this exception:

Could not load file or assembly 'Interop.ShockwaveFlashObjects,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its
dependencies. The system cannot find the file specified.

at AxShockwaveFlashObjects.AxShockwaveFlash.AttachInterfaces()
at System.Windows.Forms.AxHost.GetOcxCreate()
at System.Windows.Forms.AxHost.set_Site(ISite value)
at System.ComponentModel.Container.Add(IComponent component, String name)
at System.ComponentModel.Design.DesignerHost.Add(IComponent component,
String name)
at ...


What is strange for me, that it happens sometimes and sometimes not. If I
restart VS it can happen that the designer has no problem. I cannot see any
pattern of this behaviour.
I would understand if VS never can show the form in design time, but this
way it makes no sense to me.

Can somebody tell me what is wrong and how I can avoid it?

Thanks in forward.

Sebastian Lampka

v-jetan NO[at]SPAM online.microsoft.com (
12/1/2005 9:33:50 AM
Hi Sebastian,

Thanks for your post.

Based on my error message, it seems that the VS.net IDE can not find
"Interop.ShockwaveFlashObjects" assembly. Because this is not a strong
named assembly, you may check if this assembly reside in certain
sub-directory of your project. Also, you may check if this assembly resides
in the project's "References" node in the solution explorer.

Furthermore, you can use Reflector to view
AxShockwaveFlashObjects.AxShockwaveFlash.AttachInterfaces()'s source code,
then we can find the root cause why this method fails.(We must first use
Reflector to open the assembly where
AxShockwaveFlashObjects.AxShockwaveFlash.AttachInterfaces() method resides
in)

Hope this helps

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
Sebastian Lampka
12/1/2005 10:08:16 AM
Hi Jeffrey,

Thanks for your reply.

The assemblies are in ../PhotoModule/obj/Debug/

PhotoModule is in this case the project, which is using the Flash object.

I checked the dll are there and the references to the assemblies are okay,
too.
I also tried to use Reflector to see, what is going on in
AxShockwaveFlashObjects.AxShockwaveFlash.AttachInterfaces(). Here is the
source code:

Protected Overrides Sub AttachInterfaces()
Try
Me.ocx = CType(MyBase.GetOcx, IShockwaveFlash)
Catch exception1 As Exception
End Try
End SubI cannot see anything special about it.It is just not reasonable for
me that sometimes I get the error and other timesI don't. Do you know what
else I can do? Right now I would say that it is a bug in VS IDE.Thanks for
your help.Sebastian



[quoted text, click to view]

v-jetan NO[at]SPAM online.microsoft.com (
12/2/2005 12:00:00 AM
Hi Sebastian,

Thanks for your post.

Oh, yes, there is not anything special in the AttachInterfaces() method. I
think this error is caused when the VS.net designer attempting to call
AxShockwaveFlashObjects.AxShockwaveFlash.AttachInterfaces. Before calling
AxShockwaveFlash.AttachInterfaces, we should first load the assembly
containing AxShockwaveFlash class. It just fails at this time.

Yes, we now see that ShockwaveFlashObjects assembly resides in
../PhotoModule/obj/Debug/ folder. Can you give the assembly version a
check? Does it equal to "1.0.0.0", which is what your designer is trying to
load.

Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
Sebastian Lampka
12/2/2005 2:45:13 PM
Hi Jeffrey,

I looked under references in the Solution Explorer, and the assembly
version equals 1.0.0.0. Just a question to the version: Because VS is
creating these assemblies automatically, is it everytime 1.0.0.0?

I found a work around for displaying flash by using the Webbrowser control.
This way
I avoid using any references.

Thanks for your replies.

Best Regards,
Sebastian

[quoted text, click to view]

v-jetan NO[at]SPAM online.microsoft.com (
12/5/2005 6:44:31 AM
Hi Sebastian,

I am glad you use the WebBrowser control to resolve this issue.

For the assembly version question: No, for VS.net generated assembly, it
will be controlled by AssemblyVersion attribute in the AssemblyInfo.cs
file.
For more information about the assembly version, please refer to the
article below:
"Managing Versions of an Application"
http://msdn.microsoft.com/library/defalt.asp?url=/library/en-us/dndotnet/htm
l/managevers.asp

Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
AddThis Social Bookmark Button