Runtime Error on New Install

Topics: Controls
Aug 5, 2009 at 10:23 PM

I downloaded the source code and installed the DotNetEngineBlog in the blog folder.   I went into my webhosting control panel and made the blog folder a virtual directory.  I then then renamed the SQLServerWeb.Config from the setup/SQLserver folder to blog/Web.config.  I uploaded the site.

In the blog/Web.config file I have:

<!--l version="1.0-->

  
    
      
    
  
(I changed the DB, DBUserName, DBPassword to protect the information).
In the (main) Web.config, I have:
<!--l version="1.0-->

<!-- 
    A full list of settings and comments can be found in 
    machine.config.comments usually located in 
    \Windows\Microsoft.Net\Framework\v2.x\Config 
-->

    
    
But after adding some of the lines of code, I still am getting the error.  Is there something else I can do?  Thank you!    	(Hopefully the code shows up OK, I did not see an option to preview before posting.
    
        
        
    
    

<!-- configSource is not implemented in Mono. <connectionStrings configSource="sql.config" /> --> <!-- Mono complains if LocalSqlServer isn't specified --> <!-- You can e.g. use "~/blog/" if BlogEngine.NET is not located in the root of the application --> <!-- The regex used to identify mobile devices so a different theme can be shown --> <!-- The name of the role with administrator permissions --> <!--This value is to provide an alterantive location for storing data.--> <!--A comma separated list of script names to hard minify. It's case-sensitive. --> <!--Remove the default ASP.NET modules we don't need--> <!-- Enable the staticContent section below to add Expires headers to images for better performance. Some hosting providers does not allow the staticContent section to be set. --> <!-- <staticContent> <clientCache httpExpires="Sun, 29 Mar 2020 00:00:00 GMT" cacheControlMode="UseExpires" /> </staticContent> --> <!-- Enable the httpProtocol section below to manipulate some HTTP headers. Some hosting providers does not allow the httpProtocol section to be set. --> <!-- <httpProtocol> <customHeaders> <remove name="X-Powered-By" /> <add name="Etag" value=" " /> </customHeaders> </httpProtocol> -->
Aug 5, 2009 at 10:25 PM

I did not see the blog/Web.config, so here goes:

<!--l version="1.0-->

  
    
      
    
  
  
    
      
        
        
      
    
  
  <!-- configSource is not implemented in Mono.
    <connectionStrings configSource="sql.config" />
  -->
  
    
    
    <!-- Mono complains if LocalSqlServer isn't specified -->
    
  

  
    
    <!-- You can e.g. use "~/blog/" if BlogEngine.NET is not located in the root of the application -->
    
    <!-- The regex used to identify mobile devices so a different theme can be shown -->
    
    <!-- The name of the role with administrator permissions -->
    
    <!--This value is to provide an alterantive location for storing data.-->
    
    <!--A comma separated list of script names to hard minify. It's case-sensitive. -->
    
  

  
    
      
        
        
        
        
        
        
        
      
    

    
    
    

    
      
    

    
      
        
      
    

    
      
    

    
      
        
        
        
        
      
    

    
      
        
        
        
        
      
    

    
      
        
        
      
    

    
      
      
      
      
      <!--Remove the default ASP.NET modules we don't need-->
      
      
      
    

    
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
    
  

  
    

    <!-- Enable the staticContent section below to add Expires headers to images for better performance.
				 Some hosting providers does not allow the staticContent section to be set. -->
    <!--
		<staticContent>
			<clientCache httpExpires="Sun, 29 Mar 2020 00:00:00 GMT" cacheControlMode="UseExpires" />
		</staticContent>
		-->


    
      
      
      
      
    

    
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
    

    <!-- Enable the httpProtocol section below to manipulate some HTTP headers.
				 Some hosting providers does not allow the httpProtocol section to be set. -->
    <!--
		<httpProtocol>
			<customHeaders>
				<remove name="X-Powered-By" />
				<add name="Etag" value=" " />
			</customHeaders>
		</httpProtocol>
		-->
  


Aug 6, 2009 at 5:30 PM

The hosting company said that when they check the URL, they get "The directory '/blog/App_Code/' is not allowed because the application is precompiled."

Hopefully that might help a bit more.  Thanks again!

Coordinator
Aug 6, 2009 at 11:27 PM

Did you open up the BE site in Visual Studio as a "project" or did you open it up and do a "Publish"?

The BE files are designed so you can just copy them up to your web server, as-is, via FTP.

If you're getting that error message about App_Code not being allowed because the application is precompiled, this means you have files on the website (like PrecompiledApp.config) that are created when you precompile an application.

If you just copy the BE files to your website via an FTP client, and don't do anything with them in VS, you won't get that error message.

Aug 7, 2009 at 9:28 PM

I just unzipped the files and uploaded them to the website - that's all.  I did not open or look at any files before uploading them. 

I did locate the PrecompiledApp.config and it had



        
    
Coordinator
Aug 8, 2009 at 12:03 AM

On the Downloads page, make sure you download the one labeled "BlogEngine.NET 1.5 (web)".  This doesn't include a PrecompiledApp.config file.

Aug 8, 2009 at 2:51 PM

Thanks - I thought that was the one I picked but I guess not.  I was able to delete the old script & upload the web scripts.  I was also able to get into MSSQL Server Administration to run the
SQL query that creates the tables / data.

However I still get the runtime error when I go to www.example.com/blog/.  I emailed the hosting company as well to see what error they might be receiving.

Aug 8, 2009 at 5:20 PM

They are enabling it so I can get the proper error messages, but they said

Here is the error messages :
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

I am using:
<add name="LocalSqlServer" connectionString="micro122.blankserver.com\SQLExpress,1750"/>

as recommended by their CP, but they also gave me 74.55.37.18,1750 to possibly use - should that be in the name?

Coordinator
Aug 8, 2009 at 9:56 PM

To store data in a SQL Server DB, rather than the default location of the file system, if you haven't already, replace the Web.config file in the root folder with the SQLServerWeb.Config file in the setup\SQLServer folder.  You can delete the existing Web.config file, copy the SQLServerWeb.config file to the root folder, and rename it to Web.config.

The connection string contains the server name/IP address, username, password, and DB name.

When you copy over the SQLServerWeb.config file to the root folder, the initial <connectionStrings> section in that file looks like:

  <connectionStrings>
    <clear/>
    <add name="LocalSqlServer" connectionString="dummy"/>
    <!-- Mono complains if LocalSqlServer isn't specified -->
    <add name="BlogEngine" connectionString="Data Source=MySQLServer;User ID=user;Password=password;persist security info=False;initial catalog=BlogEngine;" providerName="System.Data.SqlClient"/>
  </connectionStrings>

You would want to change the "BlogEngine" connection string.

 - For the "Data Source", replace MySQLServer with 74.55.37.18,1750
 - For the "User ID", replace user with your SQL Server username.
 - For the "Password", replace password with your SQL Server password.
 - For the "initial catalog", replace BlogEngine with your SQL Server database name.
 
Also, if you haven't already, you'll also want to run the MSSQLSetup1.5.0.0.sql script in the setup\SQLServer folder.  This will populate your SQL Server database with all the tables required, along with some initial data.

Aug 9, 2009 at 1:31 AM

Thanks!  That worked...  Initially, I had replaced "dummy" with the MS Connection string