Solved

Security Exception on ASP.Net application on SharePoint

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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Suggested Solutions

Note:  There are two main ways to deploy InfoPath forms:  Server-side and directly through the SharePoint site.  Deploying a server-side InfoPath form means the form is approved by the Administrator, thus allowing greater functionality in the form. …
In case you ever have to remove a faulty web part from a page , add the following to the end of the page url ?contents=1
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

726 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