How To Create ActiveX Security Exception
Jan 19, 2010try to create a activex. if i use printdocument class it will throw security exception on client side. how to assign print permission for a assembly?
View 1 Repliestry to create a activex. if i use printdocument class it will throw security exception on client side. how to assign print permission for a assembly?
View 1 RepliesCurrently I have written the Activex Control for RFID USB reader and calling that one in ASP.NET web application. The Activex Control is working fine when I will give the full trust permission for particular IIS URL in
1. Open Control Panel > Administrative Tools > .NET Framework 2.0 Configuration
2. Expand Runtime Security Policy > Machine > Code Groups > All_Code
3. Right Click All_Code and click New...
4. Create a new code group, I named mine MyProject_FullTrust_Zone
5. Choose the URL condition type and specify the path on the network where the apps will be deployed.
6. Choose Use Existing permission set, and set it to Full Trust.
Alternative way of giving permission for an Activex Control is
1. Open Visual Studio Command Prompt
2. Run the command caspol -machine -addgroup 1. -site <ip address> FullTrust Doing this it works fine.
Whenever my web site will open, it will ask the user to give permission for the Activex Control using Allow or Cancel Button in browser. This type of functionality I have seen some web site which takes input from the user to allow the ActiveX Control.
I have been working on an asp.net web application that calls a third party COM application through createObject method. The application works fine (gets initialized) in Win XP but I am having problems getting it to work in WIndows 2003. I get the "Cannot create ActiveX component" error.
The website works fine in visual studio - the application launches fine. The references added were the interop assemblies which were packed inside a tlb file.
I am aware of the change in default user - ASPNET for iis 5 and Network Service for IIS 6.0. Also I have changed the default permission levels in DCOM config for not just this COM application but all the COM applications by changing the default COM security properties of the computer. I gave almost every user the permissionto launch and access remotely including Network service and everyone.
The other thing I have done was to test it out in IIS 5.0 isolation mode but couldn't get the application work - still same error.
The final thing I have tried was to use IIS 6.0 itself but change the application pool to local system and I am just stumped that even this didn't resolve the error.
Another thing to add is that I cannot register the tlb file using regsvr32.exe command as it is not a dll.
I have spent last couple of days on this subject but no luck :)
I want to achive following using VS2008/C# -
1. create a cab file using existing AciveX/ocx control,
2. use the ActiveX on ASP.NET WebForm.
3. deploy the app and cab file on web server
4. Test/verify that the cab file get downloaded, and IE can use my ActiveX/ocx
I found one nice tutorial on this but it is with VB.Net (not VS2008) -
[URL] (the problem I get with VS2008 - can's see Authenticode Signing check box, or add ActiveX to Toolbox).
I have a website that needs me to use ActiveX. and there is a security policy in my office that needs me to DIGITALLY SIGNING the ActiveX ?[URL]but still couldnt understand what is the actual step that i should do. plus , the link is broken. does anyone know how to do it ?
View 1 RepliesSo I have written as part of an application some code that on my clients website pulls some information from SQL server and uses it to create a new file using a Word with bookmarks as a template. It works fine on my development machine, but not on my production server with the error: "Cannot create ActiveX component.: Word.Application". Now I have been approaching this as if it is an issue with Office, but it occurred to me that this might be another issue. Maybe some security issue with ASP.NET? My original thought was it was some kind of compatibly problem as I had Office 2007 on my machine and 2010 on the server.
Code:
Protected Sub btnCreate_Click(sender As Object, e As System.EventArgs) Handles btnCreate.Click
Dim objWord As Object
Dim objDoc As Object
Dim strContractFile As String = "~Documents" & txtContractFile.Text
Dim strContractFilePath As String = Server.MapPath(strContractFile)
[Code] .....
I need a multiple file uploader dialog,that means I can able to select multiple files at a time in file upload window.How can I achieve this task? I gone through Google and I came to know that we can achieve this using silverlight and flash plugins,but these are not recomandable in my application. Is there any open source(i.e free) ActiveX controls for Multi file Uploader? Is it possible to create own ActiveX control to achieve this task.
View 4 RepliesMy name is Christian, I developed a web application in VB.NET 2005 that calls a Microsoft Word Application, it works fine in my develop's machine but when I put all of the code in production's server I received the following error:System Error: Cannot create activex component. following I put the code. If somebody knows how to solve this,
Dim oWord As Microsoft.Office.Interop.Word.ApplicationDim oDoc
As Microsoft.Office.Interop.Word.DocumentDim oTable
As Microsoft.Office.Interop.Word.TableDim oPara0
As Microsoft.Office.Interop.Word.ParagraphDim oPara1
As Microsoft.Office.Interop.Word.ParagraphDim oPara2
As Microsoft.Office.Interop.Word.ParagraphDim oPara3
As Microsoft.Office.Interop.Word.Paragraph, oPara4
As Microsoft.Office.Interop.Word.Paragraph
oWord = CreateObject("Word.Application")
oWord.Visible = True
oDoc = oWord.Documents.Add
oPara0 = oDoc.Content.Paragraphs.Add
oPara0.Range.Text = "Hola"
oPara0.Range.InsertParagraphAfter()
Error:
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.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.Local its run fine. when i place in iis. it throw this exception.
I have created user web control library project and these controls i'm using in my web application. These User controls just works fine in my local machine but when i moved this project(including Library) to our Local server , it is throwing security exception
Error 1 Cannot register assembly "LocalServerLibraryDemoLibraryDemoLibraryinDebugLibrary.dll". Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. Library
Anybody knows why this error occuring...?
I am trying to implement the Ajax HtmlEditor into my application. I currently am using a regular TextBox to load and save some data to some EMail template files and had to do some work-arounds to get it to accept the HTML Input. I am trying to upgrade it to use the Editor, but as soon as I insert the Editor and do a PostBack, I receive the Security Exception below. There is absolutely no change to the code-behind, so I don't understand the issue. There is so little on Google for the Version 3.5 Editor that I'm stumped. I have Debugging enabled, but it won't give me the Soruce Error either.
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 failed. Source Error:
[Code]....
:: REMOVED FOR SIMPLICITY :: Stack Trace:
[Code]....
how can we create our own exception message ? for example i want to disply the message "Database Is not Connected" on the intrupption of database connectivity.
View 6 RepliesHow i create a exception in location to allow access to page GanttViewer.aspx with other rol and others pages only with Admin rol
<location path="Admin">
<system.web>
<authorization>
<allow roles="Admin"/>
<deny users="*"/>
</authorization>
</system.web>
</location>
to create an exception forhtmlencode function?i mean for example for these two <br /> / &nbps;. i need to preserve html break line and space character. bu if user type something like <script></script> sure i need to encode for security...
View 5 RepliesI'm getting this exception randomly in one webservice, it used to happen in the first call only, and in the second calls and so on it works fine ... and after a while without use the webservice it happens again. It seems to be that when the AppDomain is not loaded, the first time fails... and subsequent calls are ok; when IIS shutdown the AppDomain... the next call will fail again.
[code]....
I have added a service from a Win2003 server to my Visual Studio project on WinXP machine. Create an oject for this service went OK. But when I tried to run a method in the service I get "401 web exception while accessing a service.".
How to proceed?
a C# file in my App_Code folder calls a C++ DLL that is in my BIN folder. I am getting following error:
Security Exception
Description:
The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission contact your system administrator or change the application's trust level in the configuration file.
Exception Details: System.Security.SecurityException:
System.Security.Permissions.SecurityPermission
I hosted my application on GoDaddy shared server. They are not allowing me to give full trust to the application by changing setting in my application's web.config file.
I have hosted my website on godaddy and referenced MYSQL.Data.dll. This works fine on localhost. However when i try to run the same code online it throws the following error. System.Security.SecurityException: That assembly does not allow partially trusted callers.
I have downloaded the MqSQL.Data code version 6.2.4. which already has using System.Security; and [assembly: AllowPartiallyTrustedCallers()].
In the website that I'm developing, I need to send email via GMail for certain cases such as "forgot password". It's working properly on my PC but when I upload it to the server (which has windows 2003 running) I get the the following exception:
Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
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.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Source Error:
[Code]....
Stack Trace:
[Code]....
I'm developing a usercontrol to use in SharePoint, and I think I need to use framework 3.5.
If I create a new web application targeting 3.5 and try to run it, I get this:
Code:
[SecurityException: Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
I'm using file system run locally
I am writing queries with CONVERT function. I have more than 200 columns in query. I am processing each row and write it to file.I need to log all errors occured during process. I need to capture column which is causing exception (Arithmetic overflow error converting numeric to data type varchar.) and log it in other file and send to administrator.
How can I get Column which is causing exception?
I am using MVCcontrib grid in my application. Everything works fine on my dev machine. When I publish it to the server and navigate to the page that renders the grid I am getting this error 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.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. and the source of the error is shown as <%= Html.Grid(Model).Columns(column => {i have added
[Code]....
to the web.config but still get the error
</textarea></p>
<input type='hidden' name='ID[9]' value='93970' />
<input type='hidden' name='URL[9]' value=[URL]/>
<input type='hidden' name='CAT[9]' value='DataSource Controls' />
<input type='hidden' name='BOARD[9]' value='microsoft' />
<input type='hidden' name='P_DATE[9]' value='Jan 12, 2010 09:43 PM' />
<input type='hidden' name='RANDOM[9]' value='BcIlUOXzN' />
<input type='hidden' name='REPLIES[9]' value='3' />
<input type='hidden' name='USER[9]' value='aziz' />
<p><input class=subject type='text' size='90' name='SUBJECT[9]' value='DataSource Controls :: LINQ using stored procedures and MvcContrib Grid with pagination' /><select name='INDEXED[9]'><option value='1' selected>UPDATE</option><option value='2'>DELETE</option></select>Jan 12, 2010 09:43 PM - Replies: 3 CAT: DataSource Controls<a target=_blank href=[URL]>View</a></p>
<p> <textarea rows=10 cols=100 name='POST[9]' onfocus='setSelRange(this, 0, 0)'/>All,
I have been chasing this erorr all day and coming up blank. I created a stored proceudre(fairly complicated logic), added it to the context, and set the return type to a specific entity type.
It generated this:
[Function(Name="dbo.usp_ServiceTemplateSelectByFkID")]
public ISingleResult<ServiceTemplate> usp_ServiceTemplateSelectByFkID([Parameter(Name="FkId", DbType="Int")] System.Nullable<int> FkId)
{
IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), FkId);
return ((ISingleResult<ServiceTemplate>)(result.ReturnValue));
}
I call it from my service with the following method:
public ISingleResult<ServiceTemplate> GetByFkId(int FkId)
{
return Db.usp_ServiceTemplateSelectByFkId(FkId);
}
I have tested the stored procedure and it returns the results I want. When I make the service call from the controller, it doesn't error out, however, it should return 4 records in this instance and instead, it returns the same 4 records (repeating the first record 4 times). .........
After moving my web site from my local development environment to a shared host I get:
Security Exception
Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission your system administrator or change the application's trust level in the configuration file.
The problem occurs in my web application everywhere the following is called:
WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath)
Since my web application is only trying to open it's own web.config file, I don't know why this is flagged as a security exception. Maybe someone can explain... But more importantly I need a solution, the couple solutions I found via Google are painful.
I have (pretty much) the following code in my protected void Application_Error(object sender, EventArgs e) method in Global.asax....
Exception ex = Server.GetLastError();
if (ex is
System.Security.SecurityException)
Response.Redirect("Logon.aspx");
else
Response.Redirect("ErrorPage.aspx");
If I navigate to a page before I log on the exception is caught and I am redirected to Login.aspx as I would expect. However, this is only working when debugging using VS on my local machine.When uploaded to the live environment, the exception is not caught and the user is presented with "Security Exception - Request for principal permission failed."
Using Visual Studio 2005 to create a test ASPX Page using Visual Basic.Simply trying to open an existing file that exists on the particular directory where the ASPX files and the web.config file has been copied. If we run the ASPX page on the Local Host of the Development PC, it works just fine.However when the same page is uploaded to the GoDaddy Site using ASP 2.0, we are seeing the following error:
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181
ystem.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
Version Information: Microsoft .NET Framework Version:2.0.50727.3615; ASP.NET Version:2.0.50727.3053
[code]...