How to run in VS 2008 with SQL Express

Post here for help with installing or upgrading mojoPortal pre-compiled release packages. When posting in this forum, please provide all relevant details. You may also want to review the installation or upgrading documentation.

If you have questions about using the source code or working with mojoPortal in Visual Studio, please post in the Developer forum.

Post here for help with installation of mojoPortal pre-compiled release packages

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.

You may also want to review the installation or upgrading documentation.

If you have questions about using the source code or working with mojoPortal in Visual Studio, please post in the Developer forum.

This thread is closed to new posts. You must sign in to post in the forums.
5/24/2009 8:23:15 PM
Gravatar
Total Posts 1

How to run in VS 2008 with SQL Express

I'm trying to run mojoportal 2.3.0.4b in Visual Studio 2008 on WinXP using SQL Express.  I tried with the deployment package and the source package and failed with both.

For the deployment package, I just downloaded and extracted mojoportal-2-3-0-4-b-mssql-deploymentfiles.zip, opened the web site in VS, right-clicked the root in the Solution Explorer and clicked "Build Web Site".  It failed giving an error saying "Error 1 Could not create type 'SiteOffice.ExternalMail.Services.PopToJSON'. C:\mojoPortal\test1\wwwroot\Services\PopToJSON.ashx 1". Given that this is the deployment package I'm really confused why it does not compile.

For the source package, I downloaded and extracted mojoportal-2-3-0-4-b-sourcecode.zip. I was able to successfully build the solution. But, I don't know what to do next. I drilled down into mojoPortal.Web/Setup/Default.aspx, opened that file, and ran it with debugging.  It does run, but it starts 6 web servers (never seen that before). Eventually a page does show in a browser stating that it can't connect to the database. I didn't change to connection string because I don't know what to do. I want to use SQL Express and I don't know how to tell mojoPortal to use that. Do I create a db in the mojoPortal.Web/AppData directory? If so, do I have to provide a username and password? I've used another CMS locally with SQL Express and it did not require a username or password for the database.

I'm an experienced programmer, though relatively new to ASP.NET. I've not tried to run a complete app in VS that did not have step-by-step instructions so that's what I'm asking for.

Thanks

5/25/2009 5:38:29 AM
Gravatar
Total Posts 18439

Re: How to run in VS 2008 with SQL Express

Hi,

The "deployment" files are already compiled so there is no need to build it in VS, all the C# source code is already compiled into dlls in the /bin folder. These files are meant for production deployment not for use in VS, though its ok to use them there. The problem is that there may be a few extra files in the package that are not really used but VS is trying to compile them. You can safely delete any file it complains about, like /Services/PopToJSON.ashx.

When working with the "source code" package there are project files like mojoPortal.Web.csproj so the project files know that the Web/Services/PopToJSON.ashx is no included in the project even though it does exist on disk. Its an old file for something I want to do in the future and I did some protyping and then excluded it because its not finished yet. It doesn't get used and doesn't need to be compiled. It does not hurt anything either but I will try to clean that out from deployment packages in the future.

To use the source code package, you should read the READMEVisualStudio.txt file included.

The issue about it starting 6 web servers is because there are multiple web applications in the solution as features are split into separate projects. All the files for features get copied up to the main mojoPortal.WEb project ie Web folder by post build events, so the feature projects are not meant to be run directly, the mojoPortal.Web project  must always be the startup project, though you can set breakpoints and debug any of the code in any of the projects, but the main web project always has to be the startup project. You can disable those extra web apps from launching a web server as described here http://stackoverflow.com/questions/16363/how-do-you-configure-vs2008-to-only-open-one-webserver-in-a-solution-with-multi#16390

Just click the project node in Solution EXplorer and then click the Properties tab on the right and you will see where to disable it. I have disabled them on my copy but it does not seem to persist those settings in the solution, they are apparently user specific.

No matter which package you use, you create a database in SQLExpress. I recommend configure SQLExpress for Mixed Mode Authentication, ie Windows Users and SQL Users. Create a SQL User and add it to the dbo group for the db. Then set credentials in the connection string in Web.config or user.config as described here:

http://www.mojoportal.com/mssqlsetup.aspx

There is no need to put the db files in the App_Data folder, some projects do that and ship a db with the app but we do not because we support a lot of different dbs not just ms sql.

Hope it helps,

Joe

You must sign in to post in the forums. This thread is closed to new posts.