Solved

Security Exception on ASP.Net application on SharePoint

Posted on 2009-05-15
5
725 Views
Last Modified: 2012-05-07
OK. I developed an ASP.Net application and deployed it on a SharePoint server by creating a Virtual Directory under the 80 hive of the SharePoint site. It is working fine on my dev box. When I deploy (pre-compiled app through Visual Studio 2008), I get the following error trying to access the aspx page
System.Security.SecurityException: Request for the permission of type 'System.Diagnostics.EventLogPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

Just to make sure that the VirtualDirectory was setup correctly, I created an HTML file on the same location and it opens up fine. But ASPX pages throw the above exception.

Any clue?

Thanks
JS
0
Comment
Question by:jimmysaunders
  • 3
5 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 24402228
ASP.NET web sites run in a medium trust environment.  Why are you accessing the event log from the ASP.NET web site?  What does the development web site run as compared to the production web site (IIS5, IIS6, IIS7, Web Development Server...)?
0
 

Author Comment

by:jimmysaunders
ID: 24405001
My code is not trying to access the event log.

Both the sites are running IIS6.
0
 
LVL 51

Expert Comment

by:Ted Bouskill
ID: 24407017
I think this is doomed for failure.  Have you read any articles about mixing ASP.NET and Sharepoint applications?  There are very few ways to do it.  ASP.NET and Sharepoint use two different ISAPI DLL's to process page requests so they are in completely different application, thread pools and memory spaces.

You can deploy virtual directories on the web front-end servers that host ASP.NET applications but do not put the files in the 12 hive folder.

Can you give me more insite into what you are trying to achieve.  Maybe there is another way.
0
 

Author Comment

by:jimmysaunders
ID: 24407189
Thanks Tedbily for your comments.

I am not adding any files under 12 hive. I have a very simple ASP.Net application that is invoked through a simple window.open method from a button in a web part. I have the virtual directory under the 80 hive and somehow it is working without any problem on the development machine with SharePoint. Its the staging environment that is giving me trouble.
0
 

Accepted Solution

by:
jimmysaunders earned 0 total points
ID: 24407392
Alright, I solved the problem with the help of the following article

http://msdn.microsoft.com/en-us/library/ms998341.aspx

I had to change the SharePoint custom manifest and that solved the issue.
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For SharePoint sites, particularly public-facing ones, there are times when adding JavaScript, Meta Tags, CSS Styles or other content to the page <head> section is more practical than modifying master pages.  For instance, you could add the jQuery l…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now