Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / Services / Reporting Services / November 2005

Tip: Looking for answers? Try searching our database.

Loading custom assemblies for RDLCs in Local mode

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
vijayann@gmail.com - 28 Nov 2005 18:51 GMT
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] - 29 Nov 2005 02:54 GMT
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?

Signature

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

> Hi,
>
[quoted text clipped - 12 lines]
>
> Thanks for any response.
vijayan - 29 Nov 2005 10:07 GMT
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] - 30 Nov 2005 02:06 GMT
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

Signature

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

> Thanks for your reply, and pointer to fuslogvw...
>
[quoted text clipped - 38 lines]
> Calling assembly : Microsoft.ReportViewer.Common, Version=8.0.0.0,
> Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.
Teo Lachev [MVP] - 30 Nov 2005 12:47 GMT
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.

Signature

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

>I have no explanation about why the appbase path is set to the .NET
>Framework path. Try posting your question to
[quoted text clipped - 42 lines]
>> Calling assembly : Microsoft.ReportViewer.Common, Version=8.0.0.0,
>> Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.
vijayan - 30 Nov 2005 20:01 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.