Can I use Visual Studio 2008 to set up this portal

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.
12/15/2008 2:21:28 AM
Gravatar
Total Posts 16

Can I use Visual Studio 2008 to set up this portal(Solved)

    1:first, I create a database,and then add a asp.net user. my sql is mssql.

   2: I use Visual Studio 2008 ,open the wwwroot foler with it. Then I revise the "web.config",revise this part:<add name="Subsonic-MSSqlServer" connectionString="server=u681237;UID=sa;PWD=p@ssw0rd;database=mojoPortal1215"/>

   3:Then,I open the default.aspx in setup folder,then debug. But error happen.

  The error is :
Welcome to mojoPortal Setup
Probing system...
File system permissions ok.

The system cannot connect to the MSSQL database. Please check your connection string.


System.Data.SqlClient.SqlException: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) at System.Data.SqlClient.SqlConnection.Open() at mojoPortal.Data.DBPortal.DatabaseHelperGetConnectionError(String overrideConnectionInfo)

Note: This page shows some information that is helpful during setup and upgrades but for security it would be best not to show any information when the system is up to date. You can disable setup and suppress all information on this page by setting DisableSetup=true in Web.config. When you need to upgrade, you can set this back to false. If you are logged in as Administrator setup will run and you will be able to see this page even if it is disabled in Web.config so you can easily leave it disabled and just login before upgrading. But if you are not logged in you will need to enable setup in Web.config.
 

    So what is the problem? Thanks very much.

12/15/2008 2:50:38 AM
Gravatar
Total Posts 55

Re: Can I use Visual Studio 2008 to set up this portal

Of course you can. I believe that almost all of mojoPortal Windows developers do so.

First check authentication type of your SQL Server and whether is it "full" version or Express edition - and does it reside on the same machine where your IIS resides. Also check does ASP.NET user has dbOwner authorization over mojoPortal's database.

The most probable cause of your problem is that you have SQL Server 2005, full or Express, installed on the same machine as your IIS and with default Windows Authentication enabled. If this is really the case, as is with my development environment, connection string part of web.config should be as follows:

"Data Source=<yourservername>;Initial Catalog=mojoPortal1215;Integrated Security=SSPI;"

...or

"Server=<yourservername>;Database=mojoPortal1215;Trusted_Connection=True;

<yourservername> can be, for example, u681237 or simply . or  (local) if SQL Servers is on the same machine as IIS. If you use Express edition, <yourservername> can be u681237\SQLExpress or simply .\SQLExpress. "\SQLExpress" suffix is mandatory.

See details on this marvelous page!

And, by the way, it's much, much better to store connection string in user.config (not in web.config) as described here, especially if you intend to stay connected to mojoPortal source code repository.

If you have SQL Server installed on different machine than your IIS, then ASP.NET user in database is irelevant. Just ensure that user with which you connect to the database (sa in your case) does have dbOwner authorization over mojoPortal1215 database and that SQL Server instance supports remote connections which are disabled by default.

 

 

12/15/2008 3:19:05 AM
Gravatar
Total Posts 16

Re: Can I use Visual Studio 2008 to set up this portal

Slaven Brumec :

Thank you very much.

According your advise,my problem solved.

" it's much, much better to store connection string in user.config "

12/15/2008 3:21:38 AM
Gravatar
Total Posts 16

Re: Can I use Visual Studio 2008 to set up this portal

By the way, I want to ask,
Do this Forums have the "Edit" "Delete" function?

Thanks

12/15/2008 3:24:06 AM
Gravatar
Total Posts 55

Re: Can I use Visual Studio 2008 to set up this portal

Edit function is achieved via small pen icon near your post's title.

12/15/2008 5:24:19 AM
Gravatar
Total Posts 18439

Re: Can I use Visual Studio 2008 to set up this portal

The only thing I would add to what Slaven has said, is that if you are going to be doing development in Visual Studio with mojoPortal, use the source code not the compiled release. The source code has .sln files for Visual Studio. The release files are pre-compilled and have no C# source code included.

I use Visual Studio 2008 ,open the wwwroot foler with it.

Visual Studio supports 2 kinds of web projects, Web Sites and Web Applications. When you open a folder as a web site you are treating it as the web site kind of project, but with the source code, mojoportal is actually a web application type web project, which means all the code behind files get compiled into mojoPortal.Web.dll in the bin folder. Since you say "wwwroot folder" I know you are not using the mojoportal source code, but are using the pre-compiled release files.

To use the mojoportal visual studio solution you need VS 2008 SP1 with the Silverlight Tools for Visual Studio installed, as described in this article.

Best,

Joe

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