Share

NAnt - A .NET Build Tool

Tracker: Bugs

5 solution task: namespace prefixing wrong on resources - ID: 1077253
Last Update: Comment added ( drieseng )

0.85rc1

<solution> task, C# winforms project.

The RootNamespace shouldn't get prefixed onto
winforms' .resx resources -- it should be made to match
the namespace of the corresponding form/control class.

NAnt usually gets this right (kudos!) but slips up if the
form-derived class isn't in any namespace.

Repro steps:

- start VS2003, create new winforms project (C#)

- project props: change default namespace
from "WindowsApplication1" or whatever
to "DefaultNamespace".

- Form1 properties: set Localizable=true, in order to
generate dependency on resx file.

- edit Form1.cs: remove the outer namespace
declaration ("WindowsApplication1") so that the form
class is declared at the top level (not in any namespace)

- compile (w/ VS)

- inspect WindowsApplication1.exe with ildasm or
whatever; note presence of resource:

.mresource public Form1.resources

- add a bmp or jpg file or something to the project, as
an Embedded Resource; recompile, and inspect w/
ildasm. You'll get something like this:

.mresource public Form1.resources
.mresource public DefaultNamespace.Sunset.jpg

- now, rebuild all w/ NAnt <solution> task, and note the
difference in naming:

.mresource public DefaultNamespace.Form1.resources
.mresource public DefaultNamespace.Sunset.jpg

- the resulting app will crash upon startup
(System.Resources.MissingManifestResourceException)
because it can't find "Form1.resources"!


Shawn A. Van Ness ( arithex ) - 2004-12-02 02:06

5

Closed

Fixed

Gert Driesen

Tasks

0.85

Public


Comment ( 1 )

Date: 2004-12-05 10:46
Sender: driesengProject AdminAccepting Donations

Logged In: YES
user_id=707851

This issue is now fixed in cvs.

Thanks for the report !!


Attached File

No Files Currently Attached

Changes ( 4 )

Field Old Value Date By
status_id Open 2004-12-05 10:46 drieseng
resolution_id None 2004-12-05 10:46 drieseng
close_date - 2004-12-05 10:46 drieseng
assigned_to nobody 2004-12-04 18:32 drieseng