Deploying asp.net mvc app to folder - asp.net-mvc

I have a hosting running windows, lets say the root domain is xxx.com. On xxx.com there should be website running on php (since IIS can run PHP, right?) or asp.net. I really dont know yet.
I am now responsible of making a asp.net mvc app, which should be running only inside a folder like xxx.com/myaspapp.
I've tried to publish the app straight to the folder via visual studio and it fails with an error:
Server Error in '/' Application.
Configuration Error
Description: An error occurred during the processing of a configuration file
required to service this request. Please review the specific error details
below and modify your configuration file appropriately.
Parser Error Message: It is an error to use a section registered as
allowDefinition='MachineToApplication' beyond application level. This error
can be caused by a virtual directory not being configured as an application in IIS.
What is a solution for this? Is this scenario even possible?
Thank you.

WebDeploy can create a virtual application under an IIS site automatically. Check it out:
THE ANATOMY OF A WEBDEPLOY PACKAGE

It is simple to host an application in a sub folder. Follow the below steps.
Create a folder (myaspapp) under the root site path.
Open IIS Manager (inetmgr) and expand till the new folder.
Right the newly created folder and click on Convert to Application.
Deploy/Upload the application files directly to this folder.
Now you will be able to access the site from the sub folder.

Related

how to deploy asp.net website in intranet- Copy paste folders

I am new to web developing and some how managed to create one web page with SQL database. Now I would like to deploy my website in localhost server by that users who are having access to that server can use the website. I did some search and deployed website in development computer by creating an application in IIS server inetmgr however I don't know how to deploy in production system. Please guide me with possible and effective method by that I can proceed further.Deployment to test
Right-click your project, select Publish.
Create a profile name
On Connection tab, set the Deploy method to File System
Put the file location you want to publish to
On Settings tab, put in the database connection strings if necessary
Save
Right-click project, Publish
Go to the place where your site was published.
Copy all files in that folder and paste it in the IIS web server's virtual directory where your app will be located.

Cannot upload asp.net mvc dll files to web server, 'File in use error'

I've revisited my asp.net mvc core 2.0 web site after some 8 months and for some reason I cannot upload any dll files from my local published folder to the hosting server. I keep getting the following error...
"Copying files to remote side failed.
The process cannot access the file because it is being used by another process."
I get this error no matter which method I use, ftp or http.
What's changed in the last 8 months?
Please check list below:
Please ensure you have rights to access the file;
Please check if the FTP port is used by other applications;
Please check if the file is indeed used by other programs.
Please run process explorer and see what process is locking the file.
Also try:
Restarting your visual studio
Restarting your operating system.
Restarting target server or Web Server.
Please provide more information for more help

Cannot find App_Start foler or update bundle config of ASP.NET MVC website in cpanel in live server

I am deploying an ASP.NET mvc application in this hosting smarterasp.net. Currently my hosting plan is 60 days free trial. I got access to cPanel. Now I already successfully deployed my website on live server. But I want to change the Bundle config class, because I added new CSS files and want to reference it.
So I opened file manager from cpanel and find App_Data folder where bundle config class exists. But there is no App_Start folder in file manager as you can see below.
How can I edit my bundle config class? My hosting is Smarterasp. This is my first time of deploying an asp.net website on live server.
You should note that the whole asp.net mvc web app gets compiled into a single dll. If you need to make an update, you should recompile and re-upload everything including the (web app name).dll file in your bin folder. If you just change code on the server, it won't reflect on the site.
Other than that, please provide some more info. Do you see the app_start folder on your local dev machine? What happens if you re-upload it?

MVC3 site / bin deployed / 404 error on image file

I have an MVC3 website that I am trying to deploy on an existing server with IIS6. The server has .NET 4 installed, but does not have MVC3 installed. I've put all of the referenced dll's in my bin folder on the server.
When I set the wildcard map the server throws 404 errors for every document on my site - even static documents (e.g. /public/images/nav.png). If I get rid of the wildcard map, then I can browse to static images (like nav.png).
Any ideas why 404 errors are occurring for static files that exist when the wildcard map set?
Try to deploy you solution with MVC3 required DLLs: How to Deploy an ASP.NET MVC 3 App to Web Hosting with "\bin Deployment"
right click on project node , build deployment package ,this works for me .
for more [link] http://www.hanselman.com/blog/BINDeployingASPNETMVC3WithRazorToAWindowsServerWithoutMVCInstalled.aspx

SquishIt Access to the path denied exception when deployed to hosting

Whilst on my local machine the following code behaves perfectly.
#Html.Raw(SquishIt.Framework.Bundle.Css()
.Add("~/css/normalize.css")
.Add("~/css/nonsemantic.css")
.Add("~/css/custom/basic/site.css")
.ForceRelease()
.Render("~/css/style.min.css"))
A new minified style.min.css file is created under the specified directory.
However, when I deploy my code to my hosting provider I get an UnauthorizedAccessException with the message of "Access to the path 'C:\...\style.min.css' is denied".
I don't think it is a problem with my SquishIt implementation, but I can't for the life of me figure this one out.
You might need to use your hosting provider's file management tool to give the app pool identity write access to the folder SquishIt is trying to create style.min.css in. For an example of how this is done at one hosting provider, see Setting Folder Permissions for Elmah in this tutorial:
http://www.asp.net/web-forms/tutorials/deployment-to-a-hosting-provider/deployment-to-a-hosting-provider-deploying-to-the-production-environment-7-of-12
On your local machine do you run under IIS or using the Visual Studio Development Server (Cassini)? If it's a folder permission issue you'd see the same thing locally, as in the preceding tutorial from the same series:
http://www.asp.net/web-forms/tutorials/deployment-to-a-hosting-provider/deployment-to-a-hosting-provider-setting-folder-permissions-6-of-12

Resources