November Happy Hour will be moved to Thursday December 5th.

Tobias Nilsson
Jan 21, 2011
  4188
(1 votes)

Initialize Community 4.0 without IIS

Introduction

Sometimes you want to initialize EPiServer Community without involving the IIS.  For example when you decide not to use IIS for servicing your web pages or when you want to do unit testing.

Command line program

I've therefore created a little command line program that does this. It initializes Community (and also search) and fetches the first blog post made (ID = 1). You can then use this code as a base for doing your own programs that need access to the Community API.

To use it just compile it and place it amongs a web.config (for a community site) and a connectionstrings.config along with every dll the web.config wants plus the dll's the project needs.

Download

 InitializeCommunityCommandLine

 References

 

Thanks to Kristoffer @ dev for giving me the inspiration and the file this program was heavily based on!

Jan 21, 2011

Comments

Vincent van Ederen
Vincent van Ederen Jan 21, 2011 07:51 PM

Thank you Thomas, this was exactly what I was looking for!

Jarle Friestad
Jarle Friestad Jan 21, 2011 10:30 PM

Very cool Tobias. ;-) This is a much smoother way than the hack including reflection that was needed in Community 3.x.

Jan 24, 2011 04:24 AM

Nice post Tobias!

Jarle Friestad
Jarle Friestad Jan 24, 2011 02:31 PM

This code seems only to handle single site installations. It crashes when Initialize(null) is called on SiteMappingConfiguration if episerver.config contains multiple sites. To solve this i just changed the following

//before
new SiteMappingConfiguration().Initialize(null);
SiteMappingConfiguration.Instance.SiteId = "MyRelateSite";

//after
SiteMappingConfiguration.CurrentHostNameResolver = delegate { return "local.myrelatesite.com"; };
new SiteMappingConfiguration().Initialize(null);

Please login to comment.
Latest blogs
Optimizely SaaS CMS + Coveo Search Page

Short on time but need a listing feature with filters, pagination, and sorting? Create a fully functional Coveo-powered search page driven by data...

Damian Smutek | Nov 21, 2024 | Syndicated blog

Optimizely SaaS CMS DAM Picker (Interim)

Simplify your Optimizely SaaS CMS workflow with the Interim DAM Picker Chrome extension. Seamlessly integrate your DAM system, streamlining asset...

Andy Blyth | Nov 21, 2024 | Syndicated blog

Optimizely CMS Roadmap

Explore Optimizely CMS's latest roadmap, packed with developer-focused updates. From SaaS speed to Visual Builder enhancements, developer tooling...

Andy Blyth | Nov 21, 2024 | Syndicated blog

Set Default Culture in Optimizely CMS 12

Take control over culture-specific operations like date and time formatting.

Tomas Hensrud Gulla | Nov 15, 2024 | Syndicated blog

I'm running Optimizely CMS on .NET 9!

It works 🎉

Tomas Hensrud Gulla | Nov 12, 2024 | Syndicated blog

Recraft's image generation with AI-Assistant for Optimizely

Recraft V3 model is outperforming all other models in the image generation space and we are happy to share: Recraft's new model is now available fo...

Luc Gosso (MVP) | Nov 8, 2024 | Syndicated blog