I am calling my business layer project in Web Project. I added refress business layer project to Web. When I call class in BL project, I need to write twice this namespace. I dont know why it is coming.
MyCompanyName.HRHead.DataLayer.MyCompanyName.HRHead.DataLayer.User
I suppose to call
MyCompanyName.HRHead.DataLayer.User
In my BL project I defined all classes namespace is MyCompanyName.HRHead.DataLayer
Please help me out.
Thanks in advance
In VB, the project has a default namespace - and this is applied as a prefix to whatever you write in the source. This is not like C#, where the project's default namespace just affects the source code template when you add a new item . So if your project default namespace is Foo.Bar
and you also declare a namespace of Foo.Bar.Baz
, the full namespace will be Foo.Bar.Foo.Bar.Baz
.
I suggest you either change the project settings or just remove the common prefix from your source code.
I am assuming certain things from the tags that you are using. You are using an assembly written in VB.NET in your other project. VB.NET project properties include an attribute "default namespace" and that might be set with the namespace that you have defined explicitly at the top of your classes. Remove the default namespace (uncheck it) in the project properties and recompile the same.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With