search web part security error net 2008 search server express

Discussion in 'ASP .Net' started by cindy, Aug 14, 2009.

  1. cindy

    cindy Guest

    I am trying to build a web part search box for search server 2008 express
    using net 2008 I created web control implements web part not deployed to gac
    it has been added as safe control to web config and dll with pdb are in
    C:\Inetpub\wwwroot\wss\VirtualDirectories\881\bin

    To AssemblyInfo.cs I have added
    using System.Security;
    and
    [assembly: AllowPartiallyTrustedCallers]

    I have also added additional web.config inside the application with
    <system.web>
    <trust level="Full" originUrl="" />

    when code executes at
    line kRequest = new KeywordQuery(ServerContext.Current);
    I get this error How do I fix?

    System.Security.SecurityException was unhandled
    Message="Request for the permission of type
    'System.Security.Permissions.RegistryPermission, mscorlib, Version=2.0.0.0,
    Culture=neutral, PublicKeyToken=b77a5c561934e089' failed."
    Source="mscorlib"
    StackTrace:
    at System.Security.CodeAccessSecurityEngine.Check(Object demand,
    StackCrawlMark& stackMark, Boolean isPermSet)
    at System.Security.CodeAccessPermission.Demand()
    at Microsoft.Win32.RegistryKey.CheckSubKeyReadPermission(String
    subkeyName)
    at Microsoft.Win32.RegistryKey.CheckOpenSubKeyPermission(String
    subkeyName, Boolean subKeyWritable)
    at Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean
    writable)
    at Microsoft.Win32.RegistryKey.OpenSubKey(String name)
    at Microsoft.Office.Server.Search.Query.CommandCreator..ctor()
    at
    Microsoft.Office.Server.Search.Query.Query.FinishConstruction(String appName)
    at Microsoft.Office.Server.Search.Query.Query..ctor(ServerContext
    serverContext)
    at
    Microsoft.Office.Server.Search.Query.KeywordQuery..ctor(ServerContext
    serverContext)
    InnerException:
    --
    cindy
    cindy, Aug 14, 2009
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. brooksr
    Replies:
    3
    Views:
    326
    Jon Paal
    Dec 24, 2006
  2. HRsoft Informática

    Visual Web Express 2008 X Visual Studio Pro 2008

    HRsoft Informática, Jun 8, 2008, in forum: ASP .Net
    Replies:
    3
    Views:
    699
    Cowboy \(Gregory A. Beamer\)
    Jun 9, 2008
  3. AAaron123
    Replies:
    6
    Views:
    2,483
    AAaron123
    Oct 28, 2008
  4. Chen
    Replies:
    4
    Views:
    1,366
  5. Jake Henderson

    Visual Web Developer 2005 Express and SQL 2005 Express

    Jake Henderson, Mar 10, 2006, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    214
    Jake Henderson
    Mar 10, 2006
Loading...

Share This Page