Showing posts with label assembly. Show all posts
Showing posts with label assembly. Show all posts

Thursday, March 22, 2012

Accessing Custom Assemblies

We are building a report via Business Intelligent Studio. We have deployed the custom assembly dll to two folders:

1. Microsoft Sql Server\MMSQL.3\Reporting Services\Report Server\bin

2. Microsoft Visual Studio 8\Common\IDE\private assemblies.

This dll is an instance dll.

When we open the report properties/reference tab, we can find and link to the dll. Which one of the above locations is the correct one? (We have #2).

We created the class and instance entry.

Next, we added a textbox to the report layout. When we try to use the =Code keyword we get an unrecognized identifier error.

Can anyone shed any light on why this is happening. We've spent considerable time trying to find any info on this with no luck.

Any help is appreciated

Information about using custom assemblies with reports can be found here:

http://msdn2.microsoft.com/en-us/library/ms153561.aspx

For me, to use the assembly in BIDS the path is \Visual Studio 8\Common7\IDE\PrivateAssemblies

Note "Common7" and no spaces in "PrivateAssemblies".

Tuesday, March 20, 2012

Accessing .Net 2.0 custom assembly in report to be deployed on SSRS 2000 SP2

Hi ,
I am using SQL reporting services 2000 + SP2. In one of my report I am
using custom .Net 1.1 assembly. I have given the reference for the
same in the report.
The report gets deployed without any issues.
Recently we had to upgrade this custom assembly to .Net 2.0. Now when
I try to deploy this report on SSRS 2000 it gives me error "Error
while loading code module:<my custom assembly complete name> " and
"Details: The format of the file <my custom assembly name>is invalid."
I have both .Net 1.1 and .Net 2.0 frameworks on my reporting server.
If I try to give reference to this .Net 2.0 binary again in the report
through IDE (Microsoft Visual Studio .NET 2003 IDE) it gives me error
"<my custom assembly name> does not contain an assembly".
How can I use my .Net 2.0 custom assembly in my SSRS 2000 + SP2
report. I have to use SSRS2000 SP2 as we cannot remove the support of
SSRS2000 SP2 for our reports.
Custom assembly been used is using various .Net 2.0 provided classes
now so it has to be in .Net 2.0.
Can I somehow tell the ASP.Net webapplication through various config
file that while using my custom binary load it in .Net 2.0 Framework?
I tried giving binding redirect but it did not work in the
Reprotserver config file . how can i specify the .Net framework
version in those entries?
Everything works fine in SSRS 2005 as the reporting service is also
in .Net 2.0
Regards,
ManojHi, I have the same issue. Have you got it fixed? How?
Could someone from MSFT give us an answer?
Thanks,
Lianghong
"Manoj" wrote:
> Hi ,
> I am using SQL reporting services 2000 + SP2. In one of my report I am
> using custom .Net 1.1 assembly. I have given the reference for the
> same in the report.
> The report gets deployed without any issues.
> Recently we had to upgrade this custom assembly to .Net 2.0. Now when
> I try to deploy this report on SSRS 2000 it gives me error "Error
> while loading code module:<my custom assembly complete name> " and
> "Details: The format of the file <my custom assembly name>is invalid."
> I have both .Net 1.1 and .Net 2.0 frameworks on my reporting server.
> If I try to give reference to this .Net 2.0 binary again in the report
> through IDE (Microsoft Visual Studio .NET 2003 IDE) it gives me error
> "<my custom assembly name> does not contain an assembly".
> How can I use my .Net 2.0 custom assembly in my SSRS 2000 + SP2
> report. I have to use SSRS2000 SP2 as we cannot remove the support of
> SSRS2000 SP2 for our reports.
> Custom assembly been used is using various .Net 2.0 provided classes
> now so it has to be in .Net 2.0.
> Can I somehow tell the ASP.Net webapplication through various config
> file that while using my custom binary load it in .Net 2.0 Framework?
> I tried giving binding redirect but it did not work in the
> Reprotserver config file . how can i specify the .Net framework
> version in those entries?
>
> Everything works fine in SSRS 2005 as the reporting service is also
> in .Net 2.0
> Regards,
> Manoj
>|||dotNet 2.0 uses a different framework - have you installed the dotnet 2.0
framework on your server?
"Lianghong" <Lianghong@.discussions.microsoft.com> wrote in message
news:7423185E-C8BA-4D1E-BB04-6BF78AD4DCAB@.microsoft.com...
> Hi, I have the same issue. Have you got it fixed? How?
> Could someone from MSFT give us an answer?
> Thanks,
> Lianghong
> "Manoj" wrote:
>> Hi ,
>> I am using SQL reporting services 2000 + SP2. In one of my report I am
>> using custom .Net 1.1 assembly. I have given the reference for the
>> same in the report.
>> The report gets deployed without any issues.
>> Recently we had to upgrade this custom assembly to .Net 2.0. Now when
>> I try to deploy this report on SSRS 2000 it gives me error "Error
>> while loading code module:<my custom assembly complete name> " and
>> "Details: The format of the file <my custom assembly name>is invalid."
>> I have both .Net 1.1 and .Net 2.0 frameworks on my reporting server.
>> If I try to give reference to this .Net 2.0 binary again in the report
>> through IDE (Microsoft Visual Studio .NET 2003 IDE) it gives me error
>> "<my custom assembly name> does not contain an assembly".
>> How can I use my .Net 2.0 custom assembly in my SSRS 2000 + SP2
>> report. I have to use SSRS2000 SP2 as we cannot remove the support of
>> SSRS2000 SP2 for our reports.
>> Custom assembly been used is using various .Net 2.0 provided classes
>> now so it has to be in .Net 2.0.
>> Can I somehow tell the ASP.Net webapplication through various config
>> file that while using my custom binary load it in .Net 2.0 Framework?
>> I tried giving binding redirect but it did not work in the
>> Reprotserver config file . how can i specify the .Net framework
>> version in those entries?
>>
>> Everything works fine in SSRS 2005 as the reporting service is also
>> in .Net 2.0
>> Regards,
>> Manoj
>>|||Yes. The .Net framework 2.0 is installed on the server.
"Bob" wrote:
> dotNet 2.0 uses a different framework - have you installed the dotnet 2.0
> framework on your server?
> "Lianghong" <Lianghong@.discussions.microsoft.com> wrote in message
> news:7423185E-C8BA-4D1E-BB04-6BF78AD4DCAB@.microsoft.com...
> > Hi, I have the same issue. Have you got it fixed? How?
> > Could someone from MSFT give us an answer?
> >
> > Thanks,
> > Lianghong
> >
> > "Manoj" wrote:
> >
> >> Hi ,
> >>
> >> I am using SQL reporting services 2000 + SP2. In one of my report I am
> >> using custom .Net 1.1 assembly. I have given the reference for the
> >> same in the report.
> >>
> >> The report gets deployed without any issues.
> >>
> >> Recently we had to upgrade this custom assembly to .Net 2.0. Now when
> >> I try to deploy this report on SSRS 2000 it gives me error "Error
> >> while loading code module:<my custom assembly complete name> " and
> >> "Details: The format of the file <my custom assembly name>is invalid."
> >>
> >> I have both .Net 1.1 and .Net 2.0 frameworks on my reporting server.
> >>
> >> If I try to give reference to this .Net 2.0 binary again in the report
> >> through IDE (Microsoft Visual Studio .NET 2003 IDE) it gives me error
> >> "<my custom assembly name> does not contain an assembly".
> >>
> >> How can I use my .Net 2.0 custom assembly in my SSRS 2000 + SP2
> >> report. I have to use SSRS2000 SP2 as we cannot remove the support of
> >> SSRS2000 SP2 for our reports.
> >>
> >> Custom assembly been used is using various .Net 2.0 provided classes
> >> now so it has to be in .Net 2.0.
> >> Can I somehow tell the ASP.Net webapplication through various config
> >> file that while using my custom binary load it in .Net 2.0 Framework?
> >> I tried giving binding redirect but it did not work in the
> >> Reprotserver config file . how can i specify the .Net framework
> >> version in those entries?
> >>
> >>
> >> Everything works fine in SSRS 2005 as the reporting service is also
> >> in .Net 2.0
> >>
> >> Regards,
> >> Manoj
> >>
> >>
>
>

Sunday, March 11, 2012

Access to the database file is not allowed.

I'm connecting to an Sql Compact database (3.1) from a C# assembly exposed via COM and called from inside a winsock LSP. The database is only used once on instantiation of the class, which happens in the first call to WSPStartup.

The issue I'm having is that under Vista and when running inside IE7 I get the error in the title. However there is no problems with IE7 under windows XP, or with Firefox and MSN Messenger under XP or Vista!

When selecting to run IE as administrator, the problem dissapears, however when using the LogonUser API to impersonate an administrator it doesnt.

This would seem like a permissions issue, strange though that Firefox under vista has no problems.. Also, the following code throws no SecurityException under either browser, indicating the code is running with full trust.

new PermissionSet(PermissionState.Unrestricted).Demand();

Any input would be a huge help, I've been banging my head against this all day..
I can now confirm this same behaviour on VS08 Beta 2 and SqlCe 3.5

Any ideas? Anybody point me in the direction of a better place to ask as this seems more like something specific to IE7 and Vista than SqlCe as such?

Many thanks
|||To answer my own question, by default in Vista, IE runs in protected mode and is a "low integrity" process, it has even less priveleges than the logged on user, including a logged on but not elevated administrator.

Since my .sdf file was a medium integrity resource... Access Denied!

For reference, further details here.

Access to the database file is not allowed.

I'm connecting to an Sql Compact database (3.1) from a C# assembly exposed via COM and called from inside a winsock LSP. The database is only used once on instantiation of the class, which happens in the first call to WSPStartup.

The issue I'm having is that under Vista and when running inside IE7 I get the error in the title. However there is no problems with IE7 under windows XP, or with Firefox and MSN Messenger under XP or Vista!

When selecting to run IE as administrator, the problem dissapears, however when using the LogonUser API to impersonate an administrator it doesnt.

This would seem like a permissions issue, strange though that Firefox under vista has no problems.. Also, the following code throws no SecurityException under either browser, indicating the code is running with full trust.

new PermissionSet(PermissionState.Unrestricted).Demand();

Any input would be a huge help, I've been banging my head against this all day..
I can now confirm this same behaviour on VS08 Beta 2 and SqlCe 3.5

Any ideas? Anybody point me in the direction of a better place to ask as this seems more like something specific to IE7 and Vista than SqlCe as such?

Many thanks
|||To answer my own question, by default in Vista, IE runs in protected mode and is a "low integrity" process, it has even less priveleges than the logged on user, including a logged on but not elevated administrator.

Since my .sdf file was a medium integrity resource... Access Denied!

For reference, further details here.

Saturday, February 25, 2012

Access shared data source inside custom assembly

I have a database connection string hard-coded in a SQL Server 2005 Reporting Services custom assembly. Since the connection string is environment-specific (dev/prod), I would like to read the connections string from a settings file, like is typically done for web.config. Using the shared data source is also a good option.

How do I accomplish this?

I looked into trying to use DataSourceReference(), but that does not seem to be allowed inside of a custom assembly. Thank you.

Only private data sources can be expression-based. You can think of the Report Server as a web application since it runs under IIS. Therefore, you can put your config settings in the C:\Program Files\Microsoft SQL Server\MSSQL.3\Reporting Services\ReportServer\web.config just like you would do with a regular ASP.NET app. Assuming you've deployed your report to the report catalog, you can read these settings at runtime . Additional considerations:

1. This technique is not supported.

2. Since there is no HttpContext in in the VS.NET Report Designer, you need to check for this condition and default your settings so you report works in design mode. I have a report in this download that demostrates how you can do this.

Access shared data source inside custom assembly

I have a database connection string hard-coded in a SQL Server 2005 Reporting Services custom assembly. Since the connection string is environment-specific (dev/prod), I would like to read the connections string from a settings file, like is typically done for web.config. Using the shared data source is also a good option.

How do I accomplish this?

I looked into trying to use DataSourceReference(), but that does not seem to be allowed inside of a custom assembly. Thank you.

Check Jason's blog here

http://weblogs.asp.net/jgaylord/archive/2005/05/12/406639.aspx

HTH
Regards

|||

Thank you. I read that blog, but it just seems to mention connection strings in general. The issue I am facing is that the Reporting Services assembly does not seem to allow me to access web.config, even though there is a web.config associated with RS. When I try to write "Imports System.Web.Configuration," VS2005 says it is not available and that the WebConfigurationManager is not available.

|||

Ok, simply add the System.Configurations.Dll as a reference in your project.

Let me know if you need further help.

Regards

Monday, February 13, 2012

Access is denied exception when loading an assembly from custom data processing extension

Hello,
I have been banging my head against this for the better part of today.
Here's the scenario. I have a custom data processing extension which
tries to make calls into another .NET assembly. As soon as this second
assembly is loaded, an "Access is denied: name_of_the_assembly"
System.Exception is thrown. I can't even catch this error as it seems
to occur on the assembly load and not on the first function call. Both
my data processing extension and second assembly have strong names and
are signed with the same key.
The rssvrpolicy.config is setup to allow FullTrust to my data
processing extension and second assembly. I have tried both URL
Membership Condtion as well as StrongName. Note that my custom data
processing extension works just fine if it doesn't call the second
assembly. Rolling everything back into a single assembly is not really
an option though.
OS: Windows Server 2003
Reporting Services SP1
IIS AppDomain Identity: NetworkService
Any ideas? Help please.
~JeffOk, I'm an idiot. It turns out that my data processing extension was
NOT signed but my second assembly was meaning that I had an untrusted
caller trying to call a trusted assembly and bomb! I went ahead and
signed everything and gave the proper StrongName membership in the
policy config and I'm good now.
I'm glad it turned out to be my problem because I couldn't figure out
for the life of me what I was doing wrong in regards to RS.
Hope this helps somebody else.
~Jeff