473,770 Members | 1,806 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Trying to use nant to build and link resource files into final product

Here are my steps:

create resource files from resx files:

<echo message="CREATI NG RESOURCE FILES FROM RESGEN EN" />
<resgen todir="product\ resources_en" verbose="true">
<resources>
<include name="${AppName }\**.en.resx" />
<include name="${AppName }\Global.asax.r esx" />
</resources>
</resgen>

use AL to build a DLL that holds the *.en.resource and *.es.resource

<echo message="ALINKI NG en/GTPCardWeb.reso urces.dll" />
<al output="product/en/GTPCardWeb.reso urces.dll" target="lib">
<sources>
<include name="product/resources_en/*.resources" />
</sources>
</al>

here is the csc compiler build

<csc target="library " output="product \${AppName}.dll "
debug="${debug} ">
<sources>
<include name="${AppName }\**\*.cs" />
<include name="${AppName }\**\Global.asp x.cs" />
</sources>
<references>
<include name="product\G TPLIB.dll"/>
<include name="System.Da ta.OracleClient .dll"/>
<include name="product\I nfragistics.Web UI.Misc.v5.2.dl l"/>
<include name="product\I nfragistics.Web UI.Shared.v5.2. dll"/>
<include
name="product\I nfragistics.Web UI.UltraWebGrid .v5.2.dll"/>
<include
name="product\I nfragistics.Web UI.UltraWebNavi gator.v5.2.dll"/>
<include
name="product\I nfragistics.Web UI.UltraWebTab. v5.2.dll"/>
<include
name="product\I nfragistics.Web UI.WebDataInput .v5.2.dll"/>
<include
name="product\I nfragistics.Web UI.WebDateChoos er.v5.2.dll"/>
</references>
</resources -->
<resources dynamicprefix=" true">
<include name="GTPCard/**/*.resx" />
</resources>
</csc>

These nant target creates nice resource files inside the
${AppName}.dll. However when I run the App, I get this:

Could not find any resources appropriate for the specified culture (or
the neutral culture) in the given assembly. Make sure
"MyApp.ASPXPage .resources" was correctly embedded or linked into
assembly "MyApp". baseName: MyApp.ASPXPage locationInfo: <null>
resource file name: MyApp.ASPXPage. resources assembly: MyApp,
Version=1.0.230 0.17395, Culture=neutral , PublicKeyToken= null

The ONLY way I can get this to work is to take the
bin/en/MyApp.resource. dll and bin/es/MyApp.resource. dll generated from
the VS 2003 build and place them appropriately into my ant built
/MyApp/bin/en and /MyApp/bin/es directories and all of my problems go
away. My question.. Is there a way to generate these
bin/en/MyApp.resource. dll correctly such that IIS doesn't barf at
runtime? I attempted to build these with AL (see above) and I moved
them into the appropriate ant built directory.

Apr 20 '06 #1
1 3358
I figured it out. My nant build file is correct. My problem was in the
ResourceManager call of my aspx.cs file and the namespace for the
aspx.cs. I cleaned up the name space to reflect the directory the aspx
lives in, change the ResourceManager accordingly and it worked:

Apr 21 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2514
by: Nigel Currie | last post by:
Hi all, I'm having a problem with <nant> tasks to build sub-projects into an overall solution. I have the following directory structure: JobManagerSolution |_ | JobManager |_ JobManagerController
0
424
by: muesliflakes | last post by:
I wish to run Nant from my own application. I have included NAnt.Core and NAnt.DotNetTasks and calling out to NAnt as follows. StringWriter consoleOut = new StringWriter( ); Console.SetOut( consoleOut ); ConsoleDriver.Main( new string { "-buildfile:" + txtBuildFile.Text } );
3
2867
by: Me | last post by:
I have a simple solution file which I am looking to build using Nant However this is written in .net 2.0 and when I try building this .net 2.0, I get an error message saying "Microsoft Visual Studio.NET 2005 solutions are not supported." Does nant not support building .net projects? Many thanks
2
3017
by: Brett Romero | last post by:
I am compiling a winform app using nant. I first compile via VS.NET, which generates *.resource files in obj\debug. Then I use the <resources> tag in the Nant script to complete a build via Nant. I did try the Nant build by accessing the *.resx file instead. The app throws this error when I start it: Could not find any resources appropriate for the specified culture or the neutral culture. Make sure...
0
1191
by: Thomas Klein | last post by:
Hello, I want to build executable files (command line) with NANT. For example I have a source file X.cs in the namespace com.mycompany.examples. The class X inherits from a class Y which is located in the package com.mycompany.examples.tech. When I try to build a executable, I get the following error message: build:
0
1268
by: Brett Romero | last post by:
I can build a winexe using Nant without problems. If I add a Resources.resx file with images in it and reference those image on a form, I can't build correctly. The build success but the program always crashes with an error similar to: Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "Test.Properties.Resources.resources" was correctly embedded or linked into assembly "TestWinForm" at...
1
1710
by: Spam Catcher | last post by:
Hello Everyone, I just started using nant in conjunction with cruisecontrol.net. The <solutiontag has been great in helping us compile VS.NET 2003 projects without need to write a nant build file. My project compiles stuff into a directory like: C:\DEV_Machine\Build_Directory <-Empty C:\DEV_Machine\Build_Directory\Project_1 <-Project 1 Bin
0
2120
by: james.mcdonagh | last post by:
Hi I am a newbie using nAnt for .net 2.0. As such I have not come across this bug before, and I would be happy of any help that you may be able to provide. In order to help I have included the nant file which is causing the problem, the object code that is not being built and the error message which is being produced. The weird thing is that VS.net builds without a problem. And the intellisense within the object WorkQueue knows that...
1
6181
by: jamesmcdonagh | last post by:
Hi newbie using nAnt for .net 2.0. I would be happy of any help that you may be able to provide. The weird thing is that VS.net builds without a problem. And the intellisense within the object WorkQueue knows that Master is referring to the PanelManager reference. nant file ------------------------------------------------------------------------------------------------------------------- <?xml version="1.0" encoding="utf-8"?>...
0
9617
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10254
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10099
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10036
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9904
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8929
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5481
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3607
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2849
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.