Showing posts with label custom. Show all posts
Showing posts with label custom. Show all posts

Monday, March 12, 2012

Localisation using custom assemblies

Hi,
I have created an assembly A that loads a resource assembly. The
resource assembly has other satellite assemblies (en-US, pt-BR, etc).
The aseembly A exposes a static method GetString() to access GetString
of a ResourceManager which loads those resource assemblies.
I have tested this code in a Win Forms App and it appears to work
fine, i.e. it loads my portugese resources, english resource as I make
it to.
When they are placed in the ReportServer\bin folder, only the neutral
resources are loaded and displayed.
I have also tried to include all of the dlls including the satellite
resources in the FullTrust code group and it still displays the same
symptoms.
Can anyone tell me why or how to fix it?
Please help,
Siew Fai.Hi Siew,
Welcome to using MSDN Managed Newsgroup!
You may refer the article below to use a Custom Assembly in Reporting
Services
Writing Custom Code in SQL Server Reporting Services
http://blogs.sqlxml.org/bryantlikes/articles/824.aspx
By default, report code has "ExecutionOnly" permissions only and therefore
it fails. You need to get familiar with .NET Code Access Security (CAS) to
setup the security policy files correctly for the report server and assert
security permissions accordingly.
You may also check the MSDN documentation of Assembly.Load and scroll down
to the section with the title Requirements / .NET Framework Security:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfSystemReflectionAssemblyClassLoadTopic1.asp
Thank you for your patience and cooperation. If you have any questions or
concerns, don't hesitate to let me know. We are always here to be of
assistance!
Sincerely yours,
Michael Cheng
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=====================================================
This posting is provided "AS IS" with no warranties, and confers no rights.|||Thanks Michael,
I have finally got my the debuglocal version working, and it seems that
you have pointed me to the right track.
Really appreciate it.
Siew Fai|||Hi Siew,
You are welcome!
If you have any questions or concerns next time, don't hesitate to let me
know. We are always here to be of assistance!
Sincerely yours,
Michael Cheng
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=====================================================This posting is provided "AS IS" with no warranties, and confers no rights.

Localisation using custom assemblies

