IPCChannel : Access Denied - Solution

Posted by: Sahil Malik [MVP], on 20 Jul 2005 | View original | Bookmarked: 0 time(s)

Allright folks (I'm sleeping after this one).

So .NET 2.0 Remoting has this new fancy channel called IPC Channel, basically this addresses the biggest criticism of .NET 1.1 remoting that for communication on the same box, you still need to go over the TCP stack (unless of course you made it even worse and used the HttpChannel instead).

I have blogged before about IPC Channel about how awesome the performance implications were. But here's the deal, put the client in an ASP.NET app talking to a windows service, and bingo - Access Denied. Well this happens because your windows service is running as a different user, and ASPNET as another user. In fact, if instead you were to use a console application running as administrator (and if that is you in development, then shame on you), and try and connect to the Windows Service - you would still get that error (assuming the service is running as a different user).

So whats it mean Well, you simply need to say/express to the framework "This group of users has access to this IPC Channel" when you declare the server channel. This can be done in 2 ways.

1. Config file - <channel ref=ipc portName=testPipe authorizedGroup=authorizedUserGroupName />

or

2. The constructor of IPCServerChannel that accepts properties as IDictionary - pass in a authorizedGroup property in the hashtable with value set to the windows group (authorizedUserGroupName as per the above) that has access to the IPC Channel. Now make sure your ConsoleApp or ASPNET Application pool is running as a user that is a part of that windows group and bingo -

NO MORE ACCESS DENIED :-) . Heh !! cool huh

Allrighty, I'm off to snoresville!!!

Category: ASP.NET | Other Posts: View all posts by this blogger | Report as irrelevant | View bloggers stats | Views: 6830 | Hits: 62

Similar Posts

  • Business Apps Example for Silverlight 3 RTM and .NET RIA Services July Update: Part 26: Authentication and Personalization more
  • Quick Reference Guide for Telerik Support more
  • Is Silverlight 2 ready for the Enterprise solution? more
  • UppercuT - Automated Builds - VersionBuilder more
  • Application Architecture Guide 2.0 more
  • What's for VB.NET in the Future, interesting to see... more
  • Cache Or Session State - Similar But Different more
  • C# GridView Sorting/Paging w/o a DataSourceControl DataSource more
  • SharePoint Deployment Planning Services (SDPS) Released more
  • Accessing the ASP.NET Authentication, Profile and Role Service in Silverlight more

News Categories

.NET | Agile | Ajax | Architecture | ASP.NET | BizTalk | C# | Certification | Data | DataGrid | DataSet | Debugger | DotNetNuke | Events | GridView | IIS | Indigo | JavaScript | Mobile | Mono | Patterns and Practices | Performance | Podcast | Refactor | Regex | Security | Sharepoint | Silverlight | Smart Client Applications | Software | SQL | VB.NET | Visual Studio | W3 | WCF | WinFx | WPF | WSE | XAML | XLinq | XML | XSD