Thursday, March 29, 2012
Deserialization failed: File or assembly name Microsoft.ReportingServices.Interfaces not f
I just installed Vault Source Control on my machine. I then opened a
Reporting Services project with rdl's in it. Every RDL that is currently in
source control opens with this error
"Deserialization failed: File or assembly name
Microsoft.ReportingServices.Interfaces, or one of its dependencies, was not
found."
If I open another instance of the MSIDE without Vault (locally) and open a
different RDL it works fine. Is this an issue with the source control or
with the way it opens the file?
Any help will be appreciated. Need to get this solved.
PonnuI think it has to do with the way the add-in is written. Some add-ins turn
on shadow-copy, which plays havoc with the report designer as our assemblies
aren't located in the VS shared location. You might be able to copy the
report designer assemlies into the IDE directory. Not sure if you can
configure the add-in not to shadow copy.
--
Brian Welcker
Group Program Manager
SQL Server Reporting Services
"Ponnurangam" <ponnurangam@.trellisys.net> wrote in message
news:uZiORNloEHA.1160@.tk2msftngp13.phx.gbl...
> Hello,
> I just installed Vault Source Control on my machine. I then opened a
> Reporting Services project with rdl's in it. Every RDL that is currently
> in
> source control opens with this error
> "Deserialization failed: File or assembly name
> Microsoft.ReportingServices.Interfaces, or one of its dependencies, was
> not
> found."
> If I open another instance of the MSIDE without Vault (locally) and open a
> different RDL it works fine. Is this an issue with the source control or
> with the way it opens the file?
> Any help will be appreciated. Need to get this solved.
> Ponnu
>
Sunday, March 25, 2012
Derive ReportDesigner !2005! Textbox
I want to derive the ReportDesigner TextBox to add some special functionality.
So we had to know which assembly provides this class.
using:
- Microsoft SQL Server 2005 CTP (april)
- Visual Studio 2005 Teamsuite Beta 2 (april)
Thx!On 22 Apr 2005 04:18:32 -0700, moritzfechtner@.web.de (the_mo) wrote:
>Hi there,
>I want to derive the ReportDesigner TextBox to add some special functionality.
>So we had to know which assembly provides this class.
>using:
>- Microsoft SQL Server 2005 CTP (april)
>- Visual Studio 2005 Teamsuite Beta 2 (april)
>Thx!
What additional functionality are you looking to provide?
By the way SQL Server 2005 questions are best directed to the
microsoft.private.sqlserver2005.reportingsvcs newsgroup.
See
http://communities.microsoft.com/newsgroups/default.asp?icp=sqlserver2005&slcid=us
foir information as to how to access the newsgroups in that stack.
Andrew Watt
MVP - InfoPath
Wednesday, March 7, 2012
Deploying custom assemblies
I have developed a custom assembly and now I want to deploy it on to
the server as per the instructions mentioned in the books online
(ms-help://MS.RSBOL80.1033/RSPROG/htm/rsp_prog_rdl_8mue.htm), I want
to remove the commented portion of the RSReportServer.config file to
enable custom assemblies permission.However, I find that I dont have
any such commented portion in the file. I am using the Developer
edition of Reporting Services.
Can any one guide me if the file being edited is correct ? Does it
have to do something with the edition of RS that I am using?
Thanks in advance,
Lone CrusaderHi Loner,
Depending on what permission levels your custom assemblies need you'll need
to update your RS policy file and deply that too.
You'll need to add a PermissionSet AND CodeGroup configuration settings
(when using Report Designer, it uses it's own levels of Code Trusting (it
fakes a few things), when you do it by yourself, you'll need to define this
Code Trust (RS "trusting" your custom assembly) yourself
- peteZ
"Lone Crusader" <ravi32ful@.rediffmail.com> wrote in message
news:cc093b66.0409110001.3a1ac8bd@.posting.google.com...
> Hi All,
> I have developed a custom assembly and now I want to deploy it on to
> the server as per the instructions mentioned in the books online
> (ms-help://MS.RSBOL80.1033/RSPROG/htm/rsp_prog_rdl_8mue.htm), I want
> to remove the commented portion of the RSReportServer.config file to
> enable custom assemblies permission.However, I find that I dont have
> any such commented portion in the file. I am using the Developer
> edition of Reporting Services.
> Can any one guide me if the file being edited is correct ? Does it
> have to do something with the edition of RS that I am using?
> Thanks in advance,
> Lone Crusader|||Bryant Likes wrote a nice article on this issue - read it at
http://blogs.sqlxml.org/bryantlikes/articles/824.aspx.
--
Dejan Sarka, SQL Server MVP
Associate Mentor
Solid Quality Learning
More than just Training
www.SolidQualityLearning.com
"Lone Crusader" <ravi32ful@.rediffmail.com> wrote in message
news:cc093b66.0409110001.3a1ac8bd@.posting.google.com...
> Hi All,
> I have developed a custom assembly and now I want to deploy it on to
> the server as per the instructions mentioned in the books online
> (ms-help://MS.RSBOL80.1033/RSPROG/htm/rsp_prog_rdl_8mue.htm), I want
> to remove the commented portion of the RSReportServer.config file to
> enable custom assemblies permission.However, I find that I dont have
> any such commented portion in the file. I am using the Developer
> edition of Reporting Services.
> Can any one guide me if the file being edited is correct ? Does it
> have to do something with the edition of RS that I am using?
> Thanks in advance,
> Lone Crusader
Deploying an Assembly in "Analysis Server" through Code
Hi,
I have a requirement wherein I have to deploy an assembly in "Analysis Server" through Code. I tried using "CREATE ASSEMBLY .... " which works fine with Database Server, but is not being recognized as a command in "Analysis Server".
Is there any other way of doing this except the Wizards.
Thanks!!
You could go a couple of routes...
1. XMLA - If you add an assembly via Management Studio and click the Script button at the top of the dialog, you'll see the XMLA for adding an assembly. Then you will need to figure out how to encode the bytes of your DLL as it expects and create your own XMLA request.
2. AMO - If you use Analysis Management Objects, you can do this through an API and don't have to mess with XMLA.
I would suggest #2. I haven't seen code to do exactly this. But there is some open source code to do the reverse (inspect a deployed DLL) which might help you get a feel for the AMO objects you'd use:
http://www.codeplex.com/ASStoredProcedures/Wiki/View.aspx?title=ListFunctions&referringTitle=Home
Hope that gives you enough info to get a little further than before. Post back here if not.
Deploying an Assembly in "Analysis Server" through Code
Hi,
I have a requirement wherein I have to deploy an assembly in "Analysis Server" through Code. I tried using "CREATE ASSEMBLY .... " which works fine with Database Server, but is not being recognized as a command in "Analysis Server".
Is there any other way of doing this except the Wizards.
Thanks!!
You could go a couple of routes...
1. XMLA - If you add an assembly via Management Studio and click the Script button at the top of the dialog, you'll see the XMLA for adding an assembly. Then you will need to figure out how to encode the bytes of your DLL as it expects and create your own XMLA request.
2. AMO - If you use Analysis Management Objects, you can do this through an API and don't have to mess with XMLA.
I would suggest #2. I haven't seen code to do exactly this. But there is some open source code to do the reverse (inspect a deployed DLL) which might help you get a feel for the AMO objects you'd use:
http://www.codeplex.com/ASStoredProcedures/Wiki/View.aspx?title=ListFunctions&referringTitle=Home
Hope that gives you enough info to get a little further than before. Post back here if not.
Saturday, February 25, 2012
Deployed report with custom assembly fail when calling web service
I'm developing a report that calls a web service using a custom assembly.
I've got the code working in VS.NET, but when I deploy to my local Report
Server, I get this:
System.Security.SecurityException: Request for the permission of type
System.Security.Permissions.SecurityPermission, mscorlib,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed
I have added the following to RSReportServer.config:
<CustomAssemblies>
<Assembly Name="cmcs.wsclient.dll, Version=1.0.xxx.xxxx,
Culture=neutral, PublicKeyToken=xxx">
<PermissionSet class="System.Security.PermissionSet">
<IPermission
class="System.Security.Permissions.SecurityPermission"
version="1"
Flags="Execution, Assertion"
/>
<IPermission class="System.Security.Permissions.WebPermission"
version="1"
Unrestricted="true"
/>
<IPermission
class="System.Security.Permissions.EnvironmentPermission"
version="1"
Unrestricted="true"
/>
</PermissionSet>
</Assembly>
<Assembly Name="cmcs.msrs.webserviceclient, Version=1.0.xxx.xxxx,
Culture=neutral, PublicKeyToken=xxx">
<PermissionSet class="System.Security.PermissionSet">
<IPermission
class="System.Security.Permissions.SecurityPermission"
version="1"
Flags="Execution, Assertion"
/>
<IPermission class="System.Security.Permissions.WebPermission"
version="1"
Unrestricted="true"
/>
<IPermission
class="System.Security.Permissions.EnvironmentPermission"
version="1"
Unrestricted="true"
/>
</PermissionSet>
</Assembly>
<Default>
<PermissionSet class="System.Security.PermissionSet">
<IPermission
class="System.Security.Permissions.SecurityPermission"
version="1"
Flags="Execute"
/>
</PermissionSet>
</Default>
</CustomAssemblies>
In rssrvpolicy.config, I have changed the PermissionSet for
Report_Expressions_Default_Permissions to FullTrust and added the following:
<CodeGroup class="UnionCodeGroup"
version="1"
PermissionSetName="FullTrust"
Attributes="LevelFinal"
Name="ReportServer-cmcs.msrs.webserviceclient"
Description="Codegroup generated by the .NET
Configuration tool">
<IMembershipCondition class="UrlMembershipCondition"
version="1"
Url="file://C:/Program
Files/Microsoft SQL Server/MSSQL/Reporting
Services/ReportServer/bin/cmcs.msrs.webserviceclient.dll"/>
</CodeGroup>
It works to call a HelloWorld method returning a string from the custom
assembly, so there is no total failure, but calling the method to invoke the
web service fails.
Please help, I feel that I'm totally stuck!
JonasBy moving my CodeGroup in rssrvpolicy.config to right under the first
default CodeGroup, it I got it to work ...
<CodeGroup
class="FirstMatchCodeGroup"
version="1"
PermissionSetName="Nothing">
<IMembershipCondition
class="AllMembershipCondition"
version="1"
/>
***** RIGHT UNDER HERE *****
It seems like my CodeGroup wasn't used by ReportServer until the move. We'll
just have to see how long time it will work before it breaks again ;-)
Jonas" <Jonas@.nospam.pl> wrote in message
news:u$YVj30IGHA.1032@.TK2MSFTNGP11.phx.gbl...
> Hi,
> I'm developing a report that calls a web service using a custom assembly.
> I've got the code working in VS.NET, but when I deploy to my local Report
> Server, I get this:
> System.Security.SecurityException: Request for the permission of type
> System.Security.Permissions.SecurityPermission, mscorlib,
> Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
failed
> I have added the following to RSReportServer.config:
> <CustomAssemblies>
> <Assembly Name="cmcs.wsclient.dll, Version=1.0.xxx.xxxx,
> Culture=neutral, PublicKeyToken=xxx">
> <PermissionSet class="System.Security.PermissionSet">
> <IPermission
> class="System.Security.Permissions.SecurityPermission"
> version="1"
> Flags="Execution, Assertion"
> />
> <IPermission class="System.Security.Permissions.WebPermission"
> version="1"
> Unrestricted="true"
> />
> <IPermission
> class="System.Security.Permissions.EnvironmentPermission"
> version="1"
> Unrestricted="true"
> />
> </PermissionSet>
> </Assembly>
> <Assembly Name="cmcs.msrs.webserviceclient, Version=1.0.xxx.xxxx,
> Culture=neutral, PublicKeyToken=xxx">
> <PermissionSet class="System.Security.PermissionSet">
> <IPermission
> class="System.Security.Permissions.SecurityPermission"
> version="1"
> Flags="Execution, Assertion"
> />
> <IPermission class="System.Security.Permissions.WebPermission"
> version="1"
> Unrestricted="true"
> />
> <IPermission
> class="System.Security.Permissions.EnvironmentPermission"
> version="1"
> Unrestricted="true"
> />
> </PermissionSet>
> </Assembly>
> <Default>
> <PermissionSet class="System.Security.PermissionSet">
> <IPermission
> class="System.Security.Permissions.SecurityPermission"
> version="1"
> Flags="Execute"
> />
> </PermissionSet>
> </Default>
> </CustomAssemblies>
> In rssrvpolicy.config, I have changed the PermissionSet for
> Report_Expressions_Default_Permissions to FullTrust and added the
following:
> <CodeGroup class="UnionCodeGroup"
> version="1"
> PermissionSetName="FullTrust"
> Attributes="LevelFinal"
>
Name="ReportServer-cmcs.msrs.webserviceclient"
> Description="Codegroup generated by the .NET
> Configuration tool">
> <IMembershipCondition class="UrlMembershipCondition"
> version="1"
> Url="file://C:/Program
> Files/Microsoft SQL Server/MSSQL/Reporting
> Services/ReportServer/bin/cmcs.msrs.webserviceclient.dll"/>
> </CodeGroup>
> It works to call a HelloWorld method returning a string from the custom
> assembly, so there is no total failure, but calling the method to invoke
the
> web service fails.
> Please help, I feel that I'm totally stuck!
> Jonas
>
Deployed custom assembly doesn't call web service
I've got a custom assembly used in Rptsvcs that calls a web service on the
local host. When run in Report Designer, it works as planned, but when run
in Report Server, it doesn't call the web service. I have a
HelloWorld-method in the custom assembly that works, so the assembly is
working but it can't call the web service.
I have modified RSReportServer.config as follows:
<CustomAssemblies>
<Assembly Name="cmcs.wsclient, Version=1.0.xxx.xxxx, Culture=neutral,
PublicKeyToken=xxx">
<PermissionSet class="System.Security.PermissionSet">
<IPermission
class="System.Security.Permissions.SecurityPermission"
version="1"
Flags="Execution, Assertion"
/>
<IPermission class="System.Security.Permissions.WebPermission"
version="1">
<ConnectAccess>
<URI uri="$OriginHost$"/>
</ConnectAccess>
</IPermission>
</PermissionSet>
</Assembly>
<Default>
<PermissionSet class="System.Security.PermissionSet">
<IPermission
class="System.Security.Permissions.SecurityPermission"
version="1"
Flags="Execution"
/>
</PermissionSet>
</Default>
</CustomAssemblies>
And the policy file rssrvpolicy.config is also modified:
<CodeGroup class="UnionCodeGroup"
version="1"
PermissionSetName="FullTrust"
Attributes="LevelFinal"
Name="cmcs.wsclient"
Description="Codegroup generated by the .NET Configuration tool">
<IMembershipCondition class="UrlMembershipCondition"
version="1"
Url="file://C:/Program Files/Microsoft SQL
Server/MSSQL/Reporting Services/ReportServer/bin/cmcs.wsclient.dll"/>
</CodeGroup>
Any tips?
JonasI forgot to mention that I make an assert in code before the call to the web
service:
WebPermission webPerm = new WebPermission(PermissionState.Unrestricted);
webPerm.Assert();
TIA
Jonas
"Jonas" <Jonas@.nospam.pl> wrote in message
news:%23Na2whMIGHA.376@.TK2MSFTNGP12.phx.gbl...
> Hi,
> I've got a custom assembly used in Rptsvcs that calls a web service on the
> local host. When run in Report Designer, it works as planned, but when run
> in Report Server, it doesn't call the web service. I have a
> HelloWorld-method in the custom assembly that works, so the assembly is
> working but it can't call the web service.
> I have modified RSReportServer.config as follows:
> <CustomAssemblies>
> <Assembly Name="cmcs.wsclient, Version=1.0.xxx.xxxx, Culture=neutral,
> PublicKeyToken=xxx">
> <PermissionSet class="System.Security.PermissionSet">
> <IPermission
> class="System.Security.Permissions.SecurityPermission"
> version="1"
> Flags="Execution, Assertion"
> />
> <IPermission class="System.Security.Permissions.WebPermission"
> version="1">
> <ConnectAccess>
> <URI uri="$OriginHost$"/>
> </ConnectAccess>
> </IPermission>
> </PermissionSet>
> </Assembly>
> <Default>
> <PermissionSet class="System.Security.PermissionSet">
> <IPermission
> class="System.Security.Permissions.SecurityPermission"
> version="1"
> Flags="Execution"
> />
> </PermissionSet>
> </Default>
> </CustomAssemblies>
>
> And the policy file rssrvpolicy.config is also modified:
> <CodeGroup class="UnionCodeGroup"
> version="1"
> PermissionSetName="FullTrust"
> Attributes="LevelFinal"
> Name="cmcs.wsclient"
> Description="Codegroup generated by the .NET Configuration tool">
> <IMembershipCondition class="UrlMembershipCondition"
> version="1"
> Url="file://C:/Program Files/Microsoft SQL
> Server/MSSQL/Reporting Services/ReportServer/bin/cmcs.wsclient.dll"/>
> </CodeGroup>
> Any tips?
> Jonas
>
>|||After some more investigation, I found out that it is the following
statement
ws.Credentials = System.Net.CredentialCache.DefaultCredentials;
I need this to get the web services to use the callers identity. The
exception thrown is:
Request for the permission of type
System.Security.Permissions.EnvironmentPermission
As before, it works in Report Designer so the code is alright, it is the
security configuration that fails somewhere.
/Jonas
"Jonas" <Jonas@.nospam.pl> wrote in message
news:ewR3eFOIGHA.1288@.TK2MSFTNGP09.phx.gbl...
> I forgot to mention that I make an assert in code before the call to the
web
> service:
> WebPermission webPerm = new WebPermission(PermissionState.Unrestricted);
> webPerm.Assert();
> TIA
> Jonas
> "Jonas" <Jonas@.nospam.pl> wrote in message
> news:%23Na2whMIGHA.376@.TK2MSFTNGP12.phx.gbl...
> > Hi,
> >
> > I've got a custom assembly used in Rptsvcs that calls a web service on
the
> > local host. When run in Report Designer, it works as planned, but when
run
> > in Report Server, it doesn't call the web service. I have a
> > HelloWorld-method in the custom assembly that works, so the assembly is
> > working but it can't call the web service.
> >
> > I have modified RSReportServer.config as follows:
> >
> > <CustomAssemblies>
> > <Assembly Name="cmcs.wsclient, Version=1.0.xxx.xxxx, Culture=neutral,
> > PublicKeyToken=xxx">
> > <PermissionSet class="System.Security.PermissionSet">
> > <IPermission
> > class="System.Security.Permissions.SecurityPermission"
> > version="1"
> > Flags="Execution, Assertion"
> > />
> > <IPermission class="System.Security.Permissions.WebPermission"
> > version="1">
> > <ConnectAccess>
> > <URI uri="$OriginHost$"/>
> > </ConnectAccess>
> > </IPermission>
> > </PermissionSet>
> > </Assembly>
> >
> > <Default>
> > <PermissionSet class="System.Security.PermissionSet">
> > <IPermission
> > class="System.Security.Permissions.SecurityPermission"
> > version="1"
> > Flags="Execution"
> > />
> > </PermissionSet>
> > </Default>
> > </CustomAssemblies>
> >
> >
> > And the policy file rssrvpolicy.config is also modified:
> >
> > <CodeGroup class="UnionCodeGroup"
> > version="1"
> > PermissionSetName="FullTrust"
> > Attributes="LevelFinal"
> > Name="cmcs.wsclient"
> > Description="Codegroup generated by the .NET Configuration
tool">
> > <IMembershipCondition class="UrlMembershipCondition"
> > version="1"
> > Url="file://C:/Program Files/Microsoft SQL
> > Server/MSSQL/Reporting Services/ReportServer/bin/cmcs.wsclient.dll"/>
> > </CodeGroup>
> >
> > Any tips?
> >
> > Jonas
> >
> >
> >
>|||I've finally gotten the report to run in Report Server, but it took a while
and a nasty config to do it. It seems that the only way to get this to work
is to change the PermissionSet for Report_Expressions_Default_Permissions in
rssrvpolicy.config to FullTrust. I've tried to create a custom PermissionSet
with CASPOL where I ended up adding all permissions and setting them to
Unrestricted="true" thinking that I could then remove one at a time to
finally get a lower priviliege permission set, but the only thing that works
is FullTrust.
Is there someone else that have experienced the same thing?
Brgds
Jonas
"Jonas" <Jonas@.nospam.pl> wrote in message
news:%23YQR7hPIGHA.2212@.TK2MSFTNGP15.phx.gbl...
> After some more investigation, I found out that it is the following
> statement
> ws.Credentials = System.Net.CredentialCache.DefaultCredentials;
> I need this to get the web services to use the callers identity. The
> exception thrown is:
> Request for the permission of type
> System.Security.Permissions.EnvironmentPermission
> As before, it works in Report Designer so the code is alright, it is the
> security configuration that fails somewhere.
> /Jonas
> "Jonas" <Jonas@.nospam.pl> wrote in message
> news:ewR3eFOIGHA.1288@.TK2MSFTNGP09.phx.gbl...
> > I forgot to mention that I make an assert in code before the call to the
> web
> > service:
> >
> > WebPermission webPerm = new WebPermission(PermissionState.Unrestricted);
> > webPerm.Assert();
> > TIA
> >
> > Jonas
> >
> > "Jonas" <Jonas@.nospam.pl> wrote in message
> > news:%23Na2whMIGHA.376@.TK2MSFTNGP12.phx.gbl...
> > > Hi,
> > >
> > > I've got a custom assembly used in Rptsvcs that calls a web service on
> the
> > > local host. When run in Report Designer, it works as planned, but when
> run
> > > in Report Server, it doesn't call the web service. I have a
> > > HelloWorld-method in the custom assembly that works, so the assembly
is
> > > working but it can't call the web service.
> > >
> > > I have modified RSReportServer.config as follows:
> > >
> > > <CustomAssemblies>
> > > <Assembly Name="cmcs.wsclient, Version=1.0.xxx.xxxx,
Culture=neutral,
> > > PublicKeyToken=xxx">
> > > <PermissionSet class="System.Security.PermissionSet">
> > > <IPermission
> > > class="System.Security.Permissions.SecurityPermission"
> > > version="1"
> > > Flags="Execution, Assertion"
> > > />
> > > <IPermission
class="System.Security.Permissions.WebPermission"
> > > version="1">
> > > <ConnectAccess>
> > > <URI uri="$OriginHost$"/>
> > > </ConnectAccess>
> > > </IPermission>
> > > </PermissionSet>
> > > </Assembly>
> > >
> > > <Default>
> > > <PermissionSet class="System.Security.PermissionSet">
> > > <IPermission
> > > class="System.Security.Permissions.SecurityPermission"
> > > version="1"
> > > Flags="Execution"
> > > />
> > > </PermissionSet>
> > > </Default>
> > > </CustomAssemblies>
> > >
> > >
> > > And the policy file rssrvpolicy.config is also modified:
> > >
> > > <CodeGroup class="UnionCodeGroup"
> > > version="1"
> > > PermissionSetName="FullTrust"
> > > Attributes="LevelFinal"
> > > Name="cmcs.wsclient"
> > > Description="Codegroup generated by the .NET Configuration
> tool">
> > > <IMembershipCondition class="UrlMembershipCondition"
> > > version="1"
> > > Url="file://C:/Program Files/Microsoft SQL
> > > Server/MSSQL/Reporting Services/ReportServer/bin/cmcs.wsclient.dll"/>
> > > </CodeGroup>
> > >
> > > Any tips?
> > >
> > > Jonas
> > >
> > >
> > >
> >
> >
>|||Yes, I also had a heck of a time with this. We are calling a web service to
translate English to Spanish.
I ended up going the FullTrust route myself, still haven't tested on a clean
machine all the install and config steps I took.
Steve
"Jonas" <Jonas@.nospam.pl> wrote in message
news:ejM$u7RIGHA.376@.TK2MSFTNGP12.phx.gbl...
> I've finally gotten the report to run in Report Server, but it took a
> while
> and a nasty config to do it. It seems that the only way to get this to
> work
> is to change the PermissionSet for Report_Expressions_Default_Permissions
> in
> rssrvpolicy.config to FullTrust. I've tried to create a custom
> PermissionSet
> with CASPOL where I ended up adding all permissions and setting them to
> Unrestricted="true" thinking that I could then remove one at a time to
> finally get a lower priviliege permission set, but the only thing that
> works
> is FullTrust.
> Is there someone else that have experienced the same thing?
> Brgds
> Jonas
> "Jonas" <Jonas@.nospam.pl> wrote in message
> news:%23YQR7hPIGHA.2212@.TK2MSFTNGP15.phx.gbl...
>> After some more investigation, I found out that it is the following
>> statement
>> ws.Credentials = System.Net.CredentialCache.DefaultCredentials;
>> I need this to get the web services to use the callers identity. The
>> exception thrown is:
>> Request for the permission of type
>> System.Security.Permissions.EnvironmentPermission
>> As before, it works in Report Designer so the code is alright, it is the
>> security configuration that fails somewhere.
>> /Jonas
>> "Jonas" <Jonas@.nospam.pl> wrote in message
>> news:ewR3eFOIGHA.1288@.TK2MSFTNGP09.phx.gbl...
>> > I forgot to mention that I make an assert in code before the call to
>> > the
>> web
>> > service:
>> >
>> > WebPermission webPerm = new
>> > WebPermission(PermissionState.Unrestricted);
>> > webPerm.Assert();
>> > TIA
>> >
>> > Jonas
>> >
>> > "Jonas" <Jonas@.nospam.pl> wrote in message
>> > news:%23Na2whMIGHA.376@.TK2MSFTNGP12.phx.gbl...
>> > > Hi,
>> > >
>> > > I've got a custom assembly used in Rptsvcs that calls a web service
>> > > on
>> the
>> > > local host. When run in Report Designer, it works as planned, but
>> > > when
>> run
>> > > in Report Server, it doesn't call the web service. I have a
>> > > HelloWorld-method in the custom assembly that works, so the assembly
> is
>> > > working but it can't call the web service.
>> > >
>> > > I have modified RSReportServer.config as follows:
>> > >
>> > > <CustomAssemblies>
>> > > <Assembly Name="cmcs.wsclient, Version=1.0.xxx.xxxx,
> Culture=neutral,
>> > > PublicKeyToken=xxx">
>> > > <PermissionSet class="System.Security.PermissionSet">
>> > > <IPermission
>> > > class="System.Security.Permissions.SecurityPermission"
>> > > version="1"
>> > > Flags="Execution, Assertion"
>> > > />
>> > > <IPermission
> class="System.Security.Permissions.WebPermission"
>> > > version="1">
>> > > <ConnectAccess>
>> > > <URI uri="$OriginHost$"/>
>> > > </ConnectAccess>
>> > > </IPermission>
>> > > </PermissionSet>
>> > > </Assembly>
>> > >
>> > > <Default>
>> > > <PermissionSet class="System.Security.PermissionSet">
>> > > <IPermission
>> > > class="System.Security.Permissions.SecurityPermission"
>> > > version="1"
>> > > Flags="Execution"
>> > > />
>> > > </PermissionSet>
>> > > </Default>
>> > > </CustomAssemblies>
>> > >
>> > >
>> > > And the policy file rssrvpolicy.config is also modified:
>> > >
>> > > <CodeGroup class="UnionCodeGroup"
>> > > version="1"
>> > > PermissionSetName="FullTrust"
>> > > Attributes="LevelFinal"
>> > > Name="cmcs.wsclient"
>> > > Description="Codegroup generated by the .NET Configuration
>> tool">
>> > > <IMembershipCondition class="UrlMembershipCondition"
>> > > version="1"
>> > > Url="file://C:/Program Files/Microsoft SQL
>> > > Server/MSSQL/Reporting Services/ReportServer/bin/cmcs.wsclient.dll"/>
>> > > </CodeGroup>
>> > >
>> > > Any tips?
>> > >
>> > > Jonas
>> > >
>> > >
>> > >
>> >
>> >
>>
>|||When the report is deployed and run from the web server it runs under a
different set of user credentials to when it is in debug, (Probably "Local
System" or "Network Service", which ever user is configured to run the
reporting services?).
Try explicitly setting the network credentials like so..
ws.Credentials = new NetworkCredential(Username, Password, Domain);
I actually store my username/password/domain in a Settings file, to allow it
to be changed easliy.
This works for me when calling the reporting services web service, I am using:
1. Explicit credentials of a domain user that can access the web service,
2. set the rssrvpolicy.config, Report_Expressions_Default_Permissions -->
Full_Trust
Note I am running my assembly in the gac.
Hope this helps
John
Deploy with assembly error
Hello,
I have a reports with assembly.
While I try to deploy the report to my server I'm getting this error message:
Error 10 Error while loading code module: ‘Test.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null’. Details: Could not load file or assembly 'Test.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
I copy the dells using the assembly to the C:\Program Files\Microsoft SQL Server\MSSQL\Reporting Services\ReportServer\bin folder.
Thanks
Idan
Hi,this could be a problem with file-permissions. Check that your assembly inherits the permissions from the parent-folder.. Have you signed the assembly in the meantime? This could also be the cause..
Benni
|||
Thanks for the answer.
I have no problem with the permission and signed the assembly
|||Did you allow PartiallyTrustedCallers<Assembly: System.Security.AllowPartiallyTrustedCallers()> VB.NET
[Assembly: System.Security.AllowPartiallyTrustedCallers] C#.NET
and add a entry to rssrvpolicy.config?
|||Where should I allow PartiallyTrustedCallers|||Just add one of this lines (depending of your programming language) somewhere in your project
VB.NET: <Assembly: System.Security.AllowPartiallyTrustedCallers()>
C#.NET: [Assembly: System.Security.AllowPartiallyTrustedCallers]
deploy to another server
I do not have access to VS, but I hear it can do this... how can I do it without VS?
I am using CREATE ASSEMBLY to load dll form my server to SQLServer on my server (Same machine). How can I load the dll to another server? Do I have to write it on a directory on that server first? I tried to run the command from my pc connected to the other server, and I get a "cannot find file" error.
The FROM clause in CREATE ASSEMBLY can either take a path to the dll (which is what you are doing), but it can also instead of the path take the binary representation of the dll.
So in your case, you can either use a path which the remote server accesses and has permissions to - or you can take the binary representation of the assembly instead.
Niels
|||Thanks. How do I do that binary representation? All the documentation I see is about the path to the dll. I'm new to .net development so I don't know where to go for help.|||The syntax is
CREATE ASSEMBLY <asm_name> FROM 0x...
where 0x... is the hex binary representation.
The simplest way to get this is the use Management Studio. Choose the assembly in the object explorer, and click Script Assembly As -> Create To > New Query Editor Window. This will output the right syntax for you.
An alternative is code like below to convert the assembly to binary.
using System.IO;
using System;
using System.Text;
public class FileToHexBinary
{
public static void Main(String[] args)
{
FileStream fs = new FileStream(args[0], FileMode.Open);
int size = (int)fs.Length;
byte[] bytes = new byte [size];
fs.Read (bytes, 0, size);
fs.Close ();
StringBuilder builder = new StringBuilder(size * 2);
foreach( byte b in bytes)
{
builder.Append(b.ToString("x2"));
}
Console.WriteLine("0x" + builder.ToString());
}
}
Sunday, February 19, 2012
Deploy .NET Assembly with UDFs to a particular SCHEMA
However, you can execute any SQL script during the post deploy process in your SQL Server project as:
1. Write your script into a file called postdeployscript.sql:
2. Add the file to your project by right clicking your project in Solution Explorer and Add à Existing Item.
Make sure you add this in the root of the project and not in the Test Scripts. When you click deploy, Visual Studio will automatically run this scripts after the deployment of your project.
Same holds for predeployscript.sql if you want to execute a script on the SQL server before deployment.
These scripts can be used to automate something that Visual Studio does not currently support.
Thanks,
-Vineet.
postdeployscript.sql and predeployscript.sql are the things I dreamed about all the time
. You should definitely include them into default template of SQL Server Project, because I was searching for this solution for two months until I found this post. I asked similar question on the TechNet and the answer was just "you cannot do it".
Deploy .NET Assembly with UDFs to a particular SCHEMA
However, you can execute any SQL script during the post deploy process in your SQL Server project as:
1. Write your script into a file called postdeployscript.sql:
2. Add the file to your project by right clicking your project in Solution Explorer and Add à Existing Item.
Make sure you add this in the root of the project and not in the Test Scripts. When you click deploy, Visual Studio will automatically run this scripts after the deployment of your project.
Same holds for predeployscript.sql if you want to execute a script on the SQL server before deployment.
These scripts can be used to automate something that Visual Studio does not currently support.
Thanks,
-Vineet.
postdeployscript.sql and predeployscript.sql are the things I dreamed about all the time
. You should definitely include them into default template of SQL Server Project, because I was searching for this solution for two months until I found this post. I asked similar question on the TechNet and the answer was just "you cannot do it".