Overview; Installation Notes; Software Requirements; Documentation; Support; Upgrading an ASP.NET MVC 2 Project to ASP.NET MVC 3 Tools Update. In Visual Studio 2012, we introduced a new managed debug engine that provides us the ability to more rapidly add new features compared to the older. ASP. NET MVC is a framework for developing Web applications that uses the Model- View- Controller (MVC) pattern. The ASP. NET MVC 3 installer includes the following components: ASP. NET MVC 3 runtime components ASP. NET MVC 3 Visual Studio 2. ASP. NET Web Pages run- time components ASP. NET Web Pages Visual Studio 2. Microsoft Package Manager for . NET (Nu. Get) An update for Visual Studio 2. Razor syntax. Information about getting technical support can be found at the Microsoft Support website. Also feel free to post questions about this release to the ASP. NET MVC forum, where members of the ASP. NET community are frequently able to provide informal support: http: //forums. Upgrading an ASP. NET MVC 2 Project to ASP. NET MVC 3 Tools Update.
ASP. NET MVC 3 can be installed side by side with ASP. NET MVC 2 on the same computer, which gives you flexibility in choosing when to upgrade an ASP. NET MVC 2 application to ASP. NET MVC 3. To manually upgrade an existing ASP. NET MVC 2 application to version 3, do the following: Create a new empty ASP. NET MVC 3 project on your computer. This project will contain some files that are required for the upgrade. Copy the following files from the ASP. NET MVC 3 project into the corresponding location of your ASP. NET MVC 2 project. You'll need to update any references to the j. Query library to account for the new filename ( j. Query- 1. 5. 1. js). Views/Web. config /packages. Content/themes/*.* Copy the packages folder in the root of the empty ASP. NET MVC 3 project solution into the root of your solution, which is in the directory where the solution. If your ASP. NET MVC 2 project contains any areas, copy the /Views/Web. Views folder of each area. In both Web. config files in the ASP. NET MVC 2 project, globally search and replace the ASP. NET MVC version. Find the following. System. Web. Mvc, Version=2. Replace it with the following: System. Web. Mvc, Version=3. In Solution Explorer, delete the reference to System. Web. Mvc (which points to the DLL from version 2), then add a reference to System. Web. Mvc (v. 3. 0. Add a reference to System. Web. Web. Pages. dll and. System. Web. Helpers. These assemblies are located in the following folders. Program. Files%\ Microsoft ASP. NET\ASP. NET MVC 3\Assemblies %Program. Files%\ Microsoft ASP. NET\ASP. NET Web Pages\v. Assemblies In Solution Explorer, right- click the project name and select Unload Project. Then right- click the project name again and select Edit Project. Name. csproj. Locate the Project. Type. Guids element and replace . Save the changes, right- click the project, and then select Reload Project. After the code has been generated, you can edit it to meet your project. The dialog box has been enhanced to offer additional scaffolding options. There are three scaffolding templates available by default. Empty Controller. This template generates an empty controller file. This template is equivalent to not checking Add actions for create, edit, details, delete scenarios in previous versions of ASP. NET MVC. If you choose this, no further options are available. Controller with empty read/write actions. This template generates a controller file that has all the required action methods but no implementation code in the methods. This template is equivalent to checking Add actions for create, edit, details, delete scenarios in previous versions of ASP. NET MVC. If you choose this, no further options are available. Controller with read/write actions and views, using Entity Framework. This template enables you to quickly create a working data- entry user interface. It generates code that handles a range of common requirements and scenarios, such as the following: Data access. The generated code reads and writes entities in a database. It works with the Entity Framework Code First approach if you choose an existing data context class or if you let the template generate a new Db. Context class. It also works with the Entity Framework Database First or Model First approach if you choose an existing Object. Context class. The generated code uses ASP. NET MVC model binding and metadata features so that form submissions are validated according to rules declared on your model class. This includes built- in validation rules, such as the Required and String. Length attributes, and custom validation rules. One- to- many relationships. If you define one- to- many foreign- key relationships between your model classes, the generated code will produce drop- down lists for selecting related entities. For example, you might define the following model classes following Entity Framework Code First conventions. Product. . For Model class, you can choose any model class in your solution, which determines the type of data that users will be able to create or edit: If you want to use Entity Framework Code First, you can choose any model class. If you are using Entity Framework Database First or Entity Framework Model First, be sure to choose an entity class defined in your conceptual model. For Data Context class, you can make these choices: If you want to use Code First and have no existing data context class, choose < New data context. A data context class will then be generated for you. If you want to use Code First and have an existing data context class, choose it here. It will be updated to persist the model class you have selected. If you are using Database First or Model First, choose your object context class here. For Views, choose the view engine you want to use, or choose None if you don't want to scaffold any views. You can select. Advanced Optionsto specify further options for the generated views. For example, you can choose the layout or master page to use. Improvements to the . This template contains settings for building a web application using Windows authentication instead of forms authentication. Because an intranet application requires some IIS settings that can. Documentation for the a new Intranet Application template is available on the MSDN website at the following URL: http: //msdn. VS. 9. 8). aspx. Project templates are now HTML5 enabled. The new- project dialog box now contains an option to add HTML5- specific features to the project templates. Selecting the option causes views to be generated that contain the new HTML5 < header> , < footer> , and < navigation> elements. Note that earlier versions of browsers do not support HTML5- specific tags. To address this limitation, the HTML5 project templates include a reference to the Modernizr library. This library is included as a pre- installed Nu. Get package in templates for ASP. NET MVC 3 projects. For more information about Modernizr, see http: //www. Project templates include updated versions of j. Query, j. Query UI, and j. Query Validation. The project templates now include the following versions of the j. Query scripts: j. Query 1. 5. 1 j. Query Validation 1. Query UI 1. 8. 1. These libraries are included as pre- installed Nu. Get packages. Project templates now include ADO. NET Entity Framework 4. Nu. Get package. The ADO. NET Entity Framework 4. Code First feature. Code First is a new development pattern for the ADO. NET Entity Framework that provides an alternative to the existing Database First and Model First patterns. Code First is focused around defining your model using POCO classes (. These classes can then be mapped to an existing database or be used to generate a database schema. Additional configuration can be supplied using Data. Annotations attributes or using fluent APIs. Documentation for using Code Firstwith ASP. NET MVC is available on the ASP. NET website at the following URLs: http: //www. Project templates include Java. Script libraries as pre- installed Nu. Get packages. When you create a new ASP. NET MVC 3 project, the project includes the Java. Script files mentioned previously (for example, the Modernizr library) by installing them using Nu. Get instead of directly adding the scripts to the Scripts folder in the project template contents. This enables you to use Nu. Get to update the scripts to the latest version when new versions of the scripts are released. For example, given the frequency of new j. Query releases, the version of j. Query included in the project template will at some point be out of date. However, because j. Query is included as an installed Nu. Get package, you will be notified in the Nu. Get dialog box when newer versions of j. Query are available. Because j. Query includes the version number in the file name, updating j. Query to the latest version also requires updating the < script> tag that references the j. Query file to use the new file name. Other included script libraries do not include the version number in the script name, so they can be more easily updated to their latest versions. Known Issues. In some cases, installation may fail with the error message . For information about how to work around this issue, see Knowledge. Base article 2. 53. The scaffolding for adding a controller does not scaffold entities that take advantage of entity inheritance support within Entity Framework. For example, given a base Person class that's inherited by a Student class, scaffolding the Student class will result in generated code that does not compile. Creating a new ASP. NET MVC 3 project within a solution folder causes a Null. Reference. Exception error. The workaround is to create the ASP. NET MVC 3 project in the root of the solution and then move it into the solution folder. Intelli. Sense for Razor syntax does not work when Re. Sharper is installed. If you have Re. Sharper installed and want to take advantage of the Razor Intelli. Sense support in ASP. NET MVC 3, see the entry Razor Intellisense and Re. Sharper on Hadi Hariri's blog, which discusses ways to use them together today. During installation, the EULA acceptance dialog box displays the license terms in a window that is smaller than intended. When you are editing a Razor view (. ASP. NET MVC 3 does not include any snippets for Razor views.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
September 2017
Categories |