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

Wednesday, March 7, 2012

Problems with Custom Delivery Extension

I am working on putting together a custom delivery extension (fax delivery)
based on the built-in File Share delivery extension.
Most of the functionality I need already exists in the File Share delivery
extension so I used the Lutz Roeder's .NET Reflector to disassemble the
ReportingServicesFileShareDeliveryProvider.dll and then built my own assembly
which essentially mimics the ReportingServicesFileShareDeliveryProvider.dll.
I changed two class names, the FileShareProvider and FileShareUIControl
classes are known in my assembly as FaxProvider and FaxUIControl.
Once I had all the functionality of the
ReportingServicesFileShareDeliveryProvider.dll (I have only changed the two
class names and replaced references to them with the new names) I attempted
to deploy my assembly as a custom delivery extension so that I can test that
I have attained the same functionality as the
ReportingServicesFileShareDeliveryProvider.dll. This is where I run into
problems.
I see the following in my log files for RS:
aspnet_wp!extensionfactory!15ec!08/17/2005-14:45:59:: e ERROR: Exception
caught instantiating report server extension:
System.Reflection.TargetInvocationException: Exception has been thrown by the
target of an invocation. --> System.TypeInitializationException: The type
initializer for "FaxDeliveryProvider.FaxProvider" threw an exception. -->
System.Security.SecurityException: Request for the permission of type
System.Security.Permissions.StrongNameIdentityPermission, mscorlib,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed.
at FaxDeliveryProvider.FaxProvider..cctor()
The state of the failed permission was:
<IPermission
class="System.Security.Permissions.StrongNameIdentityPermission, mscorlib,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
PublicKeyBlob="0024000004800000940000000602000000240000525341310004000001000100272736AD6E5F9586BAC2D531EABC3ACC666C2F8EC879FA94F8F7B0327D2FF2ED523448F83C3D5C5DD2DFC7BC99C5286B2C125117BF5CBE242B9D41750732B2BDFFE649C6EFB8E5526D526FDD130095ECDB7BF210809C6CDAD8824FAA9AC0310AC3CBA2AA0523567B2DFA7FE250B30FACBD62D4EC99B94AC47C7D3B28F1F6E4C8"/>
-- End of inner exception stack trace --
-- End of inner exception stack trace --
at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder
binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr,
Binder binder, Object[] args, CultureInfo culture, Object[]
activationAttributes)
at System.Reflection.Assembly.CreateInstance(String typeName, Boolean
ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args,
CultureInfo culture, Object[] activationAttributes)
at System.Reflection.Assembly.CreateInstance(String typeName)
at
Microsoft.ReportingServices.Diagnostics.ExtensionClassFactory.AssertAndCreate(Assembly assembly, String typeName)
at
Microsoft.ReportingServices.Diagnostics.ExtensionClassFactory.AssertAndCreate(Assembly assembly, String typeName)
at
Microsoft.ReportingServices.Diagnostics.ExtensionClassFactory.GetNewExtensionInstance(String extensionName, String extensionType).
I have been doing some research and I know that the built in delivery file
share delivery extension usese strong name security instead of URLMembership
security...but I am not sure what I need to do or what changes I need to
make to my config files to get around this. ANY HELP would be much
appreciated...
The following are the changes to the configuration files I made during
deployment:
RSReportServer.config
Added:
<Extension Name="Report Server Fax Delivery Extension"
Type="FaxDeliveryProvider.FaxProvider,FaxDeliveryProvider">
<MaxRetries>0</MaxRetries>
<SecondsBeforeRetry>900</SecondsBeforeRetry>
<Configuration>
<FileShareConfiguration>
<ExcludedRenderFormats>
<RenderingExtension>HTMLOWC</RenderingExtension>
<RenderingExtension>NULL</RenderingExtension>
</ExcludedRenderFormats>
</FileShareConfiguration>
</Configuration>
</Extension>
rssrvpolicy.config
Added:
<CodeGroup class="UnionCodeGroup"
version="1"
PermissionSetName="FullTrust"
Name="FaxDeliveryCodeGroup"
Description="Code group for my delivery extension">
<IMembershipCondition class="UrlMembershipCondition"
version="1"
Url="C:\Program Files\Microsoft SQL Server\MSSQL\Reporting
Services\ReportServer\bin\FaxDeliveryProvider.dll"
/>
</CodeGroup>
RSWebApplication.confg
Added to the DeliveryUI element:
<Extension Name="Report Server Fax Delivery Extension"
Type="FaxDeliveryProvider.FaxUIControl,FaxDeliveryProvider">
<Configuration>
<FileShare>
<DefaultRenderingExtension>MHTML</DefaultRenderingExtension>
</FileShare>
</Configuration>
</Extension>
rsmgrpolicy.config
added:
<CodeGroup class="UnionCodeGroup"
version="1"
PermissionSetName="FullTrust"
Name="FaxDeliveryCodeGroup"
Description="Code group for my delivery extension">
<IMembershipCondition class="UrlMembershipCondition"
version="1"
Url="C:\Program Files\Microsoft SQL Server\MSSQL\Reporting
Services\ReportManager\bin\FaxDeliveryProvider.dll"
/>
</CodeGroup>Anyone?
"Nick @. INDATA" wrote:
> I am working on putting together a custom delivery extension (fax delivery)
> based on the built-in File Share delivery extension.
> Most of the functionality I need already exists in the File Share delivery
> extension so I used the Lutz Roeder's .NET Reflector to disassemble the
> ReportingServicesFileShareDeliveryProvider.dll and then built my own assembly
> which essentially mimics the ReportingServicesFileShareDeliveryProvider.dll.
> I changed two class names, the FileShareProvider and FileShareUIControl
> classes are known in my assembly as FaxProvider and FaxUIControl.
> Once I had all the functionality of the
> ReportingServicesFileShareDeliveryProvider.dll (I have only changed the two
> class names and replaced references to them with the new names) I attempted
> to deploy my assembly as a custom delivery extension so that I can test that
> I have attained the same functionality as the
> ReportingServicesFileShareDeliveryProvider.dll. This is where I run into
> problems.
> I see the following in my log files for RS:
> aspnet_wp!extensionfactory!15ec!08/17/2005-14:45:59:: e ERROR: Exception
> caught instantiating report server extension:
> System.Reflection.TargetInvocationException: Exception has been thrown by the
> target of an invocation. --> System.TypeInitializationException: The type
> initializer for "FaxDeliveryProvider.FaxProvider" threw an exception. -->
> System.Security.SecurityException: Request for the permission of type
> System.Security.Permissions.StrongNameIdentityPermission, mscorlib,
> Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed.
> at FaxDeliveryProvider.FaxProvider..cctor()
> The state of the failed permission was:
> <IPermission
> class="System.Security.Permissions.StrongNameIdentityPermission, mscorlib,
> Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
> version="1"
> PublicKeyBlob="0024000004800000940000000602000000240000525341310004000001000100272736AD6E5F9586BAC2D531EABC3ACC666C2F8EC879FA94F8F7B0327D2FF2ED523448F83C3D5C5DD2DFC7BC99C5286B2C125117BF5CBE242B9D41750732B2BDFFE649C6EFB8E5526D526FDD130095ECDB7BF210809C6CDAD8824FAA9AC0310AC3CBA2AA0523567B2DFA7FE250B30FACBD62D4EC99B94AC47C7D3B28F1F6E4C8"/>
> -- End of inner exception stack trace --
> -- End of inner exception stack trace --
> at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly)
> at System.Activator.CreateInstance(Type type, Boolean nonPublic)
> at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder
> binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
> at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr,
> Binder binder, Object[] args, CultureInfo culture, Object[]
> activationAttributes)
> at System.Reflection.Assembly.CreateInstance(String typeName, Boolean
> ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args,
> CultureInfo culture, Object[] activationAttributes)
> at System.Reflection.Assembly.CreateInstance(String typeName)
> at
> Microsoft.ReportingServices.Diagnostics.ExtensionClassFactory.AssertAndCreate(Assembly assembly, String typeName)
> at
> Microsoft.ReportingServices.Diagnostics.ExtensionClassFactory.AssertAndCreate(Assembly assembly, String typeName)
> at
> Microsoft.ReportingServices.Diagnostics.ExtensionClassFactory.GetNewExtensionInstance(String extensionName, String extensionType).
> I have been doing some research and I know that the built in delivery file
> share delivery extension usese strong name security instead of URLMembership
> security...but I am not sure what I need to do or what changes I need to
> make to my config files to get around this. ANY HELP would be much
> appreciated...
> The following are the changes to the configuration files I made during
> deployment:
> RSReportServer.config
> Added:
> <Extension Name="Report Server Fax Delivery Extension"
> Type="FaxDeliveryProvider.FaxProvider,FaxDeliveryProvider">
> <MaxRetries>0</MaxRetries>
> <SecondsBeforeRetry>900</SecondsBeforeRetry>
> <Configuration>
> <FileShareConfiguration>
> <ExcludedRenderFormats>
> <RenderingExtension>HTMLOWC</RenderingExtension>
> <RenderingExtension>NULL</RenderingExtension>
> </ExcludedRenderFormats>
> </FileShareConfiguration>
> </Configuration>
> </Extension>
>
> rssrvpolicy.config
> Added:
> <CodeGroup class="UnionCodeGroup"
> version="1"
> PermissionSetName="FullTrust"
> Name="FaxDeliveryCodeGroup"
> Description="Code group for my delivery extension">
> <IMembershipCondition class="UrlMembershipCondition"
> version="1"
> Url="C:\Program Files\Microsoft SQL Server\MSSQL\Reporting
> Services\ReportServer\bin\FaxDeliveryProvider.dll"
> />
> </CodeGroup>
> RSWebApplication.confg
> Added to the DeliveryUI element:
> <Extension Name="Report Server Fax Delivery Extension"
> Type="FaxDeliveryProvider.FaxUIControl,FaxDeliveryProvider">
> <Configuration>
> <FileShare>
> <DefaultRenderingExtension>MHTML</DefaultRenderingExtension>
> </FileShare>
> </Configuration>
> </Extension>
> rsmgrpolicy.config
> added:
> <CodeGroup class="UnionCodeGroup"
> version="1"
> PermissionSetName="FullTrust"
> Name="FaxDeliveryCodeGroup"
> Description="Code group for my delivery extension">
> <IMembershipCondition class="UrlMembershipCondition"
> version="1"
> Url="C:\Program Files\Microsoft SQL Server\MSSQL\Reporting
> Services\ReportManager\bin\FaxDeliveryProvider.dll"
> />
> </CodeGroup>
>

