RE: [nant-dev] resources Exception

2004-12-13 Thread Gert Driesen
Hi Craig,

Can you verify whether you get the same exception using NAnt 0.85 RC1 ?

If you get the same exception, then please submit a bug report including a
small repro (meaning build file and small set of (re)sources).

Thanks !

Gert

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On 
 Behalf Of Craig Probus
 Sent: vrijdag 10 december 2004 18:57
 To: [EMAIL PROTECTED]
 Subject: [nant-dev] resources Exception
 
 C:\Solutions\MTM\Deployment\Scripts\Webnant 
 -buildfile:WebControls.Templates.build
 NAnt 0.85 (Build 0.85.1732.0; net-1.0.win32; nightly; 9/28/2004)
 Copyright (C) 2001-2004 Gerry Shaw
 http://nant.sourceforge.net
 
 Buildfile: 
 file:///C:/Solutions/MTM/Deployment/Scripts/Web/WebControls.Te
 mplates.build
 Target(s) specified: build
 
 
 build:
 
   [csc] Compiling 5 files to 
 'C:\Solutions\MTM\Web\bin\ProfitLine.MTM.Web.WebControls.Templ
ates.dll'.
 
 BUILD FAILED
 
 INTERNAL ERROR
 
 System.ArgumentOutOfRangeException: Length cannot be less than zero.
 Parameter name: length
at System.String.Substring(Int32 startIndex, Int32 length)
at System.String.Substring(Int32 startIndex)
at 
 NAnt.DotNet.Types.ResourceFileSet.GetManifestResourceName(Stri
 ng fileName) in C:\Documents and Settings\drieseng\Local 
 Settings\Temp\tmp33C.tmp\src\NAnt.DotNet\Types\ResourceFileSet
.cs:line 172
at 
 NAnt.DotNet.Tasks.CompilerBase.GetManifestResourceName(Resourc
 eFileSet resources, String resourceFile, String 
 dependentFile) in C:\Documents and Settings\drieseng\Local 
 Settings\Temp\tmp33C.tmp\src\NAnt.DotNet\Tasks\CompilerBase.cs
:line 679
at 
 NAnt.DotNet.Tasks.CompilerBase.GetManifestResourceName(Resourc
 eFileSet resources, String resourceFile) in C:\Documents and 
 Settings\drieseng\Local 
 Settings\Temp\tmp33C.tmp\src\NAnt.DotNet\Tasks\CompilerBase.cs
:line 776
at NAnt.DotNet.Tasks.CompilerBase.ExecuteTask() in 
 C:\Documents and Settings\drieseng\Local 
 Settings\Temp\tmp33C.tmp\src\NAnt.DotNet\Tasks\CompilerBase.cs
:line 508
at NAnt.Core.Task.Execute() in C:\Documents and 
 Settings\drieseng\Local 
 Settings\Temp\tmp33C.tmp\src\NAnt.Core\Task.cs:line 177
at NAnt.Core.Target.Execute() in C:\Documents and 
 Settings\drieseng\Local 
 Settings\Temp\tmp33C.tmp\src\NAnt.Core\Target.cs:line 249
at NAnt.Core.Project.Execute(String targetName, Boolean 
 forceDependencies) in C:\Documents and 
 Settings\drieseng\Local 
 Settings\Temp\tmp33C.tmp\src\NAnt.Core\Project.cs:line 876
at NAnt.Core.Project.Execute() in C:\Documents and 
 Settings\drieseng\Local 
 Settings\Temp\tmp33C.tmp\src\NAnt.Core\Project.cs:line 833
