I've created one project for report localization, which consists one class file and three .resx files. In class file, I wrote code which find appropriate .resx file, depending on culture, and read value for given key.
After that, i build up project, copy the .dll into "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies" and change RSPreviewPolicy.config, where I've added one new PermissionSet for Report localization and one CodeGroup tag giving Permission to .dll.
Next step I did was creating report, referencing .dll and write one expression to test localization.
I got following error:
"Failed to load expression host assembly. Details: Could not load file or assembly
I'm obviously missing something, but I can't figure out what?
Does somebody has idea of what to do?
Best Answer
I've found the answer. Problem were permissions for viewing report in Visual Studio Preview mode.
First of all, I was putting dll (with localization class) into next location:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies.
After that, I needed to change
RSPreviewPolicy.config
file, that exists in same folder location, to apply some security permissions.In question, I mentioned that I've added one PermisionSet, but now I am sure there is no need for that.
I've just changed two CodeGroup section, which have
Execution
permission level, to haveFullTrust
permission level, like this:Regarding your version of Visual Studio, you must choose appropriate folder path: