Solved

Help with resource files in WebParts project

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

Author Comment

by:LuisEstebanValencia
ID: 35132211
YOu cant move the resources folder to the feature, its just not possible.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

A question that is asked often, is how to generate sequential numbers in InfoPath Forms. The best way to achieve this is to use a SQL database, along with a stored procedure and a web service to connect Forms Services to the DB. The first thing t…
Last week I faced a strange issue recently, i have deployed SharePoint 2003 servers for one project and one of the requirements was to open SharePoint site from same server. when i was trying to open site from the same server i was getting authentic…
This video discusses moving either the default database or any database to a new volume.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

743 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now