Title: RE: [Nant-users] Resx files not getting embedded
 
-----Original Message-----
From: Nick Robinson [mailto:[EMAIL PROTECTED]]
Sent: 27 January 2003 17:04
To: Lorphelin, Yves
Subject: RE: [Nant-users] Resx files not getting embedded

Hi,
 
I have another problem now.  Here is my target for building:
 
 
<target name="Build">
<csc target="library" output="${output}" debug="${debug}" define="${define}" doc="${doc}">
    <arg value="${unsafe}" />
    <arg value="${checked}" />
<sources>
    <includes name="${project.source.path}**.cs" />
</sources>
<resources prefix="TestCases">
    <includes name="${project.source.path}TestCasesResources.resx"/>
</resources>
<references>
    <includes name="System.dll" />
    <includes name="System.Data.dll" />
    <includes name="System.Xml.dll" />
    <includes name="${reference.path}/nunit.framework.dll" />
    <includes name="${build.dir}/NANTIntegra.dll"/>
    <includes name="C:\WINNT\Microsoft.NET\Framework\v1.0.3705\Office.dll"/>
    <includes name="F:\Program Files\Microsoft Visual Studio .NET\Common7\IDE\PublicAssemblies\Extensibility.dll"/>
    <includes name="C:\WINNT\Microsoft.NET\Framework\v1.0.3705\EnvDTE.dll"/>
</references>
</csc>
</target>
 
I have a file called TestCasesResources.resx, which contains a number of different XML snippets i am using for my test cases.  I have a number of classes that need to use these resources.  If I compile using Dev Studio everything works and the test cases run.  If I run with NANT I get the error "Could not find any resources appropriate for the specified culture...".  The assembly is called TestCases, so I have used the prefix for the name space.  Here is some code that retirves the resources:
 
ResourceManager res = new ResourceManager("TestCases.TestCasesResources", Assembly.GetExecutingAssembly());
string resSolutionProject = (string)res.GetObject("SolutionProject");
Assertion.AssertNotNull("SolutionProject resource was null", resSolutionProject);
// Load the XML document
XmlDocument projectXML = new XmlDocument();
projectXML.LoadXml(resSolutionProject);
 
What am I doing wrong for NANT not to work.  If I name the resource file the same as one of my test fixture classes, such as my NANTProjectTestCases class (so I have named the resource file the same as this class, with .resx on the end), then that class gets access to the resources but none of the others do....grrrrrrr.....
 
Any help would be most appreciated...like I say, if I run NUnit GUI everything works, regardless.
 
Nick.
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Lorphelin, Yves
Sent: 09 January 2003 15:15
To: [EMAIL PROTECTED]
Subject: RE: [Nant-users] Resx files not getting embedded

hi Nicholas ,

The <resources >... </resources > fileset  takes care of the conversion between .resx & .resources fle

You should write it like this
<resources>
  <includes name="testResources.resx"/>
</resources>   

If there is no associated class testResources.cs , you should write it like this

<resources prefix="Your.namespace">
  <includes name="testResources.resx"/>
</resources>
Where "your.namespace" is the default namespace for  your project

Hope this help.
Yves



-----Original Message-----
From: Nicholas Robinson [mailto:[EMAIL PROTECTED]]
Sent: 09 January 2003 16:09
To: [EMAIL PROTECTED]
Subject: [Nant-users] Resx files not getting embedded


Hi,
I am trying to embed a resx resource during compilation, but when I try to access the resource I cannot find it (usnig the Resource Manager).  If I build the same project within DevStudio it works.  My NANT script section is below:

  <target name="Build">
    <resx input="testResources.resx"/>  
    <csc target="library" output="${output}" debug="${debug}" define="${define}" doc="${doc}">
      <arg value="${unsafe}" />
      <arg value="${checked}" />
      <sources>
        <includes name="${project.source.path}AssemblyInfo.cs" />
        <includes name="${project.source.path}ProjectReaderTestCases.cs" />
      </sources>
      <references>
        <includes name="System.dll" />
        <includes name="System.Data.dll" />
        <includes name="System.Xml.dll" />
        <includes name="${reference.path}/nunit.framework.dll" />       
      </references>             
      <resources>
        <includes name="testResources.resources"/>
      </resources>
    </csc>
  </target>
Can someone tell me what I am doing wrong? I am using the latest Stable Release, 7.9.0.
Nick.




With Yahoo! Mail you can get a bigger mailbox -- choose a size that fits your needs

<<attachment: winmail.dat>>

Reply via email to