at NAnt.Core.Project.Run() in C:\Documents and 
 Settings\drieseng\Local 
 Settings\Temp\tmp33C.tmp\src\NAnt.Core\Project.cs:line 902
 
 Please send bug report to [EMAIL PROTECTED]
 
 Total time: 0.5 seconds.
 
 
 --
 -
 
 
 ?xml version=1.0?
 project name=ProfitLine.MTM.Web default=build
 property name=DllName 
 value=ProfitLine.MTM.Web.WebControls.Templates/
 property name=debug   value=true/
 
 target name=clean
 delete
 fileset
 include name=${MTM_WEB_BIN_DIR}\${DllName}.dll/
 include name=${MTM_WEB_BIN_DIR}\${DllName}.pdb/
 /fileset
 /delete
 /target
 
 target name=build dependency=clean
 csc target=library 
 output=${MTM_WEB_BIN_DIR}\${DllName}.dll debug=${debug}
 references
 include name=${MTM_WEB_BIN_DIR}\AdminManager.dll/
 include name=${MTM_WEB_BIN_DIR}\DataEntity.dll/
 include name=${MTM_WEB_BIN_DIR}\StateManager.dll /
 include name=${MTM_WEB_BIN_DIR}\UserProfiles.dll/
 include name=${MTM_WEB_BIN_DIR}\Web.dll/
 include name=${MTM_WEB_BIN_DIR}\MasterPages.dll/
 include 
 name=${MTM_WEB_BIN_DIR}\ProfitLine.MTM.Web.UserControls.dll/
 /references
 sources
 include 
 name=${WEB_CONTROLS_TEMPLATES_DIR}\TemplateCustomError.ascx.cs/
 include 
 name=${WEB_CONTROLS_TEMPLATES_DIR}\TemplateManualTask.ascx.cs/
 include 
 name=${WEB_CONTROLS_TEMPLATES_DIR}\TemplateMIM.ascx.cs/
 include 
 name=${WEB_CONTROLS_TEMPLATES_DIR}\TemplateMTM.ascx.cs/
 include 
 name=${WEB_CONTROLS_TEMPLATES_DIR}\TemplateSecurityAdministra
 tion.ascx.cs/
 /sources
 resources dynamicprefix=true prefix=MTMv30
 include name=${i18n_DIR}\LocalStrings.resx /
 /resources
 /csc
 /target
 /project
 
 
 ---
 SF email is sponsored by - The IT Product Guide
 Read honest  candid reviews on hundreds of IT Products from 
 real users.
 Discover which products truly live up to the hype. Start reading now. 
 

RE: [nant-dev] Resources

2002-08-22 Thread Mark Griffiths


You might want to take a look at some work [1] that JT Perry submitted to
the list in June (and from what I can tell was ignored).  These changes,
along with the resources element of the csc and vbc elements, should
make resource handling a little less cumbersome.

Mark

