Build fails when namespace and class name are identical

Apr 4, 2011 at 1:07 PM

Hi,

While testing NTrace on our product I hit a strange problem: if the instrumented class has the same name as its namespace, build fails.

For example, if you create a test project with namespace 'NTraceTest' and change the default 'Program' class name to 'NTraceTest' as well, you get the following (notice that in spite it shows as a warning, it's actually an error):

Program.cs(11,35): warning CS0117: 'NTraceTest.NTraceTest' does not contain a definition for 'TraceHelper'

Program.cs(11,94): warning CS0117: 'NTraceTest.NTraceTest' does not contain a definition for 'TraceHelper'

Program.cs(11,140): warning CS0117: 'NTraceTest.NTraceTest' does not contain a definition for 'TraceHelper'

When changing it back to 'Program' everything works fine.

Is this a known issue?

Thanks,

--Eran

Coordinator
Apr 4, 2011 at 1:45 PM
Hm. No, that's a bug. It's probably an issue with our code parser; I'll look into it.

On Mon, Apr 4, 2011 at 8:07 AM, eranhare <notifications@codeplex.com> wrote:

From: eranhare

Hi,

While testing NTrace on our product I hit a strange problem: if the instrumented class has the same name as its namespace, build fails.

For example, if you create a test project with namespace 'NTraceTest' and change the default 'Program' class name to 'NTraceTest' as well, you get the following (notice that in spite it shows as a warning, it's actually an error):

Program.cs(11,35): warning CS0117: 'NTraceTest.NTraceTest' does not contain a definition for 'TraceHelper'

Program.cs(11,94): warning CS0117: 'NTraceTest.NTraceTest' does not contain a definition for 'TraceHelper'

Program.cs(11,140): warning CS0117: 'NTraceTest.NTraceTest' does not contain a definition for 'TraceHelper'

When changing it back to 'Program' everything works fine.

Is this a known issue?

Thanks,

--Eran

Read the full discussion online.

To add a post to this discussion, reply to this email (NTrace@discussions.codeplex.com)

To start a new discussion for this project, email NTrace@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com