|
| Inconsistency in Resource Files in Web Site and Web Application Projects |
 |
Wed, 13 Feb 2008 11:39:09 +000 |
When I add a resource file to the App_GlobalResources folder in a Web Site and
Web Application Project I get this difference in behaviour.
In a Web Application Project I get a resx file and a designer.cs file.
I get intellisense displayed for the localization strings, e.g., "Looks up
a localized string similar to Invalid login, please try again."
In a Web Site Project
I get just a resx file.
I get no intellisense (because there's no designer file).
Why is there a difference in behaviour? Is there a way of getting the same
behaviour for a Web Site Project.
Kevin
|
| Post Reply
|
| Re: Inconsistency in Resource Files in Web Site and Web Application Projects |
 |
Tue, 19 Feb 2008 06:02:27 +000 |
Hi Kevin,
It is by design that there is no .designer file in website project. Anyway, I
tried to reproduce this issue on my machine with the following steps:
1. Create an ASP.NET website project.
2. Add a new resource file (Resource1.resx) in the “App_GlobalResources”
folder.
3. Add “String1” and “String2” in the new added resource file.
4. Click the “Save All” button, and then open the .aspx.cs file.
5. After inputting “Resources”, the “Resource1” displays properly.
Then “String1” and “String2” display properly after selecting
“Resource1”.
6. I also try to add another new resource file (Resource2.resx) and the
intellisense still works very well.
My Visual Studio is 2005 Team Suite edition with SP1 applied. If you can create
web applicaton due to the “Visual Studio 2005 Web Application Projects”
addin, please remove it and install Visual Stuido 2005 SP1 instead. Otherwise,
please click the “Save All” button after modifying the resource file or
before you want to get intellisense in the code behind editor. I hope the above
information is helpful to you.
|
| Post Reply
|
| Re: Inconsistency in Resource Files in Web Site and Web Application Projects |
 |
Tue, 19 Feb 2008 12:07:26 +000 |
I am using VS 2005 Pro SP1. It's not the Resources.Resource1.String1 that I'm
referring to. It is the descriptive XML comment that tells you what's in the
Value column. E.g., suppose I have
Name Value
JobManagementPageDescription Create and manage print jobs
Then when I type Resources.WebResources.JobManagementPageDescription if I hover
the mouse over JobManagementPageDescription I get an intellisense comment -
"Looks up a localized resource similar to Create and Mange Print
Jobs."
In a Web Application Project, this is picked up from the XML comment header in
the designer.cs file. As a Web Site project does not have this then you don't
get the very helpful comment.
Anyway, I've switched back to a Web Application Project for this reason among
others.
|
| Post Reply
|
|
|
|
|
|
|
|
|
|