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
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.
Here are steps to publish your .net to the server:
Please open your project with Visual Studio tool
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
Please kindly publish it to a local folder, such as C:\Project
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.
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" />
Related
I have a .net MVC project that i'm attempting to deploy directly to Azure using the publish settings file. I can publish locally without an issue, however when attempting to publish to Azure, it appears to be trying to transform the web.config files within subfolders (which don't have transforms, and don't need them). I receive the following error:
Transformed Web.config using C:\Projects\Git\Web.Project\Web.Debug.config into obj\Debug\TransformWebConfig\transformed\Web.config.
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\Web\Microsoft.Web.Publishing.targets(2311,5): Error : Could not open Source file: Could not find a part of the path 'C:\Projects\Git\Web.Project\App_Plugins\PluginName\Web.config;\App_Plugins\PluginName\Web.config'.
The web.config referenced does exist (I've verified) and this error, as mentioned, is not thrown when publishing to a local folder.
Any suggestions as to why this is occurring and how to fix it?
Edited: Added contents of web.debug file below
<?xml version="1.0" encoding="utf-8"?>
<!-- For more information on using web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 -->
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<!--
In the example below, the "SetAttributes" transform will change the value of
"connectionString" to use "ReleaseSQLServer" only when the "Match" locator
finds an attribute "name" that has a value of "MyDB".
<connectionStrings>
<add name="MyDB"
connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True"
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
</connectionStrings>
-->
<system.web>
<!--
In the example below, the "Replace" transform will replace the entire
<customErrors> section of your web.config file.
Note that because there is only one customErrors section under the
<system.web> node, there is no need to use the "xdt:Locator" attribute.
<customErrors defaultRedirect="GenericError.htm"
mode="RemoteOnly" xdt:Transform="Replace">
<error statusCode="500" redirect="InternalError.htm"/>
</customErrors>
-->
</system.web>
</configuration>
According to your description, you could go to .net project in visual studio and right click Property on the web.config.
Set your Build Action to Content. This means that there will be no transform on this config, usual configuration is compile.
i'm attempting to deploy directly to Azure using the publish settings file.
To achieve you requirement, you could refer to import publish settings and deploy to Azure.
Step 1: Create the publish settings file in azure app service.
Click Get publish profile and save the profile locally.
Step 2: Import the publish settings in Visual Studio and deploy
After deploying, you could visit it successfully through browser.
I am using VS2012, A website on local machine works fine , when i deploy a website on remote PC / Server , it also works fine when you run on localhost in server computer, then problem arises when you access it remotely having static/live IP. it gives following configuration error.
deployed in following path
inetpub > wwwroot > PSE
I have also deployed a website in inetpub > wwwroot > POS which works fine
here is the website structure
Here is the only one web.config file in root directory
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<system.web>
<customErrors mode="Off"/>
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="MySql.Data, Version=6.9.6.0, Culture=neutral, PublicKeyToken=C5687FC88969C44D"/>
</assemblies>
</compilation>
<httpRuntime targetFramework="4.0"/>
<authentication mode="Forms">
<forms defaultUrl="~/dao/pos.aspx" loginUrl="~/default.aspx" timeout="20" slidingExpiration="true"></forms>
</authentication>
</system.web>
</configuration>
Please guide me, where i am wrong and why i am getting above error.
here is IIS Configuration
Your error messages says that this is possibly caused by not configuring a virtual directory as an application. Have you checked this in IIS manager?
Look in the example below to see the difference between a application and a virtual directory that is not an application:
To convert a virtual directory to an application, right click and choose convert to application
I have a bunch of web projects in Visual Studio that I moved from the C: drive to the D: drive.
I,
updated IIS to point to the new locations
done an IIS Reset
restarted the computer
cleared all the folders mentioned on this page
cleaned all my solutions
rebuilt all solutions and so forth.
And yet when I run any SpecFlow test I get a HTTP 500 error, with the root cause being that it can't find the web.config file of one of the solutions because it is looking for it on the C: drive rather than the D: drive.
What could I be missing?
i think Chrome is your web browser? This is the default error page Chrome displays when it receives a 500 HTTP response from the server with no content.
Run the site directly on the server – depending on the configuration of your site/server, you may be able to see the real error if you load the site from a browser located on the same server. You may need to turn off ‘show friendly http errors.’
Temporarily add the following within the appropriate tags in your web.config file:
<configuration>
<system.webServer>
<httpErrors errorMode="Detailed" />
</system.webServer>
<system.web>
<customErrors mode="Off" />
<compilation debug="true" />
</system.web>
</configuration>
After you have added those, load the page again to see if you can get a more detailed error.
Server Error in '/educational/timecalculator' Application.
Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
Details: To enable the details of this specific error message to be viewable on remote machines, please create a tag within a "web.config" configuration file located in the root directory of the current web application. This tag should then have its "mode" attribute set to "Off".
<!-- Web.Config Configuration File -->
<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>
Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's configuration tag to point to a custom error page URL.
<!-- Web.Config Configuration File -->
<configuration>
<system.web>
<customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
</system.web>
</configuration>
This website was working before but was moved over to IIS and now getting this error. The webpage will run locally but not remotely. Perhaps the .NET framework isn't 4.5 on IIS?
This is my Web.config file in asp.net
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<system.web>
<customErrors mode="Off" />
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
</system.web>
</configuration>
In IIS verify that the Application Pool for the website is set to use the correct .NET Framework.
I get parse error after uploading my Web Application to my server. I had an ASP.NET Web Site, but I migrated my files into a Web Application Project. Now, after I completed moving the files to the new project, everything works all right locally, but not at the remote server.
now afther i upload it to the server i get this error:
EDIT--------
this problem just keeping coming back even afther i tried put namespaces on of the .cs files
and republish the site.
even afther i publish the site all the CodeBhind files desapper so i add them myself via copy-past.
here how the solution explorer look and 1 of my aspx. files mybee you will see somthing worng i did:
here is my config file code:
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0">
</compilation>
</system.web>
</configuration>
EDIT-----------------------------------------
i can see the site now online, what i needed to do is give all the files the same namespace, and not use a out side folder (witch i used every time) i just drop all the files/folders in the webroot thank you all!.
You probably have to set up namespaces for your entire project. Look at this walkthrough from Scott Gu's blog. It's for Visual Studio 2005, but it's pretty much the same.
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0">
</compilation>
</system.web>
</configuration>
As per your web.config your target framework is 4.0 . Have you checked same your web site running in application pool in IIS is working on the same framework version?
If the framework is different on IIS than it might be cause of it. You can check it by Select the site on IIS, click ASP.NET tab, select ASP.NET version dropdown box.
I suspect you did not deploy the code-behind: main.aspx.cs