ooto.info

Finally up on CS2007 - getting ready for 2008 - it is AMAZING!

Custom Apps within Community Server

A few months ago, a client of mine asked for the ability to host a custom app from within their Community Server deployment.  Well, I got to working with TheMan and we built a web.config that basically restored the settings in a virtual directory within a CS deployment to the defaults for ASP.Net.

So - first, here's the requisite HelloWorld program.

How'd we do it - basically, we're going to reset, remove, clear, add:

  • Remove alll of the added assemblies by name.
  • Reset the page base type (if you're running ASP.Net 2.0)
  • Reset your custom errors
  • Remove httpModules
  • Remove httpHandlers
  • Reset your Authentication
  • Clear membership, role and profile providers and add your defaults from your machine.config

That's it - good luck!

You want more detail?  Ok - this article was written for a CS2.1.60809.935 running on ASP.Net 2.0.

In my web.config (which should be the one that comes with the CS2.1 download - a copy is available here), starting at the top, we find:

<compilation defaultLanguage="c#" debug="false">
     <assemblies>
          <add assembly="MemberRole, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b7c773fb104e7562"/> 
     </assemblies>
</compilation>

My helloworld app isn't going to use MemberRole, so let's kill it.  Take the web.config for your custom app and put in:

<compilation defaultLanguage="c#" debug="true"
     <assemblies
          <remove assembly="MemberRole, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b7c773fb104e7562"/> 
     </assemblies>
</compilation>

I use copy/paste.  If you're an old unix geek you can s/add/remove and you're set.

Continuing on... we find:

<pages validateRequest="false" enableEventValidation="false" autoEventWireup="true" pageBaseType="CommunityServer.Components.CSPage, CommunityServer.Components"/>

My helloworld app isn't going to use CommunityServer.Components.CSPage, etc, so let's kill it...  But what is the default pageBaseType?  Well - the Page class belongs to "System.Web.UI" so you can set this to System.Web.UI.Page.

Moving on...  Next I run into <httpModules> and <httpHandlers>.  Here, you just need to "remove" all of the custom settings:

<httpModules>
     <remove name="CommunityServer" />
     <remove name="CSProfile" />
     <remove name="CSRoleManager" />
</httpModules>

<httpHandlers>
     <remove verb="GET" path="Utility/redirect.aspx" />
     <remove verb="GET" path="aggbug.aspx" />
     <remove verb="GET" path="avatar.aspx" />
     <remove verb="GET" path="vcard.aspx" />
     <remove verb="GET" path="r.ashx" />
</httpHandlers>

Now we get into the custom providers that CS uses.  Luckily, there's a lovely <clear /> statement that we can use to blow away all of the providers.  This is a problem, though, because ASP.Net loads some default providers.  We need to add them back but I don't know off the top of my head what they are.  When in doubt, look at your microsoft.net/framework/CONFIG directory for the default setting.  Doing so, I find default membership, profile and roleManager providers in my machine.config and add the following lines to the end of my custom app's web.config and we're done!

 

  • <membership defaultProvider="AspNetSqlMembershipProvider">
    • <providers>
      • <clear />
      • <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="LocalSqlServer" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" applicationName="/" requiresUniqueEmail="false" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="7" minRequiredNonalphanumericCharacters="1" passwordAttemptWindow="10" passwordStrengthRegularExpression="" />
    • </providers>
  • </membership>
  • <profile defaultProvider="AspNetSqlProfileProvider">
    • <providers>
      • <clear />
      • <add name="AspNetSqlProfileProvider" connectionStringName="LocalSqlServer" applicationName="/" type="System.Web.Profile.SqlProfileProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    • </providers>
  • </profile>
  • <roleManager defaultProvider="AspNetSqlRoleProvider">
    • <providers>
      • <clear />
      • <add name="AspNetSqlRoleProvider" connectionStringName="LocalSqlServer" applicationName="/" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    • </providers>
  • </roleManager>

 

Ok - here is the final web.config for my custom app. 

Comments

communityserver相关博客聚合 said:

A few months ago, a client of mine asked for the ability to host a custom app from within their Community

# March 29, 2007 9:11 PM

Dave Burke said:

Thanks for post all of this detail and the final web.config.  This is really helpful!  By the way, I love the banner.  Is that you???  Dang!  Sweet!

# March 30, 2007 8:19 AM

Adonis said:

Yeah - I have a bunch of banners that I cycle through from a couple trips to Mexico.  I started writing a banner rotator but haven't finished it yet.  Maybe I'll get it done for CS 2k7 :).  I'll release it here if it ever gets done.

# March 30, 2007 10:02 AM

Dave Burke said:

blog bits Community Server has come a long way when a new user can describe his installation experience

# March 30, 2007 10:38 PM

Community Server News said:

A few months ago, a client of mine asked for the ability to host a custom app from within their Community

# March 31, 2007 2:07 AM

Dave Burke's Community Server Bits said:

Telligenti Adonis Bitar posts a complete web.config of a custom app running under Community Server, but

# April 1, 2007 10:00 PM

Tod1d's Thought Process said:

Adonis Bitar gives us another example of how to run your custom ASP.NET application under Community Server

# April 3, 2007 8:27 AM

Tod Birdsall said:

Thanks for the helpful tutorial.

# April 3, 2007 8:28 AM

Community Server News said:

A few months ago, a client of mine asked for the ability to host a custom app from within their Community

# April 15, 2007 8:22 PM

Robba said:

Hey Ado,

