Click here to Skip to main content
15,881,204 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
C#
st2 = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetCallingAssembly().Location);
 resources = new ComponentResourceManager(Type.GetType(st2 +"\\Culture\\"+cultureName+"\\Excel.resx"));
Posted
Updated 11-Sep-14 0:13am
v2
Comments
hypermellow 11-Sep-14 6:00am    
What line does the exception get raised on?
What is the value of System.Reflection.Assembly.GetCallingAssembly().Location ?
Gihan Liyanage 11-Sep-14 6:30am    
Friend, you need to check and tell where does the exception has raised,since people cant see your screen.

1 solution

Without running the code in your environment, we can't tell.
But...probably, it has to do with the Path.GetDirectoryName - since that returns the whole path up to but not including the last '\' character.
Since Type.GetType doesn't expect disk or folder specifications but just the namespace info that it probably where the problem is coming - use the debugger to isolate exactly what you are passing to what and see if it makes sense with the documentation. Chances are it doesn't.

But then, I'm not sure what the heck you are trying to do with that code anyway - it's not at all clear without the context it normally lives in!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900