Hi, I recieved an VB.NET solution to study and then maintain, but I can't compile it, it's giving a lot of errors about Office integration like 'MsoTriState' is ambiguous in the namespace 'Microsoft.Office.Core'

So I checked the object browser and indeed there's the same object in two diffente namespaces: [Microsoft.Office.Core] and [office].

In the references theres only one Office at 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\Visual Studio Tools for Office\PIA\Office14\Office.dll', and if I remove it, then the compiler says that the reference is missing.

Anyone have seen this before? None of the solutions I found online could help me.

Thanks.

Usually these types of errors mean you have to qualify which namespace the property/method belongs to.

tinstaafl,

I'd do it, but I'm not finding a way.
This is who it's been imported:

Imports Office = Microsoft.Office.Core

And this is how it's been used:

Office.MsoTriState

But the strangiest thing is that, if I type Office. or Microsoft.Office.Core. I don't get any MsoTriState suggestion, but I got others like MsoPickerField.

I tried changing the import name but in none attempt I was able to get the MsoTriState to appear.

Tried creating a new project, adding the same reference(Office 12) and it all works ok, I got the MsoTriState suggestion and it compile ok.

Also tried removing, adding the same reference and others like Office 14, but no change.

I'm avoiding having to re-create every project and copy the files, because it'll be such a pain, it's about 10 projects with lots of reference and specific configurations. That's why I'm trying everything that I can think of to fix this issue in the given solution.

Thanks.

See if qualifying it with the full namespace helps: Microsoft.Office.Core.MsoTriState

tinstaafl, it's no good, as I said, Office. or Microsoft.Office.Core give the same error.

It's been a while, but just to register the solution:

Visual Studio 2008 didn't show, but there was two references on the .csproj file and that's what caused the problem, editing the file and removing the second reference was the only solution.

Thanks for all that helped.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.