Share

NAnt - A .NET Build Tool

Tracker: Bugs

5 ResGen task does not use dynamicprefix - ID: 1150186
Last Update: Comment added ( drieseng )

--- Description ---
The Resgen task is not using the dynamic prefix (passed
through the <resourcefileset>) properly.

Currently it is just prefixing the value of the dynamic
prefix to the resource filename while creating a
.resource file. It does not resolve the complete
subfolder names to generate the appropriate .resource
file.

--- Steps To Reproduce ---
(see attached repro)
1) Create a resource file Foo.en-us.resx, under the
relative project path .\Bar\

2) Compile the resource file using the following NAnt task
<resgen>
<resources prefix="Example" dynamicprefix="true">
<include name="**\*.resx" />
</resources>
</resgen>

3) Execute NAnt.exe 0.85 in the project root directory

--- Expected Result ---
A file named "Example.Bar.Foo.en-us.resources" should
be created in the subdirectory .\Bar\

--- Actual Result ---
The file is incorrectly named
"Example.Foo.en-us.resources" ; the dynamic prefix from
the subdirectory "Bar" is missing.

--- Suggested Fix ---

The function ResourceFileSet::GetManifestResourceName()
gets the correct resource name. It should be used by
the ResGen task.

Edit project file
".\src\NAnt.DotNet\Tasks\ResGenTask.cs" line # 346:

Current Line #346:
> FileInfo outputFile = GetOutputFile(new
FileInfo(filename), Resources.Prefix);

Fixed Line # 346:
> FileInfo outputFile = new FileInfo(
Resources.GetManifestResourceName(filename, filename));


stj3570 ( stj3570 ) - 2005-02-23 22:35

5

Closed

Fixed

Gert Driesen

Tasks

0.85

Public


Comments ( 2 )

Date: 2005-02-24 19:13
Sender: driesengProject AdminAccepting Donations

Logged In: YES
user_id=707851

This is now fixed in CVS. The patch you supplied was not
correct though, as it did not honor the "todir" attribute.

But thanks anyway !


Date: 2005-02-23 23:30
Sender: stj3570

Logged In: YES
user_id=1066215

CORRECTION: Should fix lines # 374-375 and # 411-412


Attached Files ( 2 )

Filename Description Download
repro.zip Bug Repro Archive Download
ResGenTask~fix.cs Fixed ResGenTask.cs Download

Changes ( 6 )

Field Old Value Date By
status_id Open 2005-02-24 19:13 drieseng
resolution_id None 2005-02-24 19:13 drieseng
assigned_to nobody 2005-02-24 19:13 drieseng
close_date - 2005-02-24 19:13 drieseng
File Added 122821: ResGenTask~fix.cs 2005-02-23 23:30 stj3570
File Added 122810: repro.zip 2005-02-23 22:36 stj3570