How do I CREATE default.aspx file for MVC 6 Application - asp.net-mvc

I am new to MVC applications. I would like to host my MVC6 application on shared windows platform (hosting package). I have uploaded my project files via FTP onto the domain I created with my service provider. My project has a solution file (.sln) which point to my application and But unfortunately, the hosting platform requires my application to have a default.aspx file in order for it to be viewable online. Because of this I am unable to view the application online. How do I create a default.aspx file or get my application to show online?

Use Visual Studio one-click publish. In Solution Explorer, right-click your project then select Publish.
Case your code is correct, you should see your web application.

Related

Importing an UMBRACO site into Visual Studio

Is it possible to import an already existing Umbraco site into Visual Studio? (By means of getting all the site files and DB backup)
I've tried creating an empty project and copying the website files, but I get several errors when I try to compile the solution. The errors look like "Could not find scheme information for the element 'umbracoConfiguration'."
The same happens if I create an empty solution, add the UMBRACO nuget package, and then copy the website files.
I'm wondering if it is at all possible, or if once an UMBRACO website is running, how should one customize/develop on it?
THANK YOU!
After several attempts and trial and error, as well as reading other blogs, the way it worked for me was to go in Visual Studio -> File -> Open -> Web Site... and select the main folder containing all the files.
It is important to know that the web.config had to be modified in advanced for the website to work to point to the local server and off course attach the DB to the local SQL server.
Everything works perfectly just the way it was working on the host, and I have the solution in Visual Studio.
I like to start with nuget because it handles setting up all of my project references. I create a new MVC4 Web Application
Visual Studio->File->New->Project->MVC4 Web Application
After I create the new application, I open the Nuget Package Manager Console
Tools->NuGet Package Manager->Package Manager Console
I then enter the command:
Install-Package UmbracoCms.Core -Version 7.2.1
I find that installing the UmbracoCms.Core instead of the whole UmbracoCms nuget package is best because it only sets me up with the umbraco dlls and sets up the references for me. The UmbracoCms nuget package tries to do a lot more and is more handy if you are setting up a brand new umbraco site in Visual Studio.
Once I have nugetted the appropriate version of umbraco, I copy my existing umbraco site files over the files that were nugetted. When you copy all of the files over, don't copy all of the App_Data. Most of the files in that directory are TEMP files and cache files. From App_Data, only copy the following. This will save you time reindexing the site. I suspect a lot of the App_Data files were responsible for your Object Null Reference.
App_Data/access.config
App_Data/packages/*
In visual studio, in the solution explorer, click "Show All Files", and then include the appropriate files in the solution. Rebuild the solution, and you should be set up for development.

Can I create a Visual Studio project file from files on a server?

I have access to a working ASP.NET MVC 4 website through FTP but do not have the Visual Studio project file. Using these files can I create a Visual Studio project file?
If you have access to all the class files, views etc but are just missing the solution/project file then technically you can wrap them up in an empty project but it would still be a different project.
If you only have access to the published output (the views and JavaScript) then in short the answer is no, not without trying to reverse engineer the dll which I have heard is possible but have never tried myself.

How to deploy ASP.NET MVC3 app to localhost with IIS7

I searched alot among tutorials but I'm so confused now.
I Created an ASP.MVC3 application with VS2010 named tile-shop2,
installed IIS7,
in IIS7 manager in Default Web Site section created a new app named tile-shop2 with ASP.NET V4.0 Application pool, and Physical path is the place that application is created (document, Visual Studio 2010, Projects, ...)
in VS2010, right clicked on the name of project and clicked Publish,
in VS2010 in Project menu => tile-shop2 properties => Web => Servers => ticked Use Local IIS Web server
when I run VS I see this window:
and when in browser searched localhost/tile-shop2 I see list of directoris in Solution Explorer, and when I click on one of them, Error 404.8 appears.
(I run aspnet_regiis and IIS7 works itself)
Can anybody please tell me what is wrong here?
Thanks so much
It sounds like the IIS application is pointing to the folder containing your web project and not the published web project contents.
You want to create a folder within your IIS root ('C:\inetpub\MyProject') and point your IIS application's physical path to this same publish folder, rather than your Visual Studio project folder. You then need to publish the website to this folder using Visual Studio.

Installing Umbraco 4.7

I am new to Umbraco and i have heard lot good about this cms.
I want to start Umbraco, but here are newbie questions.
How to Install Umbraco on my local machine.
Ones I make Umbraco work according to my need, what are requirement for deploying on Shared Hosting.
How to deploy on Shared Hosting Server.
Thank You.
Go for Webmatrix - Umbraco setup 30 sec.! www.asp.net/webmatrix
In answer to question 2. Yuo will need the dot net framework installed (4.0) - some hosts say it is but I have known at least one where the avertising blurb did not match the actual enviroment. You also need SQLExpress (2008 R2 is you best version). Once these are up and running, its the same as any database & iis app.
Another thing I found useful, is that Umbraco also provides a WebDeploy (http://www.iis.net/download/webdeploy) package that makes it very easy to deploy on IIS:http://umbraco.codeplex.com/releases/view/73692 look for 'Umbraco_4.7.1_WebDeploy_NET_4.0'.
I do the initial deployment on my development machine, the release to production could be as simple as a copy and paste (plus the db-release).
Hope this helps,
-covo
Umbraco ships in two type of packages.
Zip Package
Nuget Package
1) Zip Package
Zip package contains an Asp.Net website with Umbraco pre-installed in it. All you have to do is to extract the package inside a local directory, host the directory in IIS as a website and open in browser. Umbraco will guide you through the configuration steps, you can also install a starter kit that is a sample website template and is pretty fancy. Umbraco ships three starter kits along with installation package you can chose the one of your choice.
Step 1:
Navigate to umbraco download url and hit “Download Umbraco version*”: https://our.umbraco.org/download/
You’ll get a zip package of nearly 20MB size.
Step 2:
Extract the zip package into a folder and put that folder on any of your computer’s drive.
Step 3:
Open IIS Manager, add new website and point it to your Umbraco folder and start the website.
Step 4:
Now, browse this website, you’ll see the configuration page would appear, enter your name, email and password for Umbraco dashboard, remember your email id would be used as a user name for logging in dashboard. You can see you have two buttons; Install and Customize, Clicking install would get you the standard features in which you get “.sdf” database file inside your project’s “App_Data” folder. Customize on the other hand provides us with many handy configuration options. We’ll follow the customize route to get good understanding of the process.
Step 5:
When going for customized installation, you’ll see the database configuration options. Configure them according to your choice, Note that you’d have to specify a Database server and database name, you can create a new database on your server and you can use an existing database as well. Alternatively, you can select the SQL Server Compact Edition option from dropdown which would create “.sdf” database inside your project.
Step 6:
The next step in configuration would allow you to install a starter kit, starter kits are built in website templates. Let’s just select one of them for sake of learning although you won’t be needing them once you’d be well versed with the components in Umbraco Dashboard. Click on any of the three starter kits and let Umbraco do the magic.
It would take a couple of minutes and then you’ll be redirected to dashboard of your brand new website powered by Umbraco. Welcome to the Umbraco World. You can navigate to the installed website by removing Umbraco from URL. In our case http://localhost/ would show you the website
and http://localhost/umbraco would take you to the dashboard.
2) Nuget Package
Umbraco is also available in Nuget Package Repository. Follow the steps to install Umbraco using Nuget.
Step 1:
Create an Asp.Net or Asp.Net MVC Project in visual studio.
Step 2:
Open Package Manager Console and run the following command: “Install-Package UmbracoCms"
Umbraco will start installing inside your web application. Alternatively, you can right click on your project, hit Manage Nuget packages, find Umbraco CMS there and install it. There’s a slight possibility that your installation fails with error, normally updating the Nuget version solves the problem. Once the Umbraco is installed inside your project you can either run it by hitting F5/ Play from visual studio or you can host a website in IIS like we did in Umbraco installation from a ZIP package.
Step 3:
Once you've managed to browse your web application project in browser, All the next steps are same as ZIP package installation, specify login credentials, configure database and starter kits and Bingo! Umbraco’s installed.

How to make a shortcut to do batch processing in Visual Studio 2010?

I want to
publish my Asp.Net MVC project to my local IIS and
launch my default browser pointing to the site/application.
I know Visual Studio can do the same thing but using a different scenario, i.e.,
launching built-in web server and web browser, or
launching web browser pointing to the project associated with local iis virtual directory.
How can I create a shortcut to do batch processing as mentioned above?
To script publishing the site you'll need to call MSbuild and ask that to publish the site. See http://codingcockerel.co.uk/2008/05/18/how-to-publish-a-web-site-with-msbuild/ for details on this.
You can lauch the site from a script with a line like:
start iexplore "http://localhost:12345/"

Resources