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"!
Gert Driesen
Tasks
0.85
Public
|
Date: 2004-12-05 10:46 Logged In: YES |
| 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 |
Copyright © 2010 Geeknet, Inc. All rights reserved. Terms of Use