Solved

Security Exception on ASP.Net application on SharePoint

Posted on 2009-05-15
5
738 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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

The vision: A MegaMenu for a SharePoint portal home page The mission: Make it easy to maintain. Allow rich content and sub headers as well as standard links. Factor in frequent changes without involving developers or a lengthy Dev/Test/Prod rel…
We had a requirement to extract data from a SharePoint 2010 Customer List into a CSV file and then place the CSV file into a directory on the network so that the file could be consumed by an AS400 system. I will share in Part 1 how to Extract the Da…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

717 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