C# – How to deploy ASP.net website on somee.com

.netasp.netc++someeweb-hosting

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.

Best Solution

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.