Liam neesan
Liam neesan

Reputation: 2551

How to deploy ASP.net website on somee.com?

I am trying to deploy sample website on somee.com using free hosting.

First I published my website as a folder. I already tested on my local machine on IIS 7 in my local machine. That is working fine without any problem.

1. I created new free hosting domain on somee.com, then in file manager ->

2. Then I make a zip folder for my published website folder

3. Then I upload the zip folder and select upload and unzip archives

4. Now this is my root folder file structure

root folder structure

5. I hope it will run the default.aspx file. Then I try to visit my site it throws error like below

Error msg

Server Error in '/' Application.

Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0016: Could not write to output file 'c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b2d18bbc\3889fee\App_Web_home.master.cdcab7d2.cugbgmun.dll' -- 'Access is denied. '

Source Error:

[No relevant source lines]

Note

I created one small default.htm file for testing. If I upload that file. That's working fine.

Web.config file

<?xml version="1.0" encoding="utf-8"?>

<configuration>
    <system.web>
        <customErrors mode="Off"/>
        <compilation targetFramework="4.5" />
        <httpRuntime targetFramework="4.5" />
    </system.web>
</configuration>

If I add the default.aspx file as a start up page on web config like below,

<?xml version="1.0" encoding="utf-8"?>

<configuration>
    <system.webServer> 
        <defaultDocument> 
            <files> 
                <add value="Default.aspx" /> 
            </files> 
        </defaultDocument> 
    </system.webServer>

    <system.web>
        <customErrors mode="Off"/>
        <compilation targetFramework="4.5" />
        <httpRuntime targetFramework="4.5" />
    </system.web>
</configuration>

Error msg

500 - Internal server error.

There is a problem with the resource you are looking for, and it cannot be displayed.

Upvotes: 2

Views: 9317

Answers (2)

sachin kumar
sachin kumar

Reputation: 1

In Web.confilg file turn on the customErrors

<system.web>
    <customErrors mode="On">

</system.web>

now add connection string carefully .Only change provider connection value

<add name="DBModel" connectionString="metadata=res://*/Models.Model1.csdl|res://*/Models.Model1.ssdl|res://*/Models.Model1.msl;provider=System.Data.SqlClient;**provider connection string**='your database connection path'" providerName="System.Data.EntityClient" />

Upvotes: 0

Mark Spencer
Mark Spencer

Reputation: 166

Here are steps to publish your .net to the server:

  1. Please open your project with Visual Studio tool
  2. On the Solution Explorer windows (which is normally located on the top right hand corner of the VS tool), right click your project and select Publish
  3. Please kindly publish it to a local folder, such as C:\Project
  4. Please just upload whatever files/folders you see on C:\Project to the server via FTP and your site will work fine.

The steps will remain the same. If you face 500 internal server error, please ask somee to check full error message on the server.

Upvotes: 1

Related Questions