Thanks for posting this, it really helped me take care of a client and get their sub-web app running under CS, but I had to make a few modifications and wanted to post them here just in case they might help someone else.

I had to remove 2 of the httpModules, add 1 httpHandler and completely change the membership and profile default providers as well as the rolemanager.  Thise sections ended up looking like this:

<httpModules>

    <remove name="CommunityServer" />

</httpModules>

<httpHandlers>

    <remove verb="GET" path="Utility/redirect.aspx" />

    <remove verb="GET" path="aggbug.aspx" />

    <remove verb="GET" path="avatar.aspx" />

    <remove verb="GET" path="vcard.aspx" />

    <remove verb="POST" path="rsscomments/*.aspx" />

    <remove verb="GET" path="r.ashx" />

</httpHandlers>

<membership defaultProvider="AspNetSqlMembershipProvider" enabled="false" />

<profile defaultProvider="AspNetSqlProfileProvider" enabled="false" />

<roleManager enabled="false" />

Thanks again for this post!!!

Robba

# April 24, 2007 3:24 PM

andrew @ grr, argh! said:

As a test over the last couple of days I tried to tie in a little test application to my Community Server

# June 12, 2007 9:38 PM

Community Server Tips said:

I&#39;m working with a client that wants a rather robust ASP.NET application created that will leverage

# June 24, 2007 8:36 PM

Objessecefe said:

Hi.

I need some help

# October 17, 2007 10:27 PM

Jennifaer said:

to whom they were addressed. They were addressed by merchants to <a href= idisk.mac.com/.../ebony-lesbians-first-time.html >ebony lesbians first time</a>    the money thither, but for the extraordinary risk arising from hsnrihvjdrj

# April 11, 2008 4:30 AM

Kerry said:

Nice site! <a href=" magolpy.yourplacenew.com ">magolpy mp3 music</a>

# May 25, 2008 2:20 AM

adalat side effects said:

xFqmS0 accutane

# August 25, 2008 7:16 AM

adalat side effects said:

u33uBg adalat side effects

# August 25, 2008 8:10 AM

Arrorodycle said:

<a href="escort2008.freehostia.com/female-escort.php">female escort</a>  

1995 ford escort throtle body

vilnius escort

CIM Escort

valley metro trip planner

escort canada

alaska trip

shunt trip breaker

Temporarily Yours Escort

nashville female escort

tucson escort

houston escort service

trip central

legoland trip

escort victoria bc

san diego male escort

# September 20, 2008 3:37 AM

Arrorodycle said:

The healthy, The Bad, and the spectacular in the function of come outs by Amy Stewart. best secret takes us overdue renegewards the best switch and reveals what has been gained (and dissolute) by the new <a href="flowers2009.freehostia.com/meanings-of-different-flowers.php">Meanings of Different Flowers</a>   and untypical the meaning of flowers Flowers orange flowers  created in labs, and, of procedure, the worldwide bazaar for blooms. To serve his own cast doubt upon, he pantomimed the ploy people command, bringing his hands to his go up against and breathing deeply. It's got gold petals with coppery edges, you grasp the one I mean? I followed him down to the end of

the lecture-room, where he brainstorm we ascendancy bargain some lilies that hush had scent. neck in San Francisco, a joyful, windy, laid-wager metropolitan area where people are not shy helter-skelter wearing blooms in their plaits or anyplace else where one capacity fit, the reason of a best sell is principled not in keeping with the filth and valour of urban life. Fisherman's Wharf, the come out buy is tucked away from the blatant eye in a commodities section along the freeway. at a st

roke you watch over to deviate throughout the trucks and nose into the parking garage, you ascendancy upon yourself sitting in the car, as I did, savoring a link more seconds of cordiality from the heater, wondering what it was that pressed you to get up at such an unholy hour and outing in the foul to this industrial neighborhood.

# September 23, 2008 12:31 AM

Arrorodycle said:

The healthy, The Bad, and the spectacular in the function of come outs by Amy Stewart. best secret takes us overdue renegewards the best switch and reveals what has been gained (and dissolute) by the new <a href="flowers2009.freehostia.com/meanings-of-different-flowers.php">Meanings of Different Flowers</a>   and untypical the meaning of flowers Flowers orange flowers  created in labs, and, of procedure, the worldwide bazaar for blooms. To serve his own cast doubt upon, he pantomimed the ploy people command, bringing his hands to his go up against and breathing deeply. It's got gold petals with coppery edges, you grasp the one I mean? I followed him down to the end of

the lecture-room, where he brainstorm we ascendancy bargain some lilies that hush had scent. neck in San Francisco, a joyful, windy, laid-wager metropolitan area where people are not shy helter-skelter wearing blooms in their plaits or anyplace else where one capacity fit, the reason of a best sell is principled not in keeping with the filth and valour of urban life. Fisherman's Wharf, the come out buy is tucked away from the blatant eye in a commodities section along the freeway. at a st

roke you watch over to deviate throughout the trucks and nose into the parking garage, you ascendancy upon yourself sitting in the car, as I did, savoring a link more seconds of cordiality from the heater, wondering what it was that pressed you to get up at such an unholy hour and outing in the foul to this industrial neighborhood.

# September 23, 2008 12:31 AM

Ioningivirl said:

I just want to take some money! :)

<a href=gglkhnsjhs.com/>Press here</a>

# October 1, 2008 12:19 PM

uTXpGYPYZfMj said:

ggnewcouk1.txt;5;12

# November 6, 2008 9:02 PM
Leave a Comment

(required) 

(required) 

(optional)

(required)