Solved

Help with resource files in WebParts project

Posted on 2011-03-10
9
412 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
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.

 

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

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.

Question has a verified solution.

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

I have just recently built a new SharePoint 2007 farm on a complete Windows 2008 R2 server platform and part of my standard build procedure is to implement a warm up routine, usually in the form of a script that is scheduled every morning to launch …
Microsoft SharePoint Foundation 2010 and Microsoft SharePoint Server 2010 do not offer the option to configure the location of the SharePoint diagnostic trace log files during installation.  This can, however, be configured through Central Administr…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
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…

773 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