[1]
http://www.mail-archive.com/nant-developers%40lists.sourceforge.net/msg00311
.html

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED]]On Behalf Of
 Ian MacLean
 Sent: 22 August 2002 02:55
 To: Klemen Zagar
 Cc: [EMAIL PROTECTED]
 Subject: Re: [nant-dev] Resources


 Klemen,
 You've hit it right on the head. Its been the cumbersome way it is for a
 while now. What you've proposed is pretty much how it should be. It
 shouldn't be too hard to implement. If you want to take a stab at it go
 ahead. Otherwise I'll start on it. Its been irking me for a while
 now also.

 Ian

 Hello, everybody.
 
 Until recently, I've done my .NET development in MS Visual Studio .NET.
 These days, I am creating NAnt scripts for my solutions.
 Everything worked
 great except the resource files in GUI projects: whenever I started a GUI
 application, an exception would be thrown, claiming that a resource could
 not be loaded.
 
 I've researched the problem, and here's what I've discovered: GUI forms
 created by VS.NET load form's resources using a call
 
   System.Resources.ResourceManager resources =
 new System.Resources.ResourceManager(
   typeof(RQuantAboutDialog));
 
 This actually attempts to load a resource whose name is
 Fully.Qualified.Class.Name.resources from the assembly.
 
 One solution to the problem is to first compile the resources,
 one by one,
 
   resgen input=rqme/rqme.resx output=rqme/rqme.resources/
 
 and then pass them to C# compiler using
 
   csc ...
 ...
 arg
 value=/resource:rqme/rqme.resources,RQuant.rqme.rqme.resources/
 ...
   /csc
 
 (Note the RQuant.rqme in the resource identifier after the
 comma... this
 is because the namespace must also be included, as described above.)
 
 This approach is somewhat cumbersome, because all resource files
 have to be
 enumerated explicitly... twice.
 
 Ideally, the resources tag would accept additional parameters (the
 prefix), so that the above effect could have been achieved by
 NAnt XML like
 
   csc ...
 ...
 resources basedir=rqme prefix=RQuant.rqme.
   includes name=*.resx/
 /resources
 ...
   /csc
 
 Here, resources is a FileSet with an additional parameter (the prefix).
 Additionaly, the csc task would automatically invoke resgen to convert
 *.resx resources into *.resources.
 
 Are there any alternative suggestions? How hard would it be to
 implement the
 one proposed here?
 
 Cheers,
   Klemen.
 
 
 
 ---
 This sf.net email is sponsored by: OSDN - Tired of that same old
 cell phone?  Get a new here for FREE!
 https://www.inphonic.com/r.asp?r=sourceforge1refcode1=vs3390
 ___
 Nant-developers mailing list
 [EMAIL PROTECTED]
 https://lists.sourceforge.net/lists/listinfo/nant-developers
 
 
 
 


 --
 The use of COBOL cripples the mind; its teaching should,
 therefore, be regarded as a criminal offence. (Edsger Wybe Dijkstra)




 ---
 This sf.net email is sponsored by: OSDN - Tired of that same old
 cell phone?  Get a new here for FREE!
 https://www.inphonic.com/r.asp?r=sourceforge1refcode1=vs3390
 ___
 Nant-developers mailing list
 [EMAIL PROTECTED]
 https://lists.sourceforge.net/lists/listinfo/nant-developers




---
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1refcode1=vs3390
___
Nant-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-developers



Re: [nant-dev] Resources

2002-08-21 Thread Ian MacLean

Klemen,
You've hit it right on the head. Its been the cumbersome way it is for a 
while now. What you've proposed is pretty much how it should be. It 
shouldn't be too hard to implement. If you want to take a stab at it go 
ahead. Otherwise I'll start on it. Its been irking me for a while now also.

Ian

Hello, everybody.

Until recently, I've done my .NET development in MS Visual Studio .NET.
These days, I am creating NAnt scripts for my solutions. Everything worked
great except the resource files in GUI projects: whenever I started a GUI
application, an exception would be thrown, claiming that a resource could
not be loaded.

I've researched the problem, and here's what I've discovered: GUI forms
created by VS.NET load form's resources using a call

  System.Resources.ResourceManager resources =
new System.Resources.ResourceManager(
  typeof(RQuantAboutDialog));

This actually attempts to load a resource whose name is
Fully.Qualified.Class.Name.resources from the assembly.

One solution to the problem is to first compile the resources, one by one,

  resgen input=rqme/rqme.resx output=rqme/rqme.resources/

and then pass them to C# compiler using

  csc ...
...
arg value=/resource:rqme/rqme.resources,RQuant.rqme.rqme.resources/
...
  /csc

(Note the RQuant.rqme in the resource identifier after the comma... this
is because the namespace must also be included, as described above.)

This approach is somewhat cumbersome, because all resource files have to be
enumerated explicitly... twice.

Ideally, the resources tag would accept additional parameters (the
prefix), so that the above effect could have been achieved by NAnt XML like

  csc ...
...
resources basedir=rqme prefix=RQuant.rqme.
  includes name=*.resx/
/resources
...
  /csc

Here, resources is a FileSet with an additional parameter (the prefix).
Additionaly, the csc task would automatically invoke resgen to convert
*.resx resources into *.resources.

Are there any alternative suggestions? How hard would it be to implement the
one proposed here?

Cheers,
  Klemen.



---
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1refcode1=vs3390
___
Nant-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-developers


  



-- 
The use of COBOL cripples the mind; its teaching should, therefore, be regarded as a 
criminal offence. (Edsger Wybe Dijkstra)




---
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1refcode1=vs3390
___
Nant-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-developers