This project is read-only.

Extension Dev Questions

Topics: Business Logic Layer
Jun 7, 2009 at 9:57 AM

Hi Guys,

I am writing an extension for BlogEngine and have a couple of queries. I would really appreciate if someone could provide me some pointers on these.

They are

1. How would you install an extension if BlogEngine is precompiled?

2. Is it possible for BlogEngine to pickup an extension compiled into a class library?

3. In the Post.Saved event is there a way to retrieve the post that was saved, i.e. for a scenario where for instance to cross post to another blog?

Appreciate any help



Jun 7, 2009 at 10:29 AM

1. Pre-compiled -- do you mean WAP or a "published" Web Site project?

With a published Web-site project, you'll typically have a bunch of DLL files in the BIN folder.  I haven't tested this, but in this scenario, you should still be able to add uncompiled code into the project.  So just adding the extension into the App_Code\Extensions folder should work.

With a compiled WAP project, you probably already have Extensions compiled into the main DLL?  You should be able to add the new extension into the source code, and re-compile the WAP project.

There may be a few people who pre-compile the BE Web Site project using the Publish option in VS, but I'm pretty sure there are very few people who have converted BE into a WAP project and run it that way.

2. Yes, but there are some limitations.  See:

3. Accessing the post being saved in Post.Saved is a common use of tapping into the Post.Saved event.  Several widgets and extensions already make use of this.  See the Newsletter widget for an example.

Jun 7, 2009 at 10:46 AM

Hi BenAmada,

Firstly thanks so much for the speedy response and help.

Regarding pre-compiled I meant published.

Re 1.  I tried adding the extension.cs file to the App_Code directory but then gives me the following error

The directory '/tariqayad/App_Code/' is not allowed because the application is precompiled.

Re 2&3, thanks so much for your tips, I will check them out.

Thank you