Solved

Help with resource files in WebParts project

Posted on 2011-03-10
9
431 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Suggested Solutions

Work Over Net is a new and very powerful collaboration product. With its new easy interface it is becoming very competitive to other similar products like webex and office interactive. WON 2010 have the standard business tools needed for multi-offic…
In case you ever have to remove a faulty web part from a page , add the following to the end of the page url ?contents=1
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

713 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