Solved

Security Exception on ASP.Net application on SharePoint

Posted on 2009-05-15
5
719 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
Comment Utility
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
Comment Utility
My code is not trying to access the event log.

Both the sites are running IIS6.
0
 
LVL 51

Expert Comment

by:tedbilly
Comment Utility
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
Comment Utility
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
Comment Utility
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

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

SharePoint Designer 2010 has tools and commands to do everything that can be done with web parts in the browser, and then some – except uploading a web part straight into a page that is edited in SPD. So, can it be done? Scenario For a recent pr…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

744 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

11 Experts available now in Live!

Get 1:1 Help Now