?
Solved

Security Exception on ASP.Net application on SharePoint

Posted on 2009-05-15
5
Medium Priority
?
743 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Summary In SharePoint 2010 it is easy to create custom color themes to jazz up a site. Theme colors can also be created in PowerPoint 2010 with a few clicks. But how do the chosen colors actually look in the SharePoint site? The attached PowerPoint…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

770 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