Hi all,

Thanks for your help so far, very useful!

I ran into another thing:

 

I compiled the same website using Visual Studio and using a nant script.

I compared the dll and its satellite dll’s  with the Loetz Roeder’s resource tool to see what resources are in there and what the names of the binary resource files in the DLL’s are.

 

The satellite assemblies are identical so that’s fine.

But there are differences in the main dll’s:

 

The names of the included binary resource file differ:

 

The Visual Studio build uses the name of the class that the resource belongs to.

Example:

 

phw842_frm1.ascx.nl.resx belongs to phw842_frm1.ascx.cs (In Visual Studio, the is represented by the fact that this resx file ‘hangs’ under the ascx file and in the csproj file this is specified in the ‘DependantUpon attribute.

 

My nant build turns this resx file into phw842_frm1.Resources (resource file name is based on resx file name) and adds it to the dll).

 

But the Visual Studio build turns this resx file into phw842_1.Resources (resource file name is based on the classname in the code file the resx belongs to (this class name differs from the name of the code file!)) and adds it to the .dll.

 

The result is that resource managers in the code who try to load the binary resource file phw842_1.Resources by using the type of the class, won’t find it.

 

How can I change my CSC task so it includes resource files with names that are base on class names (types) instead of resx file names?

 

 

The way I compile the files in Nant is by just listing all resx files in a resources node (see below example code), I guess I have to somehow specify the links between code files and resource files so Nant can figure out the names for the binary resource files?

 

Note that for the satellite assemblies, I parsed the csproject files and code files with a program I wrote myself to get to the classenames (types) that must be used for the names of the .resource files.

 

Thanks,

Bert-Jan

 

Example:

   <csc failonerror="false" debug="${build.debug}" warnaserror="true" output="H:\BuildDepot\Pharos\DevelopmentVersion\Nantbuild\phw842\bin\phw842.dll" target="library">

      <sources>

        <includes name="BuildAssemblyInfo.cs" />

        <includes name="Global.asax.cs" />

        <includes name="PharosCorner.aspx.cs" />

        <includes name="PharosHeader.aspx.cs" />

        <includes name="phw842_frm0.aspx.cs" />

        <includes name="phw842_frm1.ascx.cs" />

        <includes name="phw842_frm1.aspx.cs" />

        <includes name="phw842_frm2.ascx.cs" />

        <includes name="phw842_frm2.aspx.cs" />

        <includes name="phw842_frm3.ascx.cs" />

        <includes name="phw842_frm3.aspx.cs" />

        <includes name="phw842_frm4.ascx.cs" />

        <includes name="phw842_frm4.aspx.cs" />

        <includes name="phw842_frm5.ascx.cs" />

        <includes name="phw842_frm6.ascx.cs" />

        <includes name="phw842_frm7.ascx.cs" />

        <includes name="phw842_frm8.ascx.cs" />

        <includes name="phw842_Main1.ascx.cs" />

        <includes name="phw842_Main2.ascx.cs" />

        <includes name="phw842_Main3.ascx.cs" />

        <includes name="phw842_Main4.ascx.cs" />

      </sources>

      <resources>

        <includes name="phw842_frm0.aspx.resx" />

        <includes name="phw842_frm2.ascx.resx" />

        <includes name="phw842_frm4.ascx.resx" />

        <includes name="phw842_frm3.aspx.resx" />

        <includes name="phw842_frm7.ascx.resx" />

        <includes name="phw842_frm8.ascx.resx" />

        <includes name="phw842_frm1.ascx.resx" />

        <includes name="phw842_frm5.ascx.resx" />

        <includes name="phw842_frm6.ascx.resx" />

        <includes name="phw842_frm3.ascx.resx" />

        <includes name="PharosCorner.aspx.resx" />

      </resources>

      <references basedir="H:\BuildDepot\Pharos\DevelopmentVersion\Nantbuild\phw842\bin\">

        <includes name="System.dll" />

        <includes name="System.Drawing.dll" />

        <includes name="System.Data.dll" />

        <includes name="System.Web.dll" />

        <includes name="System.Xml.dll" />

        <includes name="phPersistentObjects.dll" />

        <includes name="phKernel.dll" />

        <includes name="phw842DB.dll" />

        <includes name="CustomGridControl.dll" />

        <includes name="CustomDisplayControl.dll" />

        <includes name="phLibrary.dll" />

        <includes name="DBITrace.NET.dll" />

      </references>

    </csc>

 

 

Bert-Jan Lappenschaar

[EMAIL PROTECTED]

 

Senior ontwikkelaar

DataBalk BV

 

tel:+31318410135

mobiel: +31651093956

 

 

 

Reply via email to