Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / Design Time / December 2005

Tip: Looking for answers? Try searching our database.

Could not load File or assembly...

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sebastian Lampka - 30 Nov 2005 15:38 GMT
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
"Jeffrey Tan[MSFT]" - 01 Dec 2005 09:33 GMT
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
Signature

Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Sebastian Lampka - 01 Dec 2005 17:08 GMT
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

> Hi Sebastian,
>
[quoted text clipped - 21 lines]
> Get Secure! - www.microsoft.com/security
> This posting is provided "as is" with no warranties and confers no rights.
"Jeffrey Tan[MSFT]" - 02 Dec 2005 03:43 GMT
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
Signature

Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Sebastian Lampka - 02 Dec 2005 21:45 GMT
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

> Hi Sebastian,
>
[quoted text clipped - 19 lines]
> Get Secure! - www.microsoft.com/security
> This posting is provided "as is" with no warranties and confers no rights.
"Jeffrey Tan[MSFT]" - 05 Dec 2005 06:44 GMT
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
Signature

Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.