Solved

Help with resource files in WebParts project

Posted on 2011-03-10
9
437 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 

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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Sharepoint 3.0 migration 4 94
Scan Files already in SharePoint 2010 on prem ? 5 26
SharePoint Destination SSIS 2 72
Exchange - trouble forwarding mail to Distro Group 4 48
When installing SharePoint 2010 RTM I came across a strange error, I was getting timeouts during the installation. I searched the web and found the best solution to be found here (http://social.msdn.microsoft.com/Forums/en-US/sharepoint2010genera…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
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…

739 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