Hi,
You should not add any code into mojoportal projects and should not compile any custom code in mojoportal projects, any custom code should be in separate projects outside of mojoportal. You can deploy an .ashx file and you can deploy the dll for its codebehind in the /bin folder, or you can use inline code so that there is no dll needed.
For example I have a similar situation where I need to deploy a .ashx on this site for our platform installer feed, this .ashx file is not part of mojoportal is not compiled with it and uses inline code so it has no dll, I just drop the file into the root of my site and I can point the platform installer to this feed.
For your reference my code is as follows:
<%@ WebHandler Language="C#" Class="PlatformInstallerFeed" %>
using System;
using System.Web;
using System.Text;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml;
public class PlatformInstallerFeed : IHttpHandler
{
private const string authorName = "Source Tree Solutions ,LLC";
private const string authorUrl = "http://www.mojoportal.com";
private const string iconUrl = "http://www.mojoportal.com/mojoportal-rocket-64.png";
private const string mojoSummary = @"An easy to use, accessible, mobile friendly and standards compliant content management system and web application framework for ASP.NET, featuring Blogs, Forums, Event Calendar, Newsletter, Maps, ecommerce and more.";
private const string mojoLongSummary = @"mojoPortal is an extensible cross platform, cross database, mobile friendly content management system (CMS) and web application framework written in C# ASP.NET. Includes Blogs, Forums, Calendar, Google Maps, Contact Form, Newsletter, Polls, Surveys, ecommerce and more. If you can make an ASP.NET UserControl then you already know how to implement a feature. Supports MS SQL 2005-2008/SqlAzure, SQL CE, MySql, PostgreSql, SQLite, or Firbird Sql. mojoPortal places a lot of emphasis on web standards and accessibility. Straightforward CSS skinning. mojoPortal also runs in Medium Trust.";
/*********************************************************************************************************/
/* These are the things to update when making a new release of mojoPortal */
/*********************************************************************************************************/
private string version = "2.3.9.8";
private DateTime releaseDate = new DateTime(2013, 07, 29);
private const string downloadPageUrl = "https://mojoportal.codeplex.com/releases/view/105927";
private const string MSSQlSha1 = "41bc6aa30a338bd45f325dad6824545fd3757765";
private const string MSSQLFileId = "710278";
private const string MSSQLFileSize = "20021";
private const string SQLCESha1 = "2945d9cee6477c0f68a6988f29af94ff714270d6";
private const string SQLCEFileId = "710307";
private const string SQLCEFileSize = "21837";
private const string SQLiteSha1 = "e532800bdc367f7f491b0e6f6f0c34fe42c4cd54";
private const string SQLiteFileId = "710576";
private const string SQLiteFileSize = "19976";
private const string PGSQLSha1 = "0d8df4d91ad88f02b20c2b705923ef51acc86f92";
private const string PGSQLFileId = "710308";
private const string PGSQLFileSize = "21333";
private const string FirebirdSha1 = "193fb020645150007800a4cdf7e908037a9b7af5";
private const string FirebirdFileId = "710574";
private const string FirebirdFileSize = "19729";
/*******************************************************************************************************/
public void ProcessRequest(HttpContext context)
{
RenderFeed(context);
}
private void RenderFeed(HttpContext context)
{
context.Response.Expires = -1;
context.Response.ContentType = "application/xml";
Encoding encoding = new UTF8Encoding();
context.Response.ContentEncoding = encoding;
context.Response.Write("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
context.Response.Write("<feed xmlns=\"http://www.w3.org/2005/Atom\">");
context.Response.Write("<webpiFile version=\"3.0.0.0\" />");
context.Response.Write("<title>mojoPortal WebPI Feed</title>");
context.Response.Write("<link rel=\"self\" href=\"http://www.mojoportal.com/PlatformInstallerFeed.ashx\" />");
context.Response.Write("<updated>" + releaseDate.ToString("u") + "</updated>");
context.Response.Write("<author>");
context.Response.Write("<name>Source Tree Solutions ,LLC</name>");
context.Response.Write("<uri>http://www.mojoportal.com</uri>");
context.Response.Write("</author>");
context.Response.Write("<id>http://www.mojoportal.com/PlatformInstallerFeed.ashx</id>");
RenderEntries(context);
context.Response.Write("<tabs>");
context.Response.Write("<tab>");
context.Response.Write("<pillarTab>");
context.Response.Write("<id>AppGalleryTools</id>");
context.Response.Write("<name>mojoPortal</name>");
context.Response.Write("<description>Click \"Customize\" to select which version to install</description>");
context.Response.Write("<pillar>");
context.Response.Write("<id>AppGalleryServer</id>");
context.Response.Write("<name>All mojoPortal Releases</name>");
context.Response.Write("<description>By default the MS SQL version of mojoPortal will be installed. Click below to select a different release from all current mojoPortal releases.</description>");
context.Response.Write("<groupingId>AppGalleryToolsFamilyGrouping</groupingId>");
context.Response.Write("</pillar>");
context.Response.Write("</pillarTab>");
context.Response.Write("</tab>");
context.Response.Write("</tabs>");
context.Response.Write("<groupings>");
context.Response.Write("<grouping>");
context.Response.Write("<id>AppGalleryToolsFamilyGrouping</id>");
context.Response.Write("<attribute>productFamily</attribute>");
context.Response.Write("<include>");
context.Response.Write("<item>mojoPortalNET40MSSQL</item>");
context.Response.Write("<item>mojoPortalNET40SQLCE</item>");
context.Response.Write("<item>mojoPortalNET40SQLITE</item>");
context.Response.Write("<item>mojoPortalNET40PGSQL</item>");
context.Response.Write("<item>mojoPortalNET40Firebird</item>");
context.Response.Write("</include>");
context.Response.Write("</grouping>");
context.Response.Write("</groupings>");
context.Response.Write("</feed>");
}
private void RenderEntries(HttpContext context)
{
RenderEntry(
context,
"mojoPortalNET40MSSQL", //productId
"mojoPortal " + version + " for .NET 4.0 MS SQL", //title
"mojoPortalNET40MSSQL", //productFamily
MSSQLFileSize, //fileSize
"http://mojoportal.codeplex.com/Download?DownloadId=" + MSSQLFileId, //installerUrl
MSSQlSha1 // sha1
);
RenderEntry(
context,
"mojoPortalNET40SQLCE", //productId
"mojoPortal " + version + " for .NET 4.0 SQL CE", //title
"mojoPortalNET40SQLCE", //productFamily
SQLCEFileSize, //fileSize
"http://mojoportal.codeplex.com/Project/Download/FileDownload.aspx?DownloadId=" + SQLCEFileId, //installerUrl
SQLCESha1 // sha1
);
RenderEntry(
context,
"mojoPortalNET40SQLITE", //productId
"mojoPortal " + version + " for .NET 4.0 SQLite", //title
"mojoPortalNET40SQLITE", //productFamily
SQLiteFileSize, //fileSize
"http://mojoportal.codeplex.com/Project/Download/FileDownload.aspx?DownloadId=" + SQLiteFileId, //installerUrl
SQLiteSha1 // sha1
);
RenderEntry(
context,
"mojoPortalNET40PGSQL", //productId
"mojoPortal " + version + " for .NET 4.0 PostgreSql", //title
"mojoPortalNET40PGSQL", //productFamily
PGSQLFileSize, //fileSize
"http://mojoportal.codeplex.com/Project/Download/FileDownload.aspx?DownloadId=" + PGSQLFileId, //installerUrl
PGSQLSha1 // sha1
);
RenderEntry(
context,
"mojoPortalNET40Firebird", //productId
"mojoPortal " + version + " for .NET 4.0 Firebird Sql", //title
"mojoPortalNET40Firebird", //productFamily
FirebirdFileSize, //fileSize
"http://mojoportal.codeplex.com/Project/Download/FileDownload.aspx?DownloadId=" + FirebirdFileId, //installerUrl
FirebirdSha1 // sha1
);
}
private void RenderEntry(
HttpContext context,
string productId,
string title,
string productFamily,
string fileSize,
string installerUrl,
string installSha1)
{
context.Response.Write("<entry type=\"application\">");
context.Response.Write("<productId>" + productId + "</productId>");
context.Response.Write("<title>" + title + "</title>");
context.Response.Write("<summary>" + mojoSummary + "</summary>");
context.Response.Write("<longSummary>" + mojoLongSummary + "</longSummary>");
context.Response.Write("<productFamily>" + productFamily + "</productFamily>");
context.Response.Write("<link href=\"" + downloadPageUrl + "\" />");
context.Response.Write("<version>" + version + "</version>");
context.Response.Write("<images>");
context.Response.Write("<icon>" + iconUrl + "</icon>");
context.Response.Write("</images>");
//this new change supports Azure/SqlAzure
if(productId == "mojoPortalNET40MSSQL")
{
context.Response.Write("<keywords>");
context.Response.Write("<keywordId>SQL</keywordId>");
context.Response.Write("</keywords>");
}
context.Response.Write("<author>");
context.Response.Write("<name>" + authorName + "</name>");
context.Response.Write("<uri>" + authorUrl + "</uri>");
context.Response.Write("</author>");
context.Response.Write("<updated>" + releaseDate.ToString("u") + "</updated>");
context.Response.Write("<published>" + releaseDate.ToString("u") + "</published>");
context.Response.Write("<dependency><productId>NETFramework4</productId></dependency>");
context.Response.Write("<dependency><and><dependency idref=\"ASPNETApp\" /></and></dependency>");
context.Response.Write("<installers>");
context.Response.Write("<installer>");
context.Response.Write("<id>1</id>");
context.Response.Write("<languageId>en</languageId>");
context.Response.Write("<installerFile>");
context.Response.Write("<fileSize>" + fileSize + "</fileSize>");
context.Response.Write("<installerURL>" + installerUrl + "</installerURL>");
context.Response.Write("<sha1>" + installSha1 + "</sha1>");
context.Response.Write("</installerFile>");
context.Response.Write("<helpLink>http://forums.iis.net/1155.aspx</helpLink>");
context.Response.Write("<msDeploy><startPage>Setup/Default.aspx</startPage></msDeploy>");
context.Response.Write("</installer>");
context.Response.Write("</installers>");
context.Response.Write("</entry>");
}
public bool IsReusable
{
get{ return false; }
}
}
Note also that I moved this thread to the developer forum as it was incorrectly posted in Questions about site administration forum
Hope that helps,
Joe