Alternatives to Using BuildProviders with Web Applications - visual-studio

I've read that you cannot use a BuildProvider with Web Applications in Visual Studio (or more specifically, you can use it, but your code isn't part of the project)
Are there any other ways to generate code on the fly using a Web Application project?
With or without using third-party tools?

Have you tried T4 templates in Visual Studio?

Related

How to associate item templates with Project Type in Visual Studio 2019?

I would like to create a new F# Web ASPNET (not Core) Application using the MSBuild based legacy project format, not the SDK project. In Visual Studio 2019, the only available option for this project type is C#. I've attempted to reverse engineer the project setup by creating a new F# class library and modify the ProjectTypeGuids.
The C# Web Application uses the following project type GUIDs
349c5851-65df-11da-9384-00065b846f21 - ASP.NET MVC 5
fae04ec0-301f-11d3-bf4b-00c04f79efbc - C#
On a basic F# .NET Framework class library, I attempted to add the ASP.NET and F# project type guids to the project.
<ProjectTypeGuids>{349C5851-65DF-11DA-9384-00065B846F21};{F2A71F9B-5D33-465A-A702-920D77279786}</ProjectTypeGuids>
This succeeded in adding the web configuration to the project properties, but now I am unable to add any items to the project at all. It looks like in the past you needed to associate the right language templates with the project guid in the registry editor (see this link)
These entries don't appear to be anywhere that I can see in the registry, for any installed version of VS (which at this point is just 2017 and 2019). How can I enable F# item templates for my F# web application?
While not exactly an answer to the question, I think the pain of trying to do this is likely proof that you SHOULDN'T do this. In the end my approach will be to simply implement the Web Application in C#, while keeping as much code as possible in F# targeting netstandard.

Intellisense for Angular2 HTML templates

We've recently started to migrate to Angular2 from another framework, most of my component templates are not inline and are in separated HTML files.
Is there any plugin that would provide something like IntelliSense inside the HTML?
For example, it would be great to see a list of methods of the component, or a list of properties of an item of a collection iterated with a NgFor directive.
I have failed to find such a thing.
We are using Visual Studio 2015.
I am assuming you haven't come across the latest visual code IDE.
You can go on to Visual Studio to download the latest, I believe that only when you're using interfaces or classes, Intellisense will kick in. I encourage you to use this if you're into using this for your development.
You need to download VS Code and the Angular Language Service plug-in.

Azure Functions Visual Studio 2015 intellisense

I'm playing around with Azure Functions but I've noticed VS 2015 doesn't provide intellisense for .csx files.
Any idea how to fix this?
This isn't an issue with your configuration. IntelliSense support with csx is limited and will be improved in future tooling releases (also targeting VS Code and the portal).
Follow this blog post Publishing a .NET class library as a Function App and don't look back. Full C#, (not .csx.), C# 7 (if using VS2017), and full intellisense and debugging.
Basically the approach is instead of creating a Function Project (in VS2015 only), instead create an ASP.NET project and use the Azure Function CLI to create the actual functions. Then you are not dealing with .CSX files which have poor support within the VS editor.
From the New Project dialog, choose ASP.NET Web Application (.NET Framework) with the empty site template.
Open the project properties. In the Web tab, choose Start External Program
For the program path, enter the path to func.exe for the Azure Functions CLI. If you’ve installed the Visual Studio Functions Tooling, the path will look something like C:\Users\USERNAME\AppData\Local\Azure.Functions.Cli\1.0.0-beta.93\func.exe If you’ve installed the Azure Functions CLI through NPM, the path will be something like C:\Users\USERNAME\AppData\Roaming\npm\node_modules\azure-functions-cli\bin\func.exe
For Command line arguments, set host start
For Working directory, specify the root of the web project on your machine (unfortunately, this isn’t set automatically.)
One solution is to develop your Function as a Precompiled function as explained here: https://github.com/Azure/azure-webjobs-sdk-script/wiki/Precompiled-functions
I got fed up very quickly of the limited intellisense.

How do I install MVC3 on a server without using the Web Platform Installer (and without Visual Studio)?

How do I install MVC3 on a server without using the Web Platform Installer (and without Visual Studio)?
I can't seem to locate a standalone installer, and the server won't have VS, and I can't ensure that all the apps will have the binaries included to run it on native .NET4.
Is the only way to install MVC3 support with VS support, even if VS isn't around?
In case it isn't obvious, I'm trying to give the IT group a baseline of packages to install, and the easiest way to do that is to give them the binaries and a few scripts
Referencing the link on http://www.asp.net/mvc/mvc3 we get a link to http://www.microsoft.com/en-us/download/details.aspx?id=1491 | ASP.NET MVC 3 Tools Update
I think that's what you're looking for.
ASP.NET MVC 3 is a framework for developing highly testable and maintainable Web applications by leveraging the Model-View-Controller (MVC) pattern. The framework encourages developers to maintain a clear separation of concerns among the responsibilities of the application – the UI logic using the view, user-input handling using the controller, and the domain logic using the model. ASP.NET MVC applications are easily testable using techniques such as test-driven development (TDD).
The installation package includes templates and tools for Visual Studio 2010 to increase productivity when writing ASP.NET MVC applications. For example, the Add View dialog box takes advantage of customizable code generation (T4) templates to generate a view based on a model object. The default project template allows the developer to automatically hook up a unit-test project that is associated with the ASP.NET MVC application.
You can download it from : https://www.microsoft.com/es-es/download/details.aspx?id=4211
Is the 3.0.0.0 version and you can reference manually the DLL from : C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 3\Assemblies\System.Web.Mvc.dll
Other versions : https://stackoverflow.com/a/5485175/5775048
Install the MVC3 runtime from this link: http://www.microsoft.com/en-us/download/details.aspx?id=4211.
Go to c:\windows\microsoft.net\framework[64]\v4.0.30319 and run aspnet_regiis -i (adjusting for whatever version of .Net is appropriate).
Restart IIS.
This has always worked for me, although at the moment I'm having an issue because the installer installs 3.0.0.0 and my app is looking for 3.0.0.1.

Can i combine the Visual Basic project web site pages in Visual C# project and make them single project?

I have two web projects one from C#.net and another from vb.net. Means while creating project i selected project as Visual Basic & Visual C#. Can i combine the Visual Basic project web site pages in Visual C# project and make them single project?
thanks
The project is set to compile using a specific compiler... c# or vb which do you want... so you have to separate the c# into its own project... and the vb in it own project. There is one caveat. You CAN put aspx pages that are C# and vb in the same project if you don't use code behind pages because they are compiled on the fly... just in time... ;-)

Resources