Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Loading custom assemblies for RDLCs in Local mode

0 views
Skip to first unread message

vija...@gmail.com

unread,
Nov 28, 2005, 1:51:48 PM11/28/05
to
Hi,

I'm trying to reference a custom assembly from an RDLC in a web
application and, eventually, managed to get it to work.

It required signing the assembly and deploying it to the GAC before the
ReportViewer control could find and load the assembly, with
ExecuteReportInCurrentAppDomain() and
AddTrustedCodeModuleInCurrentAppDomain() being called on the
LocalReport for it to render successfully.

Is there no way to get the RDLC to find and load the .dll already in
the Bin directory, without requiring each new version to be signed and
deployed to the GAC?

Thanks for any response.

Teo Lachev [MVP]

unread,
Nov 28, 2005, 9:54:18 PM11/28/05
to
Your assembly must be signed because it is called by the Report Viewer
controls which are strong-named. A strong-named assembly cannot call a
weakly-named assembly. If you want this to work, you need to take out the
Report Viewer assemblies from GAC and deploy them in the application bin
folder. This is probably something you would like to avoid because you need
to repeat this procedure on the user machine as well since .NET will look
into GAC first.

What I find strange is why .NET cannot bind to your private assembly in the
app bin folder. Have you tried Fuslogvw to get more insight into the binding
issue?

--
HTH,
----------------------------------------------
Teo Lachev, MVP, MCSD, MCT
"Microsoft Reporting Services in Action"
"Applied Microsoft Analysis Services 2005"
Home page and blog: http://www.prologika.com/
----------------------------------------------
<vija...@gmail.com> wrote in message
news:1133203908....@g43g2000cwa.googlegroups.com...

vijayan

unread,
Nov 29, 2005, 5:07:34 AM11/29/05
to
Thanks for your reply, and pointer to fuslogvw...

The following were the differences in the pre-bind state information,
as a result of which the assembly was loaded successfully by the web
application from Bin/, but not by the ReportViewer:


[Web application loading of assembly]

The operation was successful.
Bind result: hr = 0x0. The operation completed successfully.

=== Pre-bind state information ===
LOG: DisplayName = DataLib, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=995882a1f6986c17 (Fully-specified)
LOG: Appbase = file:///C:/projects/Test/TestWebSite/
LOG: Initial PrivatePath = C:\projects\Test\TestWebSite\bin
LOG: Dynamic Base =
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\testwebsite\12ac5c57
LOG: Cache Base =
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\testwebsite\12ac5c57
LOG: AppName = ecc6c861
Calling assembly : System.Web, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a.

[ReportViewer loading of assembly]

The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file
specified.

=== Pre-bind state information ===
LOG: DisplayName = DataLib, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=995882a1f6986c17 (Fully-specified)
LOG: Appbase = file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = NULL
Calling assembly : Microsoft.ReportViewer.Common, Version=8.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.

Teo Lachev [MVP]

unread,
Nov 29, 2005, 9:06:55 PM11/29/05
to
I have no explanation about why the appbase path is set to the .NET
Framework path. Try posting your question to
http://forums.microsoft.com/msdn/showforum.aspx?forumid=75&siteid=1

--
HTH,
----------------------------------------------
Teo Lachev, MVP, MCSD, MCT
"Microsoft Reporting Services in Action"
"Applied Microsoft Analysis Services 2005"
Home page and blog: http://www.prologika.com/
----------------------------------------------

"vijayan" <vija...@gmail.com> wrote in message
news:1133258854.8...@g49g2000cwa.googlegroups.com...

Teo Lachev [MVP]

unread,
Nov 30, 2005, 7:47:28 AM11/30/05
to
I was able to obtain more info regarding this issue. Because of a bug in the
RTM version, copying custom assemblies to the web app bin folder will not
work. This bug will be fixed in a service pack. Currently, for web, you do
have to copy custom assemblies to the GAC, unfortunately.

In the case of WinForms apps, custom assemblies can be in the same directory
as the application's .EXE file; no need to copy to GAC.

--
HTH,
----------------------------------------------
Teo Lachev, MVP, MCSD, MCT
"Microsoft Reporting Services in Action"
"Applied Microsoft Analysis Services 2005"
Home page and blog: http://www.prologika.com/
----------------------------------------------

"Teo Lachev [MVP]" <teo.l...@nospam.prologika.com> wrote in message
news:%23KwW6KV...@TK2MSFTNGP09.phx.gbl...

vijayan

unread,
Nov 30, 2005, 3:01:10 PM11/30/05
to
Thanks for your help, Teo.

I received similar confirmation from the MS forum:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=151829&SiteID=1


/vijayan

0 new messages