Solved

Help with resource files in WebParts project

Posted on 2011-03-10
9
421 Views
Last Modified: 2012-05-11
1st. I created a mapped folder to the resources folder

2nd. I created 3 files

HomePage.resx.

HomePage.nl-be.resx

Homepage.fr-be.resx

Then in the code I used this

  ResourceManager resourceManager = new ResourceManager("Aurelium.WebParts.HomePage", GetType().Assembly);
                    string readMore= (string)resourceManager.GetObject("ReadMore");
                   
                    ReadMore.Text = readMore;

I created the key in all 3 files

But I got this exception.

System.Resources.MissingManifestResourceException was unhandled by user code
  Message=Could not find any resources appropriate for the specified culture or the neutral culture.  Make sure "Aurelium.WebParts.HomePage.resources" was correctly embedded or linked into assembly "App_Web_knowledgecentercontent1usercontrol.ascx.b3413f4b.otfkfm1n" at compile time, or that all the satellite assemblies required are loadable and fully signed.
  Source=mscorlib
  StackTrace:
       at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents)
       at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents)
       at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents)
       at System.Resources.ResourceManager.GetObject(String name, CultureInfo culture, Boolean wrapUnmanagedMemStream)
       at Aurelium.WebParts.KnowledgeCenterContent1.KnowledgeCenterContent1UserControl.LoadKnowledgeCenterContent1()
       at Aurelium.WebParts.KnowledgeCenterContent1.KnowledgeCenterContent1UserControl.Page_Load(Object sender, EventArgs e)
       at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
       at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
       at System.Web.UI.Control.OnLoad(EventArgs e)
       at System.Web.UI.Control.LoadRecursive()
       at System.Web.UI.Control.AddedControl(Control control, Int32 index)
       at Aurelium.WebParts.KnowledgeCenterContent1.KnowledgeCenterContent1.CreateChildControls()
       at System.Web.UI.Control.EnsureChildControls()
       at System.Web.UI.Control.PreRenderRecursiveInternal()
       at System.Web.UI.Control.PreRenderRecursiveInternal()
       at System.Web.UI.Control.PreRenderRecursiveInternal()
       at System.Web.UI.Control.PreRenderRecursiveInternal()
       at System.Web.UI.Control.PreRenderRecursiveInternal()
       at System.Web.UI.Control.PreRenderRecursiveInternal()
       at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
  InnerException:
0
Comment
Question by:LuisEstebanValencia
  • 5
  • 4
9 Comments
 
LVL 14

Expert Comment

by:GeorgeGergues
ID: 35095544
That is very interesting

[1] You are using a user control inside the webpart . Correct ?
[2] You have the .resx files on the same folder as the your user control ?


[3] The question I have it , where is your user control code (.cs or .vb) in relation to the 12 hive .
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE

can you give some more specifics.

[4] Do you Aurelium.WebParts controls trusted or on the GAC somewhere ?


Let me know

Best of luck.




0
 

Author Comment

by:LuisEstebanValencia
ID: 35096875
I am using sharepoint 2010, and I am using visual studio 2010

So the resources are on a mapped folder.
The webparts are trusted? I have no idea, but I think by default when you deploy the solution it addas automatically safe controls to the web.config? I think thats automatic in visual studio


ERRROR2.png
0
 
LVL 14

Expert Comment

by:GeorgeGergues
ID: 35096900
move the Resx folder under the feature folder.

Rebuild and redeploy ,
 that should do the trick,
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

Author Comment

by:LuisEstebanValencia
ID: 35132211
YOu cant move the resources folder to the feature, its just not possible.
0
 
LVL 14

Expert Comment

by:GeorgeGergues
ID: 35133928
what do you use to build your WSP file ?
0
 

Author Comment

by:LuisEstebanValencia
ID: 35138177
visual studio 2010, I just deploy it directly with right click on the project deploy
0
 
LVL 14

Expert Comment

by:GeorgeGergues
ID: 35138893
Go to
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\Features\Aurelium.Webparts Feature\

Copy the  resource folder there.

that might work.
0
 

Author Comment

by:LuisEstebanValencia
ID: 35150368
but I need to do that from visual studio so that the deployment be easy.  Probably when I go to production I would forget to do that, everything is simpler if can be packaged in a wsp file
0
 
LVL 14

Accepted Solution

by:
GeorgeGergues earned 500 total points
ID: 35150416
I understand ....
we can fix the pacakaging when we figure out the bug.

Did the location change fix the error. ?


If yes , I will let you know how to package it .

0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you create your solutions on SharePoint sooner or later you will come upon a request to set  permissions of the item depending on some of the item's meta-data - the author, people assigned as approvers, divisions, categories etc. The most natu…
The vision: A MegaMenu for a SharePoint portal home page The mission: Make it easy to maintain. Allow rich content and sub headers as well as standard links. Factor in frequent changes without involving developers or a lengthy Dev/Test/Prod rel…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question