I am modifying a SSRS Report via VS2015 on my local machine. The rdl uses a custom assembly I get the error 'System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.' when trying to preview the report
I have the reference added to the report and added this section to RSPreviewPolicy.config and rssrvpolicy.config
<CodeGroup class="UnionCodeGroup"
version="1"
PermissionSetName="FullTrust"
Name="MyCustomCodeGroup"
Description="Code group for my data processing extension">
<IMembershipCondition class="UrlMembershipCondition"
version="1"
Url="C:\Reporting\SSRSAssemblyFile\ReportingDrawing.dll"/>
</CodeGroup>
Is there anything obvious I am doing wrong or anything else to try. The report does work on the SSRS server.
Thanks,
Hank
Related
I have an MVC web project that I am trying to host on godaddy using plesk for administration. My hosting settings for my web page is httpdocs\WebApplication18\WebApplication18/
I have pointed my web project to my configuration file inside WebApplication18.
Folder access to my files look like this:
Home Directory -> httpdocs -> WebApplication18 -> WebApplication18
-> views -> home -> Index.cshtml
-> web.conf
I am trying to browse to my index.cshtml page. I have set the root to run at WebApplication18 where
my configuration file is stored.
When I type in my hostname inside my address bar I recieve a file IO error that states:
Server Error in '/' Application.
Security Exception
Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.
Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) +0
System.Security.CodeAccessSecurityEngine.Check(CodeAccessPermission cap, StackCrawlMark& stackMark) +36
System.Security.CodeAccessPermission.Demand() +48
System.Web.HttpRuntime.get_AppDomainAppPath() +53
System.Web.WebPages.Deployment.PreApplicationStartCode.StartCore() +119
System.Web.WebPages.Deployment.PreApplicationStartCode.Start() +39
To begin with custom error mode was turned on, which I turned off in ASP.Nets
settings. I also commented out the compiler error in the web.conf file, which
reduced the error to a file io error.
The question I had was how can I point to my web page properly in my hosting settings
using mvc so that I can render my index.cshtml page using plesk on a godaddy server?
How am I able to fix this error message? I tried changing all of the permissions
lowered the CAS trust level and it makes no difference to the level of control
I have over my web page.
When I do a File Zilla upload sometimes I receive a certificate, but I just ignore
it and select ok.
This is only permission issue. Please kindly ask your provider to give full permission for you. It will fix your issue.
I'm trying to generate a PDF in memory to send it to a WS. This PDF should be created in memory (Stream) and in the Microsoft CRM "cloud" in a plugin code.
Is this possible?
In the plugin (already coded and deployed) I have this lines, the 3th fails
PdfDocument pdf = new PdfDocument();
PdfPage pdfPage = pdf.AddPage();
XGraphics graphics = XGraphics.FromPdfPage(pdfPage); //<-- ERROR
is this line of code trying to access a resource in the cloud that is not permitted/available?
this is the error:
Unexpected exception from plug-in (Execute): Plugins8.Plugin: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
any ideas?
I assume you are using PDFsharp and you have its libraries merged into your plugin assembly using ILMerge.
If so, the SecurityException can be caused by PDFsharp using GDI+. In partial trusted app domains drawing graphics with GDI+ is not allowed. You can however compile PDFsharp for WPF. Try compiling PDFsharp with directives WPF plus (maybe) SILVERLIGHT.
my web app is using MVC3 with razor
If I am trying to read anything from ServiceConfig using RoleEnvironment.GetConfigurationSettingValue("senderName")
I am getting error related to Microsoft.IdentityModel
Unable to find assembly 'Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Runtime.Serialization.SerializationException: Unable to find assembly 'Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[SerializationException: Unable to find assembly 'Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.]
System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) +4727747
System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) +1725
System.AppDomain.get_Id() +0
<CrtImplementationDetails>.DoCallBackInDefaultDomain(IntPtr function, Void* cookie) +185
<CrtImplementationDetails>.LanguageSupport._Initialize(LanguageSupport* ) +328
<CrtImplementationDetails>.LanguageSupport.Initialize(LanguageSupport* ) +102
[ModuleLoadException: The C++ module failed to load while attempting to initialize the default appdomain.
]
.
It's true that I am making use of Windows identity foundation for Azure acs authentication .But everything worked fine when I deployed to azure.But if I make use of RoleEnvironment to read any settings from my ServiceConfig files (for ex :RoleEnvironment.GetConfigurationSettingValue("Smtpserver")) .Its failing on azure .
But everything workes fine on my local azure appfabric .If I am removing this line of code ,then all workes fine .RoleEnvironment.GetConfigurationSettingValue("Smtpserver"))
I am using two webroles in my cloud app.
Please help me identify the cause of error
How did you installed the WIF on the Azure?
The most reliable way is to have the WIF runtime installed via a startup task. You check out this question here. And I think this one is exact duplicate.
I had to customize the class MembershipProvider for the user validation is done by email.
But when you open the Asp.net Web Site Administration Tool, the "Security" tab the following error:
There is a problem with your selected data store. This can be caused
by an invalid server name or credentials, or by insufficient
permission. It can also be caused by the role manager feature not
being enabled. Click the button below to be redirected to a page where
you can choose a new data store.
The following message may help in diagnosing the problem: Type is not
resolved for member
'System.Data.Entity.ModelConfiguration.ModelValidationException,EntityFramework,
Version=4.1.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
Because the code is great and not to pollute the topic, I put on github.
Code:
https://gist.github.com/1146084
While I am still new to MVC 3 and EF 4.1, try adding a line in your web.config for EntityFramework assembly. It seems like I had this problem as well with my setup. I can't remember the exact line, but it's something like (I will look it up when I get home):
<add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
I Create new Project ASP.NET MVC 3 RTM and Replace References for
using ASP.NET MVC 3 Source code
but When I run project again, get this exception:
[A]System.Web.WebPages.Razor.Configuration.HostSection
cannot be cast to
[B]System.Web.WebPages.Razor.Configuration.HostSection.
Type A originates from
'System.Web.WebPages.Razor,
Version=1.0.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35' in
the context 'Default' at location
'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.WebPages.Razor\v4.0_1.0.0.0__31bf3856ad364e35\System.Web.WebPages.Razor.dll'.
Type B originates from
'System.Web.WebPages.Razor,
Version=1.0.0.0, Culture=neutral,
PublicKeyToken=null' in the context
'Default' at location
'C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary
ASP.NET
Files\root\2505c7ee\369315c5\assembly\dl3\f7bae428\d03eeed8_85bbcb01\System.Web.WebPages.Razor.DLL'.
Description: An unhandled exception
occurred during the execution of the
current web request. Please review the
stack trace for more information about
the error and where it originated in
the code.
Source Error:
Line 106: internal static RazorWebSectionGroup GetRazorSection(string virtualPath) {
Line 107: // Get the individual sections (we can only use GetSection in medium trust) and then reconstruct the section group
Line 108: return new RazorWebSectionGroup() {
Line 109: Host = (HostSection)WebConfigurationManager.GetSection(HostSection.SectionName, virtualPath),
Line 110: Pages = (RazorPagesSection)WebConfigurationManager.GetSection(RazorPagesSection.SectionName, virtualPath)
Source File:
E:\GreenTour\webpages\src\System.Web.WebPages.Razor\WebRazorHostFactory.cs
Line: 108
This error means that part of your application is being compiled using your own copy of the source code as a reference while at runtime its finding the reference assemblies in the GAC. Make sure you remove all references to the GACed version of MVC 3 assemblies. This includes a number of things in your web.config files that use this public key token: 31bf3856ad364e35.
I just came across the same problem whilst upgrading my app, the problem was in the web.config file located in the views directory, I blindly copied this over from the old app (my bad).
My solution , create a new MVC 4 app and copy the web.config from the views directory to your app thats having the problem.
Hope this helps
Although the above thread was useful. I could not get things working until I created a 'dummy' 'basic' MVC 4 application and then compared the web.configs to find any changes.
I fixed this not by removing all references to assemblies with the public key of 31bf3856ad364e35 as this covers a lot of irrelevant assemblies.
Instead it should be fixed by updating all configuration references
System.Web.Mvc to 4
System.Web.WebPages to 2
System.Web.WebPages.Razor to 2
Be sure to update all the web.configs, including the ones in View directories.