Problems with creating Custom Log Provider

I am new to SSIS but I am learning fast. Any help is greatly appreciated.

I have written a custom log provider derived from LogProviderBase. I want to programmtically add the custom log provider to my package, but when I try this:

myPackage.LogProviders.Add("ACustomLogProvider");

I get the following exception:

"The log provider type "ACustomLogProvider" specified for log provider "{..GUID..}" is not recognized as a valid log provider type. This error occurs when an attempt is made to create a log provider for unknown log provider type. Verify the spelling in the log provider type name".

I have followed the instructions in BOL and as suggested in this forum, adding the DtsLogProvider attribute:

[DtsLogProvider(DisplayName="ACustomLogProvider", LogProviderType="ACustomLogProvider", Description="a description")]

Another way I tried is that I added a GUID attribute to my custom log provider class and then tried this:

Type aType = typeof(ACustomLogProvider);

Guid aGUID = (Guid)aType.GUID;

myPackage.LogProviders.Add("{"+ aGUID.ToString() +"}");

This also gives me the same exception "The log provider type ""{..the actual GUID for ACustomLogProvider..}" specified for log provider "{..a different GUID..}" is not recognized as a valid log provider type....

My questions are: Is it possible to add a custom log provider programmtically or must it be done through the SSIS Designer?