Hi,
I am still having some problems with Localisation assembly. It is to
do with CAS.
I have granted FullTrust to all the possible resource files in the
server config, and they work fine on the production server when it is
in the MyComputer Zone (http://localhost/reports).
When I access the report from client pcs
(http://reportserverbox/reports), only the neutral resources load.
My resources are in an assembly with "AllowPartiallyTrustedCallers"
attribute and it is dynamically loaded into ResourceManager by calling
Assembly.Load(basename, asseebly) from the extension custom assembly.
Obviously it has fileio access to neutral resources, the question is,
how can I ensure it to have access to the (unknown number of) Satellite
assemblies as well?
BTW, I have also tried adding a IMembershipCondition Internet Zone
line, it kinda worked for a while, but once the report server is
restarted, a "Unable to communicate to Report Server" error is
displayed and I have to remove the Internet Zone condition line.
Please help!!!
Siew FaiHi Siew,
I found Bryant Likes has a wonderful article describing how to use a Custom
Assembly in Reporting Services and you are strongly recommanded to have a
look at it.
Writing Custom Code in SQL Server Reporting Services
http://blogs.sqlxml.org/bryantlikes/articles/824.aspx
Sincerely yours,
Michael Cheng
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=====================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Localisation using custom assemblies

Hi,
Further to my post on May 31 on the same subject, we are still facing a
permissions problem with loading satellite resource assemblies from a
custom assembly.
We have done all that is recommended by the Bryant rs web site, and
still unable to proceed.
To reiterate the problem:
We need to enable label translation for our clients through the use of
.net resource assemblies; the resource assemblies must remain separate.
We developed a custom assembly so that in the report it is possible to
call a method with a culture name and resource id, and the
corresponding resource is to be returned in the culture specified.
We have tested that in a local pc scenario, it works perfectly. It
does not work when it is executed remotely - only the neutral
resources are returned.
We have made the appropriate permissions assertion and code group
declaration, but is unable to proceed further. Any help will be very
much appreciated.
Michael Cheng: I have a test case, if you don't mind I can forward the
test case in a zip file to your email address...
Desperate,
Siew FaiHello Siew,
To understand the issue better, I'd like to know how you execute it
remotely. Will you describe it in more details? What is the exact error
message you encounter?
Best Regards,
Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=====================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
| From: "Siew Fai" <siewfai.hoy@.gmail.com>
| Newsgroups: microsoft.public.sqlserver.reportingsvcs
| Subject: Localisation using custom assemblies
| Date: 14 Aug 2005 19:22:27 -0700
| Organization: http://groups.google.com
| Lines: 31
| Message-ID: <1124072547.541100.236230@.g47g2000cwa.googlegroups.com>
| NNTP-Posting-Host: 203.222.174.236
| Mime-Version: 1.0
| Content-Type: text/plain; charset="iso-8859-1"
| X-Trace: posting.google.com 1124072553 17754 127.0.0.1 (15 Aug 2005
02:22:33 GMT)
| X-Complaints-To: groups-abuse@.google.com
| NNTP-Posting-Date: Mon, 15 Aug 2005 02:22:33 +0000 (UTC)
| User-Agent: G2/0.2
| Complaints-To: groups-abuse@.google.com
| Injection-Info: g47g2000cwa.googlegroups.com;
posting-host=203.222.174.236;
| posting-account=W-T95Q0AAABWrZAGzmtXCMOc3JBrVGnv
| Path:
TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-onli
ne.de!news.glorb.com!postnews.google.com!g47g2000cwa.googlegroups.com!not-fo
r-mail
| Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.sqlserver.reportingsvcs:50341
| X-Tomcat-NG: microsoft.public.sqlserver.reportingsvcs
|
| Hi,
|
| Further to my post on May 31 on the same subject, we are still facing a
| permissions problem with loading satellite resource assemblies from a
| custom assembly.
|
| We have done all that is recommended by the Bryant rs web site, and
| still unable to proceed.
|
| To reiterate the problem:
| We need to enable label translation for our clients through the use of
| .net resource assemblies; the resource assemblies must remain separate.
| We developed a custom assembly so that in the report it is possible to
| call a method with a culture name and resource id, and the
| corresponding resource is to be returned in the culture specified.
|
| We have tested that in a local pc scenario, it works perfectly. It
| does not work when it is executed remotely - only the neutral
| resources are returned.
|
| We have made the appropriate permissions assertion and code group
| declaration, but is unable to proceed further. Any help will be very
| much appreciated.
|
| Michael Cheng: I have a test case, if you don't mind I can forward the
| test case in a zip file to your email address...
|
|
| Desperate,
| Siew Fai
|
||||Of course, I couldn't send because your email address is not available.
Siew Fai.|||Hi,
Thanks for the prompt reply.
I guess I used the term a little bit too loosely. Suppose there is a
box, let's name it "devsql01" that has all the reporting services
component installed (designer, manager and server). The custom
assembly and the resources are installed in the server bin folder and
the server policy file configured.
I have a client pc that requested the a report either via the url or
the webservice, or even the report manager that will use the services
of the custom assembly, which is to display label in the specified
culture. In this case, only the neutral resources are displayed, this
is incorrect.
If I do the same on the "devsql01" box itself, the correct resources
are displayed. This, I believe, is executing in the "MyComputer" zone
isn't it?
I do have a zip file containing all the source files with testing
instructions (no binaries) I can forward to illustrate the problem
clearly, if you would just send me an email, I can forward that on.
Please help,
Siew Fai.|||Hello Siew,
I have reproduced the issue on my side. If I log on as a domain user
without local admin right on report server, I recevied the following error:
The permissions granted to user 'domain\username' are insufficient for
performing this operation. (rsAccessDenied)
If I added the domain\username to the local admin groups on report server
machine, the issue went away.
I think this is expected behavior because for Report Manager it uses
"impersonate=true" configuration in web.config file. Any client users try
to access a report, report manager impersonte the identity of this user
when performing operation such as report execution. If the user does not
have the proper permission on report server, the permission exception will
be thrown.
If you do not want this behavior, you may consider use impersontion inside
the custom assembly so that it can execute as a identity with local admin
rights. I have included the following article for your reference
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfSystemSecurityPrincipalWindowsIdentityClassImpersonateTopic2.asp
Best Regards,
Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=====================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
| From: "Siew Fai" <siewfai.hoy@.gmail.com>
| Newsgroups: microsoft.public.sqlserver.reportingsvcs
| Subject: Re: Localisation using custom assemblies
| Date: 15 Aug 2005 03:14:05 -0700
| Organization: http://groups.google.com
| Lines: 28
| Message-ID: <1124100845.207984.265700@.g43g2000cwa.googlegroups.com>
| References: <1124072547.541100.236230@.g47g2000cwa.googlegroups.com>
| <262SSYXoFHA.3120@.TK2MSFTNGXA01.phx.gbl>
| NNTP-Posting-Host: 203.166.246.91
| Mime-Version: 1.0
| Content-Type: text/plain; charset="iso-8859-1"
| X-Trace: posting.google.com 1124100850 30123 127.0.0.1 (15 Aug 2005
10:14:10 GMT)
| X-Complaints-To: groups-abuse@.google.com
| NNTP-Posting-Date: Mon, 15 Aug 2005 10:14:10 +0000 (UTC)
| In-Reply-To: <262SSYXoFHA.3120@.TK2MSFTNGXA01.phx.gbl>
| User-Agent: G2/0.2
| Complaints-To: groups-abuse@.google.com
| Injection-Info: g43g2000cwa.googlegroups.com; posting-host=203.166.246.91;
| posting-account=W-T95Q0AAABWrZAGzmtXCMOc3JBrVGnv
| Path:
TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-onli
ne.de!border2.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting