When creating a new project for MVC3 I have an option to select a custom viewengine. I can choose between Razor and ASPX. Is there a way to add Spark to the dropdownlist?
Add custom viewengine to New project dialog?
1.2k Views Asked by Ropstah At
2
There are 2 best solutions below
1
Kassem
On
You have to add T4 templates that add support for other view engines (including Spark). Here's a link that explains it: http://weblogs.asp.net/jacqueseloff/archive/2010/07/30/mvc-3-supporting-custom-view-engines.aspx
Related Questions in .NET
- Does compiler optimize operation on const variable and literal const number?
- What is the point of definnig Asp.net Intrinsic Objects In different places and what is the different betwen them?
- Deleting Orphans with Fluent NHibernate
- IOrderedEnumerable to vb.net IOrderedEnumerable Conversion
- What is this namespace ITypeOfObjectsBoundToListBox ? Couldn't find it
- .net rest service with JSON string and consumed with java client
- What is best way to check if any of the property of object is null or empty?
- Telerik's WPF RadColorPicker NoColorText property not working
- Possible consequences of duplicate ProgId for different classes
- How are multiple requests to Task.Run handled from a resource management standpoint?
- Optimizing C++ call from C#
- Make a per-web-application object available to Web API and SignalR controllers
- System.ComponentModel.DataAnnotations.Schema namespace conflict
- LINQ Except/Distinct based on few columns only, to not add duplicates
- Not displaying content by its URL string - absolute urls
Related Questions in ASP.NET-MVC-3
- Routing Url that has no action name
- ObjectContext is disposed, can not longer used
- Image Gallery control not loading
- Skip login on MVC 3 application (SSO)
- JSON object passed to Controller is NULL
- What is the best practice for maintain a menu after a page reload? I have this custom code which feels wrong
- RedirectToAction doesn't happen when I start with an AJAX call
- Create view for a child-master relationship
- How to create edit view with a dropdownlist
- Pathname modified with IE
- Getting the property send by api in mvc
- How to create a dynamic dropdown in mvc
- set font awesome icon into textbox
- MVC3 POST model binding not working for particular complex model
- check for value null on razor syntax
Related Questions in VIEWENGINE
- ExpressJs doesn't cache views in production mode
- The type initializer for 'System.Web.Mvc.ViewEngines' threw an exception
- Compiling views on build in asp mvc using custom ViewEngine
- ASP.NET MVC3 Razor - lost intellisense when placing view in alternate location?
- ASP.NET Web Form Render Engine outputs a Control Tree? Looking for info on render logic
- Is there a way to make a @section optional with the asp.net mvc Razor ViewEngine?
- How to implement a custom view engine in ASP.Net MVC that (sorta) isn't file-based?
- HTML Email created with ASP.NET MVC 2 View (standard view engine)
- View Engines for Web Matrix Web Pages
- How to make razor the default view engine in existing project
- MVC Razor ViewEngine not thread-safe?
- Add custom viewengine to New project dialog?
- Controlling Razor views programmatically?
- Setting masterName on MVC view causes error when calling RenderAction
- injecting changing view engine list
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
The short answer is: No, not really.
The long answer is: Yes, but there's a catch and it requires registry edits.
The
New Project Dialogis built around the idea of selecting a projecttemplate first and then selecting a view-engine supported by that template.Others have managed to add their own things to this window, so I took the hints offered by ASP.NET MVC 3 with xUnit.net Testproject, another 3rd party extension and played around in the registry for a while.
First you have to create a ProjectTemplate for visual studio from which it can generate a clean Spark project. For completeness sake, you can do this by creating a new Razor project, rewiring it for Spark and then exporting the template using the file menu. Uncheck the box to auto-register the new export in VS. I opted to keep my installation simple and moved the new template to where the official MVC3 project templates live (For me that was
C:\Program Files (x86)\Microsoft VisualStudio 10.0\Common\IDE\ProjectTemplates\CSharp\Web). Then run "devenv /setup" from the commandline for VS to find and register the newly created template.Custom additions to the New Dialogue Window have to be added here:
If you're not on a 64-bit installation, remove the Wow6432Node key from the opening registry node.
Now when you restart VS and run the New Project Dialog wizard for MVC3 the newly registered template should be listed in there. When you select your custom projecttemplate, you should see that the ViewEngine dropdown shows "Spark" as the current ViewEngine.
The
New Project Dialoggroups templates by the top-key under ProjectTemplates. Since MVC3 does not register its default templates in the registry we don't know under which key they are grouped and consequently cannot add our own ViewEngines to those.