DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2005

    Question how to remove message Access denied on creating new object

    hello dear,

    i am learning component development in C#.i create my own class library with name HelloWorl.Dll.
    in this, i create a class MyComponet. i am using it in window based application in C#.
    by including all rererences System.EnterpriseServices and Dll file. but when i create new object of that component it will give Exception
    Acess is Denied on this line
    HelloWorld.MyComponent obj = new HelloWorld.MyComponent();

    And in stack trace. it give the information.

    at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode, IntPtr errorInfo)
    at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode)
    at System.EnterpriseServices.Thunk.Proxy.CoCreateObject(Type serverType, Boolean bQuerySCInfo, Boolean& bIsAnotherProcess, String& uri)
    at System.EnterpriseServices.ServicedComponentProxyAttribute.CreateInstance(Type serverType)
    at System.Runtime.Remoting.Activation.ActivationServices.IsCurrentContextOK(Type serverType, Object[] props, Boolean bNewObj)
    at HelloClient.Form1.cmdWakeUp_Click(Object sender, EventArgs e) in d:\ankush\books\course cds\bulding com+ application\practices\cs\mod02\solution\helloclient\form1.cs:line 104

    So plz help me how i can use my Dll file and remove this Exception.

    waiting for ur reply.......


  2. #2
    Join Date
    May 2005
    "c:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Bin"\tlbimp.exe "the path of your dll" /out:new dll name /namespace:<any namespace you want>

    This tlbimp.exe is a part of the SDK and is read Type LiBrary IMPort utility also
    A dll of written in a platform other than .Net can be wrapped around with a .Net class

    The resulting dll is something you can reference directly and start using it

    If that still gives the same error , there is something wrong with your dll..

    refer tlbimp /? at th VS.net command prompt

Similar Threads

  1. Replies: 0
    Last Post: 08-29-2002, 09:40 AM
  2. Validating XML
    By Jaco de Villiers in forum XML
    Replies: 1
    Last Post: 06-01-2001, 05:50 PM
  3. Access denied
    By Mike C. in forum VB Classic
    Replies: 4
    Last Post: 12-18-2000, 02:33 PM
  4. creating a dynamic object based upon a variable???
    By Patrick Buchanan in forum ASP.NET
    Replies: 3
    Last Post: 11-29-2000, 12:06 PM
  5. Access denied to preserve.web
    By Phil Haack in forum ASP.NET
    Replies: 3
    Last Post: 11-11-2000, 03:10 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.