Cannot compile project. Cannot declare a namespace and a type both named 'dk'


#1

I’ve downloaded the Aspose.Word component for evaluation.
The project that I’m working on has a namespace thats called dk.company.project etc.
The trouble is the dk in the namespace. The Aspose.Word component has a type that is called dk. This causes the compiler to give me the following error: Cannot declare a namespace and a type both named ‘dk’.
I’m impressed with the component but do not wish to alter my namespace.
Any chance for a quick solution to my problem?

Good luck tracking down the bug.


#2

You must be using VB.NET, right?

There is no type called “dk” in Aspose.Word. I’m not exactly sure at this stage, but I think the problem is caused by “Word” in “Aspose.Word”.

I’ve had this problem before when I was creating demo projects and resolved it by removing the namespace from the source code. Thought it’s a VB.NET glitch and did not pay much attention to it.

If you want a quick solution then try removing “namespace mynamespace” from the source files that use Aspose.Word. Don’t need to remove from the whole project. I think that classes in source files without “namespace” go into the project default namespace specified in the project properties. So you might be able to get both: keep your namespace and get Aspose.Word working. Let me know if this solution is suitable.

I will add this problem to our task list to address in future releases.


#3

Hi, this was resolved and will go out in Aspose.Word 1.6.3 release later today.