Must I deploy my custom log provider class for it to work programmatically? (I had perhaps wrongly assumed I would not have to deploy if I don't want it to show up in the SSIS Designer).

I would prefer to use a custom log provider instead of just logging within the SSIS event handlers because I can override the OnPostExecute, etc. but I cannot (can I?) override the specific event handlers like PackageStart, PackageEnd, etc because they are not exposed through DTSEvents.

Any help I would be very grateful for. Thanks.

I think you need to pass fully qualified type name to Add method:

myPackage.LogProviders.Add(aType.AssemblyQualifiedName);

|||

Thank you very much, Michael. That is working great.

I appreciate your help, especially since this seems like it was a trivial question. I should have been able to see that!

Thanks,

Amy

|||

Hi,

I've trying to create a custom log provider following msdn directions from:

http://technet.microsoft.com/en-us/library/ms365184.aspx

However, the example shown there for HtmlLogProvider does not work for me. I created the dll put it in every single folder it is indicated and also used gacutil and nothing. When I go to the SQL Server Business Intelligence Development Studio and I select "Logging" from the control flow, the only available log proivders that I see are the ones that came by default with the the IDE but not the one I created (HtmlLogProvider). I would like to know if you tried it and also had the same problem and if you could give me some advice of what to do.

Thanks so much

|||Try restarting the SSIS service.|||

I finally made it work for the HtmlLog Provider but sometimes it works and sometimes it does not. By some reason sometimes it does fill data inside the html and sometimes it does nothing with it. I have wondering what may be the reason.

The steps I followed once I had the Log Provider installed in the GAC and copied into the log provider folder was to do:

Logging

Add Custom log provider

and choose the package level and som of the events (On error, etc). I also tried selecting everything.

I also tried clickng on "Log Events" but what it does is only show a window with the logged events.

Please tell me if there is a bug with the log providers in SSIS or if I am not following the right steps.

Thanks a lot

|||

I'm not aware of any bug with the log providers. The stock log providers work using the same extensibility mechanism as you should be using, so if stock log providers work OK, you need to debug why yours is not working.

It is unclear what do you mean by "sometime it does nothing with it" - have you debugged whether the log provider receives the events you expect it to receive?

|||

I am sorry I was not too specific with what I meant. Let me try to make myself more clear. First I downloaded an example of an HtmlLogProvider from MS and tried it and worked. Now I was looking at the methods that are overwritten and I wanted to create my own log provider. So I tried to do it as simple as possible. So in my dummy example I just wanted to see the errors of my dtsx pacakge thru my cutom log provider. The code is as follows:

namespace HtmlLogProviderCS

{

using System;

using Microsoft.SqlServer.Dts.Runtime;

using System.IO;

using System.Web.UI;

using System.Web;

// The LogProviderType property is required but not used.

// The custom log provider will not appear in the list

// if a LogProviderType is not provided.

[DtsLogProvider(DisplayName = "MyLogProviderTest", Description = "A simple log provider.", LogProviderType = "Custom")]

public class HtmlLogProviderCS : LogProviderBase

{

#region Variables and constants

// Constants.

private const string SUBCOMPONENT = "HtmlLogProviderCS";

private const string PACKAGE_END_EVENT = "PackageEnd";

// Variables.

private Microsoft.SqlServer.Dts.Runtime.Connections _connections;

private Microsoft.SqlServer.Dts.Runtime.IDTSInfoEvents _events;

private string _configString;

private string _logFile;

private HtmlLogWriterCS _htmlLogWriter;

private MemoryStream _logStream;

private StreamWriter _logStreamWriter;

// Status flags.

private bool _fireEventsAgain=true;

private bool _loggingAlreadyStarted;

private bool _packageHasEnded;

#endregion

public override void InitializeLogProvider(Microsoft.SqlServer.Dts.Runtime.Connections connections, Microsoft.SqlServer.Dts.Runtime.IDTSInfoEvents events, Microsoft.SqlServer.Dts.Runtime.ObjectReferenceTracker refTracker)

{

_events = events;

System.Windows.Forms.MessageBox.Show("Init");

}

public override Microsoft.SqlServer.Dts.Runtime.DTSExecResult Validate(Microsoft.SqlServer.Dts.Runtime.IDTSInfoEvents events)

{

System.Windows.Forms.MessageBox.Show("Validate");

return DTSExecResult.Success;

}

public override void OpenLog()

{

System.Windows.Forms.MessageBox.Show("OpenLog");

}

public override void CloseLog()

{

System.Windows.Forms.MessageBox.Show("CloseLog");

}

public override void Log(string logEntryName, string computerName, string operatorName, string sourceName, string sourceID, string executionID, string messageText, DateTime startTime, DateTime endTime, int dataCode, byte[] dataBytes)

{

System.Windows.Forms.MessageBox.Show("Logging...");

System.Windows.Forms.MessageBox.Show("Message is: " + logEntryName + "--" + computerName + "--" + operatorName + "--" + sourceName + "--" + sourceID + "--" + executionID + "--" + messageText);

}

}

}

Many of the variables declared in there are just there cuz they were in the example I took form the HtmlLogProvider but other than that there's no reason for them to be there. So I really do not know why this Log is not working. The weird thing is that the message that am putting for every method does pop op correctly in every method EXCEPT for the LOG method which is not even invoked.

Problems with creating Custom Log Provider

I am new to SSIS but I am learning fast. Any help is greatly appreciated.

I have written a custom log provider derived from LogProviderBase. I want to programmtically add the custom log provider to my package, but when I try this:

myPackage.LogProviders.Add("ACustomLogProvider");

I get the following exception:

"The log provider type "ACustomLogProvider" specified for log provider "{..GUID..}" is not recognized as a valid log provider type. This error occurs when an attempt is made to create a log provider for unknown log provider type. Verify the spelling in the log provider type name".

I have followed the instructions in BOL and as suggested in this forum, adding the DtsLogProvider attribute:

[DtsLogProvider(DisplayName="ACustomLogProvider", LogProviderType="ACustomLogProvider", Description="a description")]

Another way I tried is that I added a GUID attribute to my custom log provider class and then tried this:

Type aType = typeof(ACustomLogProvider);

Guid aGUID = (Guid)aType.GUID;

myPackage.LogProviders.Add("{"+ aGUID.ToString() +"}");

This also gives me the same exception "The log provider type ""{..the actual GUID for ACustomLogProvider..}" specified for log provider "{..a different GUID..}" is not recognized as a valid log provider type....

My questions are: Is it possible to add a custom log provider programmtically or must it be done through the SSIS Designer?

Must I deploy my custom log provider class for it to work programmatically? (I had perhaps wrongly assumed I would not have to deploy if I don't want it to show up in the SSIS Designer).

I would prefer to use a custom log provider instead of just logging within the SSIS event handlers because I can override the OnPostExecute, etc. but I cannot (can I?) override the specific event handlers like PackageStart, PackageEnd, etc because they are not exposed through DTSEvents.

Any help I would be very grateful for. Thanks.

I think you need to pass fully qualified type name to Add method:

myPackage.LogProviders.Add(aType.AssemblyQualifiedName);

|||

Thank you very much, Michael. That is working great.

I appreciate your help, especially since this seems like it was a trivial question. I should have been able to see that!

Thanks,

Amy

|||

Hi,

I've trying to create a custom log provider following msdn directions from:

http://technet.microsoft.com/en-us/library/ms365184.aspx

However, the example shown there for HtmlLogProvider does not work for me. I created the dll put it in every single folder it is indicated and also used gacutil and nothing. When I go to the SQL Server Business Intelligence Development Studio and I select "Logging" from the control flow, the only available log proivders that I see are the ones that came by default with the the IDE but not the one I created (HtmlLogProvider). I would like to know if you tried it and also had the same problem and if you could give me some advice of what to do.

Thanks so much

|||Try restarting the SSIS service.|||

I finally made it work for the HtmlLog Provider but sometimes it works and sometimes it does not. By some reason sometimes it does fill data inside the html and sometimes it does nothing with it. I have wondering what may be the reason.

The steps I followed once I had the Log Provider installed in the GAC and copied into the log provider folder was to do:

Logging

Add Custom log provider

and choose the package level and som of the events (On error, etc). I also tried selecting everything.

I also tried clickng on "Log Events" but what it does is only show a window with the logged events.

Please tell me if there is a bug with the log providers in SSIS or if I am not following the right steps.

Thanks a lot

|||

I'm not aware of any bug with the log providers. The stock log providers work using the same extensibility mechanism as you should be using, so if stock log providers work OK, you need to debug why yours is not working.

It is unclear what do you mean by "sometime it does nothing with it" - have you debugged whether the log provider receives the events you expect it to receive?

|||

I am sorry I was not too specific with what I meant. Let me try to make myself more clear. First I downloaded an example of an HtmlLogProvider from MS and tried it and worked. Now I was looking at the methods that are overwritten and I wanted to create my own log provider. So I tried to do it as simple as possible. So in my dummy example I just wanted to see the errors of my dtsx pacakge thru my cutom log provider. The code is as follows:

namespace HtmlLogProviderCS

{

using System;

using Microsoft.SqlServer.Dts.Runtime;

using System.IO;

using System.Web.UI;

using System.Web;

// The LogProviderType property is required but not used.

// The custom log provider will not appear in the list

// if a LogProviderType is not provided.

[DtsLogProvider(DisplayName = "MyLogProviderTest", Description = "A simple log provider.", LogProviderType = "Custom")]

publicclassHtmlLogProviderCS : LogProviderBase

{

#region Variables and constants

// Constants.

privateconststring SUBCOMPONENT = "HtmlLogProviderCS";

privateconststring PACKAGE_END_EVENT = "PackageEnd";

// Variables.

private Microsoft.SqlServer.Dts.Runtime.Connections _connections;

private Microsoft.SqlServer.Dts.Runtime.IDTSInfoEvents _events;

privatestring _configString;

privatestring _logFile;

privateHtmlLogWriterCS _htmlLogWriter;

privateMemoryStream _logStream;

privateStreamWriter _logStreamWriter;

// Status flags.

privatebool _fireEventsAgain=true;

privatebool _loggingAlreadyStarted;

privatebool _packageHasEnded;

#endregion

publicoverridevoid InitializeLogProvider(Microsoft.SqlServer.Dts.Runtime.Connections connections, Microsoft.SqlServer.Dts.Runtime.IDTSInfoEvents events, Microsoft.SqlServer.Dts.Runtime.ObjectReferenceTracker refTracker)

{

_events = events;

System.Windows.Forms.MessageBox.Show("Init");

}

publicoverride Microsoft.SqlServer.Dts.Runtime.DTSExecResult Validate(Microsoft.SqlServer.Dts.Runtime.IDTSInfoEvents events)

{

System.Windows.Forms.MessageBox.Show("Validate");

returnDTSExecResult.Success;

}

publicoverridevoid OpenLog()

{

System.Windows.Forms.MessageBox.Show("OpenLog");

}

publicoverridevoid CloseLog()

{

System.Windows.Forms.MessageBox.Show("CloseLog");

}

publicoverridevoid Log(string logEntryName, string computerName, string operatorName, string sourceName, string sourceID, string executionID, string messageText, DateTime startTime, DateTime endTime, int dataCode, byte[] dataBytes)

{

System.Windows.Forms.MessageBox.Show("Logging...");

System.Windows.Forms.MessageBox.Show("Message is: " + logEntryName + "--" + computerName + "--" + operatorName + "--" + sourceName + "--" + sourceID + "--" + executionID + "--" + messageText);

}

}

}

Many of the variables declared in there are just there cuz they were in the example I took form the HtmlLogProvider but other than that there's no reason for them to be there. So I really do not know why this Log is not working. The weird thing is that the message that am putting for every method does pop op correctly in every method EXCEPT for the LOG method which is not even invoked.

Saturday, February 25, 2012

Problems with assembly accessing LDAP & Registry

Running SSRS 2005, I have a custom assembly that needs to read/browse
the file system, Active Directory, and the registry. I have added the
explicit permissions into the code before the calls ie.
Dim fsec As New FileIOPermission(FileIOPermissionAccess.AllAccess,
strFilePath)
fsec.Assert()
Dim perm As New RegistryPermission(RegistryPermissionAccess.Read,
"HKEY_LOCAL_MACHINE\SOFTWARE\0")
perm.Assert()
Dim dsp As New
DirectoryServicesPermission(DirectoryServicesPermissionAccess.Browse,
groupLDAP)
dsp.Assert()
I believe I've added the code group entry for my assembly into the
rssrvpolicy.config file in the correct place (first entry in the group
for the zone=MyComputer.)
<CodeGroup class="FirstMatchCodeGroup"
version="1" PermissionSetName="FullTrust"
Name="MyCustomAssemblyCodeGroup"
Description="A special code group for my custom assembly">
<IMembershipCondition class="UrlMembershipCondition" version="1"
Url="D:\Microsoft SQL Server 2005\MSSQL.3\Reporting Services
\ReportServer\bin\UrixRS.dll"/>
</CodeGroup>
The report runs fine in preview (expected), in debugLocal (great), but
returns errors when it is deployed to the server (rats!) Actually, the
file IO runs OK on the server. It's just the LDAP and registry calls
that die. Some other code that does not use protected resources runs
fine so I'm confident that I brought the assembly into the report
correctly.
I've disabled the CAS security and the report still errors on the
server. I also made sure the web.config file has impersonate="true" so
the machine user_id should be passed (The global User!UserID in RS is
showing correctly on the server report). Anyone have any ideas what
the issue may be?Update. I've gotten the registry access to work. The problem I still
have is that I can't access the LDAP. I believe the root of the
problem has to do with I'm not able to use UNC paths in my assembly or
I get a not found error. It can access c:\myfile.txt fine, but it
can't get to \\myserver\myfile.txt.
As before, everything still works fine locally, it's just when I try
to run off the report server that I have the problem.
Has anyone had similar issues using UNC paths in custom assemblies?