hi,

i think there's a problem in the way compiled resource filenames are computed in the 
solution task. I had a collision which was failing my build (cf my mail to the nant 
users list "solution task - problem with resources" on the 9th sept).

The filenames are computed by scanning the corresponding source files (cs or vb) to 
each resx file, looking for a namespace and class with a regexp, maybe to find out a 
unique name (namespace + classname should be unique). The problem is that the regexp 
used aren't robust enough.

There is also in the code an alternative way of doing so : using the path of the file 
as a unique name, and this seems to work well.

I can't figure out why this first manner is put forward in the code, it sounds like 
making two many assumptions to me, whereas more robust algorithms exist.

may I suggest the following fix, it forces the alternative way. If adopted, 3 
functions would need to be deleted as well (GetDependentResourceName and the like), 
not included in this fix for clarity.

 

--- resource.cs Wed Sep 03 11:00:01 2003
+++ resource.cs Wed Sep 17 15:18:35 2003
@@ -225,9 +225,9 @@
             string inFile = _resourceSourceFile;
             string outFile;
             
-            if (!StringUtils.IsNullOrEmpty(_dependentFile)) {
-                outFile = GetDependentResourceName(_dependentFile);
-            } else {
+            // if (!StringUtils.IsNullOrEmpty(_dependentFile)) {
+            //    outFile = GetDependentResourceName(_dependentFile);
+            // } else {
                 StringBuilder sb = new StringBuilder();
                 if 
(!StringUtils.IsNullOrEmpty(Project.ProjectSettings.RootNamespace)) {
                     sb.Append(Project.ProjectSettings.RootNamespace);
@@ -240,7 +240,7 @@
                 }
                 sb.Append(".resources");
                 outFile = sb.ToString();
-            }
+            //}
             outFile = Project.ProjectSettings.GetTemporaryFilename(outFile);
 
             _solutionTask.Project.Indent();


 
It does not prevent my project to have localized resource dlls (which BTW need 
dedicated tasks).


^){([8bAzE&z 
y!yޞm)rڞ^h왨x%gj{]z�X(~zwilqzlX)ߣڞ^h

Reply via email to