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
- file download method in visual studio 2017
- Repository manager receives the wrong connection string in .net core
- MongoDb not connecting C#
- The current .NET SDK does not support targeting .NET Core 6.0. Brand new WPF Project VS Community 2022 17.9.5
- Why Scanning GSI on DynamoDb doesnt work as fast as expected when using CONTAINS?
- Are "blittable types" really unmanaged types for StructLayout Sequential
- Failed to fetch dynamically imported module on Blazor JS Interop
- Problem to upload several images per one request
- Implementing Azure AD B2C Authentication in .NET 8 Blazor Project (RenderMode: InteractiveAuto)
- Stripe connect payout - throws exceptions
- 'IOException: The cloud file provider is not running', when trying to delete 'cloud' folder
- Azure Application Insights Not Displaying Custom Logs for Azure Functions with .NET 8
- Convert C# DateTime.Ticks to Bigquery DateTime Format
- Socket.io nodejs server .NET connection
- Producer Batching Service Bus Vs Kafka
Related Questions in ASP.NET-MVC-3
- Insert new user AspNetUser from another controller in .NET 7
- Error HRESULT E_FAIL has been returned from a call to a COM component in Asp.net MVC
- ASP.NET MVC 3/4 Razor - public action method not found - how to debug
- get data by linq but have Error when doit this
- ASP.NET issue facing exception issue
- How to Implement a View Count Feature for a Blog Website in Asp.net MVC Using a Database?
- Unable to install ASP.NET MVC 3 using chocolatey
- Display data from DB to ajaxToolkit LINE CHART (Ajax control Toolkit v20.1) Using ASP.NET Webform C# (Dissertation Question)
- Why ModelState Isvalid false when working on images
- How to create an ASP.NET MVC 3.2.7 page with 3 view models
- How to make correct test project
- MVC Increase max number of concurrent simultaneous request per user
- Error Number:2705,State:4,Class:16 Code first approach
- Integrating the SSO for MVC3 application with AzureADB2C account
- How to integrate Asp.Net MVC existing application to MAUI Framework
Related Questions in VIEWENGINE
- How to write RenderViewToString in ASP.NET Core
- Edge.js view engine conditionals not working properly
- Unable to load CSS in Go Server
- Code difference between libraries build in View Engine and IVY
- the content that is rendered by iterating through ejs and the content rendered by the html elements placed after ejs content get over each other
- How to change value of multiple iterated element in ejs dynamically?
- How can I convert a nested EJS foreach loop to HBS foreach loop?
- Handlebars not a function error in express-handlebars
- .NET 6 embedded views & multi tenancy
- ASP.NET MVC custom view engine - what is "{1}"
- Express Handlebars directory is not rendering result of views\home.handlebars . Asking for \views\layouts\main.handlebars'
- how can i chain multiple middlewares to one route?
- Custom View Engine not finding a view
- Unexpected token ')' in E:\portfolio\views\home.ejs while compiling ejs
- deno http server conflict between view engine and oak
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 # Hahtags
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.