Wants a reference I didn't set

D

David Thielen

Hello;

This happend when as far as I know I changed nothing.

Suddenly for my Word2002 project (I have a 2000, 2002, & 2003 project using
the same files - but different PIAs), I was getting a bunch of classes
multiple defined. The error message said it was using the definitions in
C:\WINNT\Microsoft.NET\Framework\v1.1.4322\office.dll.

Nothing in my references points to that file. My references do point to an
office.dll that is my 2002 PIA. When I renamed ....\v1.1.4322\office.dll to
.....\v1.1.4322\_office.dll, then everything built fine. So my office.dll was
what was needed.

So why was something pointing at that other office.dll all of a sudden? And
what is the office.dll for Office 2002 even doing there?
 
G

Gary Chang[MSFT]

P

Peter Huang [MSFT]

Hi

First of all, I want to confirm this is an error or an warning, that is to
say, did the build process succeeded?
Did you install multiple Office PIA or Office products on the same machine?
As is known, in the compilation time, the IDE will not reference the
Assembly in GAC, but in the runtime, it will search the necessary dll in
the GAC.

You may have a check and let me know the result.

Best regards,

Peter Huang
Microsoft Online Partner Support

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

Peter Huang [MSFT]

Hi

In addition, the CommardBar, CommandBarControl and so on class/interface is
declare in the office.dll. It is where the namespace Microsoft.Office.Cor
is located.

Best regards,

Peter Huang
Microsoft Online Partner Support

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

David Thielen

Hi;

It was a warning. But why was it suddenly using
C:\WINNT\Microsoft.NET\Framework\v1.1.4322\office.dll when I did not have
that file in my references? And how can I stop it from doing that other than
renaming that office.dll file?
 
P

Peter Huang [MSFT]

Hi

Based on my further research, this is a known issue.
When we create a Addin project, the
Office.dll(C:\WINNT\Microsoft.NET\Framework\v1.1.4322\office.dll) will be
referenced by default, but when we add reference to the Word or other
office COM Object library, the Office.dll in the GAC will be referenced
automatically which cause the problem due to two office.dll referenced.
Here is a link for your reference.
http://community.sgdotnet.org/forums/14644/ShowPost.aspx

So far as a workaround, we need to manually remove the unnecessary
office.dll reference.

Best regards,

Peter Huang
Microsoft Online Partner Support

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

David Thielen

The weird thing is there was no second reference in my csproj file. SO it
went and used it even though it was not a listed reference.

Any ideas why?
 
P

Peter Huang [MSFT]

Hi

<Reference
Name = "Office"
AssemblyName = "Office"
/>
<Reference
Name = "Extensibility"
AssemblyName = "Extensibility"
/>
<Reference
Name = "Microsoft.Office.Core"
Guid = "{2DF8D04C-5BFA-101B-BDE5-00AA0044DE52}"
VersionMajor = "2"
VersionMinor = "3"
Lcid = "0"
WrapperTool = "primary"
/>


Based on my research, the problem occur as above, the Office and
"Microsoft.Office.Core" will all reference to the Office.dll which has
multiple define, you may have a check.

Best regards,

Peter Huang
Microsoft Online Partner Support

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

David Thielen

All I have (System... ones removed) is:

<Reference
Name = "extensibility"
AssemblyName = "extensibility"
HintPath = "..\..\..\Program Files\Microsoft Visual
Studio .NET 2003\Common7\IDE\PublicAssemblies\extensibility.dll"
AssemblyFolderKey = "hklm\publicassemblies"
/>
<Reference
Name = "office"
AssemblyName = "office"
HintPath = "libs\office.dll"
/>
<Reference
Name = "Microsoft.Office.Interop.Word"
AssemblyName = "Microsoft.Office.Interop.Word"
HintPath = "libs\Microsoft.Office.Interop.Word.dll"
/>
<Reference
Name = "Microsoft.Vbe.Interop"
AssemblyName = "Microsoft.Vbe.Interop"
HintPath = "libs\Microsoft.Vbe.Interop.dll"
/>

That's what bothers me about this - I have the office.dll in my own library
and not the VS.NET one - and yet it grabbed that one too. Possibly because
they have the same name - but it shouldn't do that - correct?
 
P

Peter Huang [MSFT]

Hi

It seems that the behavior on your machine is different from my side.
Here I would like to confirm something with you.
1. If we create a new addin project, the Office.dll(Office namespace) will
be added automatically.

2. If we add the Word library, another Office.dll(Microsoft.Office.Cor
namespace) will be added automatically.

Can you check the above and let me know the behavior of your machine?

If the second failed, I think you may try to check the PIA installed.

Best regards,

Peter Huang
Microsoft Online Partner Support

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

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