Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 970461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T02:48:30+00:00 2026-05-16T02:48:30+00:00

I created my custom assembly that has a simple HttpModule in it that I’d

  • 0

I created my custom assembly that has a simple HttpModule in it that I’d like to use in my Sharepojnt 2010 site.

I added my module to sharepoint site’s web.config/system.webServer/modules section.

I then also copied my DLL directly to bin folder since that’s how suual asp.net applications work. I got an exception about failed AspNetHostingPermission.

I copied the same DLL to _app_bin folder and it worked. My module did get initialized and was running.

I then added two permissions to my module class:

[AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]

and also added these two to assembly

[assembly: SecurityPermission(SecurityAction.RequestMinimum, Execution = true)]
[assembly: AllowPartiallyTrustedCallers]

and strongly signed my assembly with a key I created.

Then I copied the DLL back to bin but it still didn’t work. Copying it to _app_bin worked.

What do I have to do, to deploy my DLL directly to bin folder?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T02:48:31+00:00Added an answer on May 16, 2026 at 2:48 am

    The problem you’re running into is that SharePoint is using Code Access Security (CAS) to make it possible for really well educated Admins to make sure that they don’t put their environment to unnecisary risk when adding functionallity to it.

    The problem is then that even though CAS has been in .Net since the beginning nearly nobody has used it before SharePoint, so most developers don’t know how to deal with it.

    Everything in _app_bin is running with full trust, which explains why your dll works there.

    Everything in bin is running with a lot less trust depending on the trust level specified in web.config (in fact this is also the one that specifies _app_bin has full trust, but thats common in all of the out of box trust levels).

    In order to get your dll to work from bin (without changing trust level to full which is bad) you need to modify the policy file which the trust level is pointing to with the right xml for the right your dll need.

    Adding the attributes don’t help you directly, initially they in fact just makes the problem worse, because now your dll demands the rights even though it might not call anything which requires them.

    Where the attributes help you is if you use WSPBuilder to build your WSP package for deploying to SharePoint (You’re using a WSP right), then it’ll look for security attributes and make the corresponding entries in manifest.xml which then get SharePoint to add the corresponding entries to the policy file on deployment.

    In order for you attributes to work with WSPBuilder I think they have to be changed to SecurityAction.Demand though.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've created a custom workflow activity for TFS 2010 to customize the assembly versioning.
Suppose I created a custom web application that consists of: several assembly DLLs: web
I have created custom posts and I want one page in my site to
I have an ASP.NET GridView which has columns that look like this: | Foo
I have created a custom SharePoint web service that was deployed to, and successfully
I have a few custom controls that were created as Server Controls projects. I
I've created a simple custom timer job for Sharepoint by using the template i
I have a custom tracking service that has been running for a while now
I have a custom workflow activity assembly that is referenced by two workflows. The
I created custom adapter for listview which contain text and images, on click of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.