Using AXBrowser in a strong names assembly

N

Nak

Hi there

I'm trying to use the Microsoft Web Browser within a strong names .NET
assembly that I have written. Unfortunately I am getting the following
linker problem as the Interop DLL that was created does not have a strong
name,

"Unable to emit assembly: Referenced assembly 'Interop.SHDocVw' does not
have a strong name"

Any ideas of work arounds for this? Thanks loads in advance.

Nick.
 
N

Nak

Hi there,

I've tried a few methods of signing the Interop DLL that the IDE creates
but had no luck. So I used "tlbimp" to import a new *signed* Interop DLL
into my Bin folder. This is great with the exception that the web browser
Usercontrol in the toolbox refers to the *unsigned* version. Any ideas on
how I get the Interop DLL ssigned and have it possible for me to create a
web browser by dragging and dropping from the toolbox?

I've found quite a few threads on this subject but none with a solid
("Yes this worked for me!"). People just don't seem to bother letting other
people know if they found a solution, but anyway, I'm sure loads of people
are using this web browser with signed assemblies, thanks for any help!

Nick.
 
C

Cor Ligthert

Nick,

I do not known a solution and do not want to check it because probably
Charles knows it, and when he sees this he will probably answer his fellow
Brittain, he did a lot in this and I remember me very much messages a little
bit like this between him and Fergus.

So wait a while not everybody is looking every hour to this newsgroup.

Cor
 
N

Nak

Cor,

Cheers, I shall, just hacking away at it and flitting to and fro OE,
VB.NET IDE and IE. :)

Nick.
 
N

Nak

Hi again Cor,

Just incase I've missed anything, I am actually using this to display
context sensitive Help in my application. I didn't want to use the HTML
help program because I absolutely hate it, but maybe I have missed other
ways that this can be done? I could use a rich text box but I think that's
a bit clumsy compared to HTML, I don't know, have you any ideas?

Nick.
 
T

Tim Anderson

Nak said:
Hi again Cor,

Just incase I've missed anything, I am actually using this to display
context sensitive Help in my application. I didn't want to use the HTML
help program because I absolutely hate it, but maybe I have missed other
ways that this can be done? I could use a rich text box but I think
that's a bit clumsy compared to HTML, I don't know, have you any ideas?

I've successfully used the HTMLEditor to display HTML Help:

http://www.itwriting.com/htmleditor/index.php

I don't know if it would fix the strong name issue.

Tim
..NET pros and cons:
http://www.itwriting.com/phorum/list.php?f=6
 
C

Cor Ligthert

Nick,

When you have seen all my messages in past about the in my idea at least
flaw integration from a client side help system in Visual Studio (even the
older), you would not have asked that too me.

When I write that, than they most (not guys as Herfried) come with as answer
the documentation for programmers and not for endusers.

However as far as I know are there no plans to do something for that.

I sometimes get the idea that operatoroverloading is much more important
than endusers for developpers.

Cor
 
N

Nak

Hi Cor,
I sometimes get the idea that operatoroverloading is much more important
than endusers for developpers.

Yeah, it certainly seems that way. Which is a big shame because the end
user is the most important aspect of the application, they have to be able
to use it. I can use it, but then again I did write it! Maybe Microsoft
will pull their fingers out and making something a little nicer than HTML
help and integrate it with the .NET IDE.

Nick.
 
N

Nak

Hi Tim,

I shall check your link out right away, thanks this looks like it could
help! :)

Nick.
 
N

Nak

Hi Tim,

I'ts a little more in-depth that I first had hoped, but then again, HTML
editing is not an easy thing to achieve by anyone's standards, Dreamweaver
messes me about enough let alone anything else. I am thinking that it would
be better for me to remove all "editing" aspects of the library so that it
just displays, but this is allot of work to do. So instead I am still
thinking of looking elsewhere, don't get me wrong, this would definitely
achieve what I desire but it will also do a whole lot more, and I can't risk
adding new bugs at this late stage. Thanks for the reference though,
recommended to anyone who needs HTML editing functionality.

Nick.
 
T

Tim Anderson

Nak said:
Hi Tim,

I'ts a little more in-depth that I first had hoped, but then again,
HTML editing is not an easy thing to achieve by anyone's standards,
Dreamweaver messes me about enough let alone anything else. I am thinking
that it would be better for me to remove all "editing" aspects of the
library so that it just displays, but this is allot of work to do.

Actually, it's not too bad. Just set isDesignMode to false :)

Tim
..NET pros and cons:
http://www.itwriting.com/phorum/list.php?f=6
 
N

Nak

Hi Tim,
Actually, it's not too bad. Just set isDesignMode to false :)

Maybe I should give it a go, I'm just a bit scared about using code that
I haven't really read or understand particularly much. I can read C#. but
the code for the HTMLEditor is immense, so if any weird bugs start appearing
I won't have much option but to delve into the code or pull it out
completely. That's not to say that I won't get anything bad from the
WebBrowser control, but I can't get the damn thing to work in a signed
assembly anyway!

I shall try to have a stab at it. By the way, do you have any
information on distribution? Because my application is commercial, I don't
want to go breaking *any* laws, I'll check your site out again but if you
can think of anything important please let me know. Cheers for your time
and help :)

Nick
 
T

Tim Anderson

I shall try to have a stab at it. By the way, do you have any
information on distribution? Because my application is commercial, I
don't want to go breaking *any* laws, I'll check your site out again but
if you can think of anything important please let me know. Cheers for
your time and help :)

No problem with distributing the HTMLEditor code; but note that you will
need to include the mshtml PIA (Primary Interop Assembly) with your app.
There are ways around that too; if you don't need the editing features you
could use one of the IE or mshtml wrappers that doesn't depend on mshtml. It
doesn't matter too much if you are distributing on CD.

Tim
..NET pros and cons:
http://www.itwriting.com/phorum/list.php?f=6
 
N

Nak

Hi There,

I have the solution,

Using the Visual Studio .NET command prompt I ran "aximp", this created
2 interop assemblies.

aximp "C:\Windows\System32\SHDocVw.dll" /keyfile:"mykeyfile.snk"
/out:Interop.SHDocVw.dll

I then referenced these 2 assemblies in my project and then created the
browser in code rather than dragging and dropping from the toolbox. For
example,

Dim pAWBHelp as AxWebBrowser
pAWBHelp = New AxWebBrowser()
Call Me.Controls.Add(pAWBHelp)

^ This will create a new AxWebBrowser control and add it to the forms
control container, voila!

Thanks to those of you that helped! :)

Nick.
 
N

Nak

Hi Tim,

I found the solution to my original problem, now I'm having to deal with
the flakiness of the webbrowser control, such joy! :) But I have a good
small solution now I think.

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