├── WebApp1 ├── Views │ ├── _ViewStart.cshtml │ ├── _ViewImports.cshtml │ ├── Home │ │ ├── Privacy.cshtml │ │ ├── Index.cshtml │ │ ├── IndexView.vb │ │ └── IndexView.vbxml.vb │ └── Shared │ │ ├── Error.cshtml │ │ ├── _CookieConsentPartial.cshtml │ │ ├── _ValidationScriptsPartial.cshtml │ │ └── _Layout.cshtml ├── wwwroot │ ├── favicon.ico │ ├── js │ │ └── site.js │ └── css │ │ └── site.css ├── Models │ ├── Student.vb │ ├── VbXml.vb │ └── ErrorViewModel.vb ├── appsettings.json ├── appsettings.Development.json ├── Data │ └── SomeStudents.vb ├── WebApp1.vbproj ├── Helper.vb ├── My Project │ └── launchSettings.json ├── Program.vb ├── Controllers │ └── HomeController.vb ├── WebApp1.sln └── Startup.vb ├── RazorPages1 ├── Pages │ ├── _ViewStart.cshtml │ ├── Index.cshtml │ ├── _ViewImports.cshtml │ ├── Privacy.cshtml │ ├── Privacy.cshtml.vb │ ├── Error.cshtml.vb │ ├── Index.cshtml.vb │ ├── Index.vbxml.vb │ ├── Error.cshtml │ └── Shared │ │ ├── _CookieConsentPartial.cshtml │ │ ├── _ValidationScriptsPartial.cshtml │ │ └── _Layout.cshtml ├── wwwroot │ ├── favicon.ico │ ├── js │ │ └── site.js │ └── css │ │ └── site.css ├── Data │ ├── Student.vb │ └── SomeStudents.vb ├── appsettings.Development.json ├── appsettings.json ├── RazorPages1.vbproj ├── Program.vb ├── Helper.vb ├── My Project │ └── launchSettings.json ├── RazorPages1.sln └── Startup.vb ├── VBRazorSample ├── Views │ ├── _ViewStart.cshtml │ ├── Home │ │ ├── IndexView.vb.js │ │ └── IndexView.vb │ ├── _ViewImports.cshtml │ └── Shared │ │ ├── Error.cshtml │ │ ├── _CookieConsentPartial.cshtml │ │ ├── _ValidationScriptsPartial.cshtml │ │ ├── _Layout.cshtml │ │ └── LayoutView.vb ├── wwwroot │ ├── favicon.ico │ ├── js │ │ └── site.js │ └── css │ │ └── site.css ├── Models │ ├── Student.vb │ └── ErrorViewModel.vb ├── appsettings.Development.json ├── appsettings.json ├── Module.vb ├── VBMvcSample.vbproj ├── My Project │ ├── launchSettings.json │ └── app.manifest ├── Properties │ └── launchSettings.json ├── Program.vb ├── Controllers │ └── HomeController.vb └── Startup.vb ├── VbRazor ├── ILayoutRazor.vb ├── IRazor.vb ├── VbRazor.vbproj ├── VbRazorView.vb ├── VBRazorMvcViewOptionsSetup.vb ├── PathHelper.vb └── VBRazorViewEngine.vb ├── VB.NET MVC Core Sample.sln ├── .gitattributes ├── README.md └── .gitignore /WebApp1/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /RazorPages1/Pages/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /VBRazorSample/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /VBRazorSample/Views/Home/IndexView.vb.js: -------------------------------------------------------------------------------- 1 | var x = 10; 2 | document.writeln(x); 3 | -------------------------------------------------------------------------------- /WebApp1/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VBAndCs/VB.NET-Razor/HEAD/WebApp1/wwwroot/favicon.ico -------------------------------------------------------------------------------- /RazorPages1/Pages/Index.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model IndexModel 3 | 4 |
5 | @Html.Raw(Model.VbXml) 6 |
-------------------------------------------------------------------------------- /RazorPages1/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VBAndCs/VB.NET-Razor/HEAD/RazorPages1/wwwroot/favicon.ico -------------------------------------------------------------------------------- /VBRazorSample/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VBAndCs/VB.NET-Razor/HEAD/VBRazorSample/wwwroot/favicon.ico -------------------------------------------------------------------------------- /VbRazor/ILayoutRazor.vb: -------------------------------------------------------------------------------- 1 | Public Interface ILayoutRazor 2 | Inherits IRazor 3 | 4 | Property Body As XElement 5 | End Interface 6 | -------------------------------------------------------------------------------- /WebApp1/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using WebApp1 2 | @using WebApp1.Models 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | -------------------------------------------------------------------------------- /RazorPages1/Pages/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using RazorPages1 2 | @namespace RazorPages1.Pages 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | -------------------------------------------------------------------------------- /VBRazorSample/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using WebApplication1 2 | @using WebApplication1.Models 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | -------------------------------------------------------------------------------- /VBRazorSample/Models/Student.vb: -------------------------------------------------------------------------------- 1 | Public Class Student 2 | Public Id As Integer 3 | Public Name As String 4 | Public Age As Integer 5 | End Class 6 | -------------------------------------------------------------------------------- /RazorPages1/Data/Student.vb: -------------------------------------------------------------------------------- 1 | Public Class Student 2 | Public Id As Integer 3 | Public Name As String 4 | Public Age As Integer 5 | Public Grade As Integer 6 | End Class 7 | -------------------------------------------------------------------------------- /WebApp1/Models/Student.vb: -------------------------------------------------------------------------------- 1 | Public Class Student 2 | Public Id As Integer 3 | Public Name As String 4 | Public Age As Integer 5 | Public Grade As Integer 6 | End Class 7 | -------------------------------------------------------------------------------- /WebApp1/Views/Home/Privacy.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Privacy Policy"; 3 | } 4 |

@ViewData["Title"]

5 | 6 |

Use this page to detail your site's privacy policy.

7 | -------------------------------------------------------------------------------- /WebApp1/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning", 5 | "Microsoft.Hosting.Lifetime": "Information" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /RazorPages1/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /RazorPages1/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning", 5 | "Microsoft.Hosting.Lifetime": "Information" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /WebApp1/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /RazorPages1/Pages/Privacy.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model PrivacyModel 3 | @{ 4 | ViewData["Title"] = "Privacy Policy"; 5 | } 6 |

@ViewData["Title"]

7 | 8 |

Use this page to detail your site's privacy policy.

9 | -------------------------------------------------------------------------------- /VBRazorSample/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /VBRazorSample/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning", 5 | "Microsoft.Hosting.Lifetime": "Information" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /WebApp1/Models/VbXml.vb: -------------------------------------------------------------------------------- 1 | Namespace Models 2 | Public Class VbXml 3 | Public Property VbXml As String 4 | 5 | Public Sub New(value As String) 6 | VbXml = value 7 | End Sub 8 | End Class 9 | End Namespace -------------------------------------------------------------------------------- /WebApp1/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | // for details on configuring this project to bundle and minify static web assets. 3 | 4 | // Write your JavaScript code. 5 | -------------------------------------------------------------------------------- /RazorPages1/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | // for details on configuring this project to bundle and minify static web assets. 3 | 4 | // Write your Javascript code. 5 | -------------------------------------------------------------------------------- /VBRazorSample/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | // for details on configuring this project to bundle and minify static web assets. 3 | 4 | // Write your JavaScript code. 5 | -------------------------------------------------------------------------------- /VBRazorSample/Module.vb: -------------------------------------------------------------------------------- 1 | Module SomeStudents 2 | Public Students = New List(Of Student) From { 3 | New Student With {.Id = 1, .Name = "Adam", .Age = 20}, 4 | New Student With {.Id = 2, .Name = "Mark", .Age = 21}, 5 | New Student With {.Id = 3, .Name = "Tom", .Age = 18} 6 | } 7 | End Module 8 | -------------------------------------------------------------------------------- /WebApp1/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model WebApp1.Models.VbXml 2 | 3 |
4 |

Welcome

5 |

Learn about building Web apps with ASP.NET Core.

6 |
7 | 8 |
9 | @Html.Raw(Model.VbXml) 10 |
-------------------------------------------------------------------------------- /VbRazor/IRazor.vb: -------------------------------------------------------------------------------- 1 | 2 | Imports System.Runtime.CompilerServices 3 | Imports Microsoft.AspNetCore.Mvc.ModelBinding 4 | 5 | Public Interface IRazor 6 | Property ViewBag As Object 7 | Property ModelState As ModelStateDictionary 8 | Function Razor() As XElement 9 | 10 | Function RenderView() As XElement 11 | End Interface 12 | -------------------------------------------------------------------------------- /RazorPages1/Pages/Privacy.cshtml.vb: -------------------------------------------------------------------------------- 1 | Imports System 2 | Imports System.Collections.Generic 3 | Imports System.Linq 4 | Imports System.Threading.Tasks 5 | Imports Microsoft.AspNetCore.Mvc 6 | Imports Microsoft.AspNetCore.Mvc.RazorPages 7 | 8 | Public Class PrivacyModel : Inherits PageModel 9 | Public Sub OnGet() 10 | 11 | End Sub 12 | End Class 13 | -------------------------------------------------------------------------------- /VBRazorSample/Models/ErrorViewModel.vb: -------------------------------------------------------------------------------- 1 | Imports System 2 | 3 | Namespace Models 4 | 5 | Public Class ErrorViewModel 6 | Public Property RequestId() As String 7 | 8 | Public Function ShowRequestId() As Boolean 9 | Return Not String.IsNullOrEmpty(RequestId) 10 | End Function 11 | End Class 12 | 13 | End Namespace -------------------------------------------------------------------------------- /RazorPages1/Data/SomeStudents.vb: -------------------------------------------------------------------------------- 1 | Module SomeStudents 2 | Public Students = New List(Of Student) From { 3 | New Student With {.Id = 1, .Name = "Adam", .Age = 20, .Grade = 69}, 4 | New Student With {.Id = 2, .Name = "Mark", .Age = 21, .Grade = 80}, 5 | New Student With {.Id = 3, .Name = "Tom", .Age = 18, .Grade = 51} 6 | } 7 | End Module 8 | -------------------------------------------------------------------------------- /VbRazor/VbRazor.vbproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | VbRazor 5 | netstandard2.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /WebApp1/Data/SomeStudents.vb: -------------------------------------------------------------------------------- 1 | Module SomeStudents 2 | Public Students = New List(Of Student) From { 3 | New Student With {.Id = 1, .Name = "Adam", .Age = 20, .Grade = 69}, 4 | New Student With {.Id = 2, .Name = "Mark", .Age = 21, .Grade = 80}, 5 | New Student With {.Id = 3, .Name = "Tom", .Age = 18, .Grade = 51} 6 | } 7 | End Module 8 | -------------------------------------------------------------------------------- /WebApp1/Models/ErrorViewModel.vb: -------------------------------------------------------------------------------- 1 | Namespace Models 2 | Public Class ErrorViewModel 3 | Public Property RequestId As String 4 | 5 | Public ReadOnly Property ShowRequestId() As Boolean 6 | Get 7 | Return Not String.IsNullOrEmpty(RequestId) 8 | End Get 9 | End Property 10 | End Class 11 | End Namespace -------------------------------------------------------------------------------- /RazorPages1/RazorPages1.vbproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp3.0 5 | true 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /WebApp1/WebApp1.vbproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp3.0 5 | true 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /RazorPages1/Program.vb: -------------------------------------------------------------------------------- 1 | Imports Microsoft.AspNetCore.Hosting 2 | Imports Microsoft.Extensions.Hosting 3 | 4 | Module Program 5 | Sub Main(args As String()) 6 | CreateHostBuilder(args).Build().Run() 7 | End Sub 8 | 9 | Public Function CreateHostBuilder(args() As String) As IHostBuilder 10 | Return Host.CreateDefaultBuilder(args).ConfigureWebHostDefaults( 11 | Sub(webBuilder) 12 | webBuilder.UseStartup(Of Startup)() 13 | End Sub 14 | ) 15 | End Function 16 | End Module 17 | -------------------------------------------------------------------------------- /VBRazorSample/VBMvcSample.vbproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp3.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /RazorPages1/Pages/Error.cshtml.vb: -------------------------------------------------------------------------------- 1 | imports System 2 | imports System.Collections.Generic 3 | imports System.Diagnostics 4 | imports System.Linq 5 | imports System.Threading.Tasks 6 | imports Microsoft.AspNetCore.Mvc 7 | imports Microsoft.AspNetCore.Mvc.RazorPages 8 | 9 | 10 | 11 | Public Class ErrorModel : Inherits PageModel 12 | 13 | Public Property RequestId As String 14 | 15 | Public Property ShowRequestId As Boolean = Not String.IsNullOrEmpty(RequestId) 16 | 17 | Public Sub OnGet() 18 | RequestId = If(Activity.Current?.Id, HttpContext.TraceIdentifier) 19 | End Sub 20 | End Class 21 | -------------------------------------------------------------------------------- /WebApp1/Helper.vb: -------------------------------------------------------------------------------- 1 | Imports System.Runtime.CompilerServices 2 | 3 | Module Helper 4 | 5 | Public Function ToHtmlString(x As XElement, Optional DisableFormatting As Boolean = True) As String 6 | Dim html 7 | If DisableFormatting Then 8 | html = x.ToString(SaveOptions.DisableFormatting) 9 | Else 10 | html = x.ToString() 11 | End If 12 | 13 | html = html.Replace("", ""). 14 | Replace("", ""). 15 | Replace("", ""). 16 | Replace("", ""). 17 | Replace("_vazor_amp_", "&") 18 | 19 | Return html 20 | End Function 21 | 22 | End Module 23 | -------------------------------------------------------------------------------- /RazorPages1/Helper.vb: -------------------------------------------------------------------------------- 1 | Imports System.Runtime.CompilerServices 2 | 3 | Module Helper 4 | 5 | Public Function ToHtmlString(x As XElement, Optional DisableFormatting As Boolean = True) As String 6 | Dim html 7 | If DisableFormatting Then 8 | html = x.ToString(SaveOptions.DisableFormatting) 9 | Else 10 | html = x.ToString() 11 | End If 12 | 13 | html = html.Replace("", ""). 14 | Replace("", ""). 15 | Replace("", ""). 16 | Replace("", ""). 17 | Replace("_vazor_amp_", "&") 18 | 19 | Return html 20 | End Function 21 | 22 | End Module 23 | -------------------------------------------------------------------------------- /RazorPages1/Pages/Index.cshtml.vb: -------------------------------------------------------------------------------- 1 | Imports System 2 | Imports System.Collections.Generic 3 | Imports System.Linq 4 | Imports System.Threading.Tasks 5 | Imports Microsoft.AspNetCore.Mvc 6 | Imports Microsoft.AspNetCore.Mvc.RazorPages 7 | Imports Vazor 8 | 9 | Public Class IndexModel : Inherits PageModel 10 | 11 | Public Property Message = "PageModel in C#" 12 | 13 | Public Sub OnGet() 14 | 15 | End Sub 16 | 17 | Public Property VbXml As String 18 | Get 19 | ViewData("Title") = "VB Razor Page" 20 | Return GetVbXml().ToHtmlString() 21 | End Get 22 | 23 | Private Set(value As String) 24 | 25 | End Set 26 | End Property 27 | 28 | End Class 29 | -------------------------------------------------------------------------------- /VbRazor/VbRazorView.vb: -------------------------------------------------------------------------------- 1 | Imports Microsoft.AspNetCore.Mvc.ViewEngines 2 | Imports Microsoft.AspNetCore.Mvc.Rendering 3 | Imports System.IO 4 | 5 | Public Class VBRazorView 6 | Implements IView 7 | 8 | Public Property Path As String Implements IView.Path 9 | 10 | Public Async Function RenderAsync(ByVal context As ViewContext) As Task Implements IView.RenderAsync 11 | Dim razor = CType(context.ViewData.Model, IRazor) 12 | razor.ViewBag = context.ViewBag 13 | razor.ModelState = context.ModelState 14 | Dim view = Await Task.Run(AddressOf razor.RenderView().ToString).ConfigureAwait(False) 15 | context.Writer.Write(view) 16 | End Function 17 | 18 | 19 | End Class 20 | -------------------------------------------------------------------------------- /WebApp1/Views/Home/IndexView.vb: -------------------------------------------------------------------------------- 1 | Imports Microsoft.AspNetCore.Mvc.ViewFeatures 2 | 3 | Public Class IndexView 4 | Dim students As List(Of Student) 5 | 6 | Public Sub New(students As List(Of Student)) 7 | Me.students = students 8 | End Sub 9 | 10 | Public Sub New(students As List(Of Student), ViewData As ViewDataDictionary) 11 | Me.students = students 12 | Me.ViewData = ViewData 13 | End Sub 14 | Public Property ViewData As ViewDataDictionary 15 | 16 | Dim _html As String 17 | Public ReadOnly Property Html As String 18 | Get 19 | If _html Is Nothing Then _html = GetVbXml().ToHtmlString() 20 | 21 | Return _html 22 | End Get 23 | End Property 24 | 25 | End Class 26 | -------------------------------------------------------------------------------- /VBRazorSample/My Project/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:52702/", 7 | "sslPort": 0 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "WebApplication1": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "environmentVariables": { 22 | "ASPNETCORE_ENVIRONMENT": "Development" 23 | }, 24 | "applicationUrl": "http://localhost:52703/" 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /WebApp1/My Project/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:57080", 7 | "sslPort": 44385 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "WebApp1": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 22 | "environmentVariables": { 23 | "ASPNETCORE_ENVIRONMENT": "Development" 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /RazorPages1/My Project/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:52587", 7 | "sslPort": 44335 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "RazorPages1": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 22 | "environmentVariables": { 23 | "ASPNETCORE_ENVIRONMENT": "Development" 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /VBRazorSample/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:52377", 7 | "sslPort": 44363 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "WebApplication1": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 22 | "environmentVariables": { 23 | "ASPNETCORE_ENVIRONMENT": "Development" 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /WebApp1/Program.vb: -------------------------------------------------------------------------------- 1 | Imports System 2 | Imports System.Collections.Generic 3 | Imports System.IO 4 | Imports System.Linq 5 | Imports System.Threading.Tasks 6 | Imports Microsoft.AspNetCore 7 | Imports Microsoft.AspNetCore.Hosting 8 | Imports Microsoft.Extensions.Configuration 9 | Imports Microsoft.Extensions.Hosting 10 | Imports Microsoft.Extensions.Logging 11 | 12 | Module Program 13 | Sub Main(args As String()) 14 | CreateHostBuilder(args).Build().Run() 15 | End Sub 16 | 17 | Public Function CreateHostBuilder(args() As String) As IHostBuilder 18 | Return Host.CreateDefaultBuilder(args).ConfigureWebHostDefaults( 19 | Sub(webBuilder) 20 | webBuilder.UseStartup(Of Startup)() 21 | End Sub 22 | ) 23 | End Function 24 | End Module 25 | -------------------------------------------------------------------------------- /VBRazorSample/Program.vb: -------------------------------------------------------------------------------- 1 | Imports System 2 | Imports System.Collections.Generic 3 | Imports System.IO 4 | Imports System.Linq 5 | Imports System.Threading.Tasks 6 | Imports Microsoft.AspNetCore 7 | Imports Microsoft.AspNetCore.Hosting 8 | Imports Microsoft.Extensions.Configuration 9 | Imports Microsoft.Extensions.Hosting 10 | Imports Microsoft.Extensions.Logging 11 | 12 | Module MainModule 13 | 14 | End Module 15 | 16 | Public Class Program 17 | Public Shared Sub Main(ByVal args() As String) 18 | CreateHostBuilder(args).Build().Run() 19 | End Sub 20 | Public Shared Function CreateHostBuilder(args() As String) As IHostBuilder 21 | Return Host.CreateDefaultBuilder(args).ConfigureWebHostDefaults( 22 | Sub(webBuilder) webBuilder.UseStartup(Of Startup)()) 23 | End Function 24 | End Class 25 | -------------------------------------------------------------------------------- /VBRazorSample/Controllers/HomeController.vb: -------------------------------------------------------------------------------- 1 | Imports System 2 | Imports System.Collections.Generic 3 | Imports System.Diagnostics 4 | Imports System.Linq 5 | Imports System.Threading.Tasks 6 | Imports Microsoft.AspNetCore.Mvc 7 | Imports VBMvcSample.Models 8 | 9 | Namespace Controllers 10 | Public Class HomeController 11 | 12 | Inherits Controller 13 | 14 | 15 | Public Function Index() As IActionResult 16 | Return View(New IndexView(Students)) 17 | End Function 18 | 19 | Public Function Privacy() As IActionResult 20 | Return View() 21 | End Function 22 | 23 | 24 | Public Function [Error]() As IActionResult 25 | Return View(New ErrorViewModel With {.RequestId = If(Activity.Current?.Id, HttpContext.TraceIdentifier)}) 26 | End Function 27 | 28 | End Class 29 | End Namespace -------------------------------------------------------------------------------- /RazorPages1/Pages/Index.vbxml.vb: -------------------------------------------------------------------------------- 1 | Partial Public Class IndexModel 2 | Private Function GetVbXml() As XElement 3 | Return _ 4 | 5 |

Browse Students

6 |

Select from <%= Students.Count() %> students:

7 |
    8 | <%= (Iterator Function() 9 | For Each std In Students 10 | Yield
  • <%= std.Name %>
  • 11 | Next 12 | End Function)() %> 13 |
14 |

Students details:

15 |
    16 |
  • 17 | Id:
    18 | Name:
    19 |

    Grade:

    20 |
  • 21 |
22 | 26 |
27 | 28 | End Function 29 | 30 | End Class 31 | -------------------------------------------------------------------------------- /RazorPages1/Pages/Error.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model ErrorModel 3 | @{ 4 | ViewData["Title"] = "Error"; 5 | } 6 | 7 |

Error.

8 |

An error occurred while processing your request.

9 | 10 | @if (Model.ShowRequestId) 11 | { 12 |

13 | Request ID: @Model.RequestId 14 |

15 | } 16 | 17 |

Development Mode

18 |

19 | Swapping to the Development environment displays detailed information about the error that occurred. 20 |

21 |

22 | The Development environment shouldn't be enabled for deployed applications. 23 | It can result in displaying sensitive information from exceptions to end users. 24 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 25 | and restarting the app. 26 |

27 | -------------------------------------------------------------------------------- /WebApp1/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 | @model ErrorViewModel 2 | @{ 3 | ViewData["Title"] = "Error"; 4 | } 5 | 6 |

Error.

7 |

An error occurred while processing your request.

8 | 9 | @if (Model.ShowRequestId) 10 | { 11 |

12 | Request ID: @Model.RequestId 13 |

14 | } 15 | 16 |

Development Mode

17 |

18 | Swapping to Development environment will display more detailed information about the error that occurred. 19 |

20 |

21 | The Development environment shouldn't be enabled for deployed applications. 22 | It can result in displaying sensitive information from exceptions to end users. 23 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 24 | and restarting the app. 25 |

26 | -------------------------------------------------------------------------------- /VBRazorSample/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 | @model ErrorViewModel 2 | @{ 3 | ViewData["Title"] = "Error"; 4 | } 5 | 6 |

Error.

7 |

An error occurred while processing your request.

8 | 9 | @if (Model.ShowRequestId) 10 | { 11 |

12 | Request ID: @Model.RequestId 13 |

14 | } 15 | 16 |

Development Mode

17 |

18 | Swapping to Development environment will display more detailed information about the error that occurred. 19 |

20 |

21 | The Development environment shouldn't be enabled for deployed applications. 22 | It can result in displaying sensitive information from exceptions to end users. 23 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 24 | and restarting the app. 25 |

26 | -------------------------------------------------------------------------------- /WebApp1/Controllers/HomeController.vb: -------------------------------------------------------------------------------- 1 | Imports System 2 | Imports System.Collections.Generic 3 | Imports System.Diagnostics 4 | Imports System.Linq 5 | Imports System.Threading.Tasks 6 | Imports WebApp1.Models 7 | Imports Microsoft.AspNetCore.Mvc 8 | 9 | Namespace Controllers 10 | Public Class HomeController : Inherits Controller 11 | 12 | 13 | Public Function Index() As IActionResult 14 | Dim html = New IndexView(Students, ViewData).Html 15 | Return View(New Models.VbXml(html)) 16 | End Function 17 | 18 | Public Function Privacy() As IActionResult 19 | Return View() 20 | End Function 21 | 22 | 23 | Public Function [Error]() As IActionResult 24 | Return View(New ErrorViewModel With {.RequestId = If(Activity.Current?.Id, HttpContext.TraceIdentifier)}) 25 | End Function 26 | End Class 27 | 28 | End Namespace -------------------------------------------------------------------------------- /VbRazor/VBRazorMvcViewOptionsSetup.vb: -------------------------------------------------------------------------------- 1 | Imports Microsoft.AspNetCore.Mvc 2 | Imports Microsoft.AspNetCore.Mvc.ViewEngines 3 | Imports Microsoft.Extensions.Options 4 | 5 | Public Class VBRazorMvcViewOptionsSetup 6 | Implements IConfigureOptions(Of MvcViewOptions) 7 | 8 | 9 | Private ReadOnly _VBRazorViewEngine As IViewEngine 10 | Public Sub New(ByVal VBRazorViewEngine As IViewEngine) 11 | If VBRazorViewEngine Is Nothing Then 12 | Throw New ArgumentNullException(NameOf(VBRazorViewEngine)) 13 | End If 14 | 15 | _VBRazorViewEngine = VBRazorViewEngine 16 | End Sub 17 | 18 | Public Sub Configure(ByVal options As MvcViewOptions) Implements IConfigureOptions(Of MvcViewOptions).Configure 19 | If options Is Nothing Then 20 | Throw New ArgumentNullException(NameOf(options)) 21 | End If 22 | 23 | options.ViewEngines.Add(_VBRazorViewEngine) 24 | End Sub 25 | End Class 26 | -------------------------------------------------------------------------------- /RazorPages1/Pages/Shared/_CookieConsentPartial.cshtml: -------------------------------------------------------------------------------- 1 | @using Microsoft.AspNetCore.Http.Features 2 | 3 | @{ 4 | var consentFeature = Context.Features.Get(); 5 | var showBanner = !consentFeature?.CanTrack ?? false; 6 | var cookieString = consentFeature?.CreateConsentCookie(); 7 | } 8 | 9 | @if (showBanner) 10 | { 11 | 17 | 25 | } 26 | -------------------------------------------------------------------------------- /WebApp1/Views/Shared/_CookieConsentPartial.cshtml: -------------------------------------------------------------------------------- 1 | @using Microsoft.AspNetCore.Http.Features 2 | 3 | @{ 4 | var consentFeature = Context.Features.Get(); 5 | var showBanner = !consentFeature?.CanTrack ?? false; 6 | var cookieString = consentFeature?.CreateConsentCookie(); 7 | } 8 | 9 | @if (showBanner) 10 | { 11 | 17 | 25 | } 26 | -------------------------------------------------------------------------------- /VBRazorSample/Views/Shared/_CookieConsentPartial.cshtml: -------------------------------------------------------------------------------- 1 | @using Microsoft.AspNetCore.Http.Features 2 | 3 | @{ 4 | var consentFeature = Context.Features.Get(); 5 | var showBanner = !consentFeature?.CanTrack ?? false; 6 | var cookieString = consentFeature?.CreateConsentCookie(); 7 | } 8 | 9 | @if (showBanner) 10 | { 11 | 17 | 25 | } 26 | -------------------------------------------------------------------------------- /WebApp1/WebApp1.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.28721.148 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{778DAE3C-4631-46EA-AA77-85C1314464D9}") = "WebApp1", "WebApp1.vbproj", "{3C168550-166C-4E74-8D6C-6DCC4DD91C95}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {3C168550-166C-4E74-8D6C-6DCC4DD91C95}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {3C168550-166C-4E74-8D6C-6DCC4DD91C95}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {3C168550-166C-4E74-8D6C-6DCC4DD91C95}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {3C168550-166C-4E74-8D6C-6DCC4DD91C95}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {C80B7BC5-1ACF-4AB2-AA94-7633AAD00BEE} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /RazorPages1/RazorPages1.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.28721.148 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{778DAE3C-4631-46EA-AA77-85C1314464D9}") = "RazorPages1", "RazorPages1.vbproj", "{6EA34B86-2BBB-437E-911E-019410A619AB}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {6EA34B86-2BBB-437E-911E-019410A619AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {6EA34B86-2BBB-437E-911E-019410A619AB}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {6EA34B86-2BBB-437E-911E-019410A619AB}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {6EA34B86-2BBB-437E-911E-019410A619AB}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {810B395E-1FD2-455F-8122-279576B10CAE} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /WebApp1/Views/Shared/_ValidationScriptsPartial.cshtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 12 | 18 | 19 | -------------------------------------------------------------------------------- /RazorPages1/Pages/Shared/_ValidationScriptsPartial.cshtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 12 | 18 | 19 | -------------------------------------------------------------------------------- /VBRazorSample/Views/Shared/_ValidationScriptsPartial.cshtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 12 | 18 | 19 | -------------------------------------------------------------------------------- /WebApp1/Views/Home/IndexView.vbxml.vb: -------------------------------------------------------------------------------- 1 | Imports Microsoft.AspNetCore.Mvc.ViewFeatures 2 | 3 | Partial Public Class IndexView 4 | Private Function GetVbXml() As XElement 5 | ViewData("Title") = "VB Razor Sample" 6 | Return _ 7 | 8 |

Browse Students

9 |

Select from <%= students.Count() %> students:

10 |
    11 | <%= (Iterator Function() 12 | For Each std In students 13 | Yield
  • <%= std.Name %>
  • 14 | Next 15 | End Function)() %> 16 |
17 |

Students details:

18 |
    19 | <%= (Iterator Function() 20 | For Each std In students : Yield _ 21 |
  • 22 | Id: <%= std.Id %>
    23 | Name: <%= std.Name %>
    24 |

    Grade: <%= std.Grade %>

    25 |
  • 26 | Next 27 | End Function)() %> 28 |
29 | 33 |
34 | 35 | End Function 36 | 37 | End Class 38 | -------------------------------------------------------------------------------- /VBRazorSample/Views/Home/IndexView.vb: -------------------------------------------------------------------------------- 1 | Imports Microsoft.AspNetCore.Mvc.ModelBinding 2 | Imports VbRazor 3 | 4 | Public Class IndexView 5 | Implements IRazor 6 | 7 | Dim students As List(Of Student) 8 | 9 | Public Sub New(students As List(Of Student)) 10 | Me.students = students 11 | 12 | End Sub 13 | 14 | Public Property ViewBag As Object Implements IRazor.ViewBag 15 | 16 | Public Property ModelState As ModelStateDictionary Implements IRazor.ModelState 17 | 18 | Public Function RenderView() As XElement Implements IRazor.RenderView 19 | Dim layout As New LayoutView(Razor(), ViewBag, ModelState) 20 | Return layout.Razor 21 | End Function 22 | 23 | Public Function Razor() As XElement Implements IRazor.Razor 24 | ViewBag.Title = "VB Razor Sample" 25 | Return _ 26 |

27 |

Browse Students

28 |

Select from <%= students.Count() %> students:

29 |
    30 | <%= (Iterator Function() 31 | For Each std In students 32 | Yield
  • <%= std.Name %>
  • 33 | Next 34 | End Function)() %> 35 |
36 | 40 |

41 | 42 | End Function 43 | End Class 44 | -------------------------------------------------------------------------------- /WebApp1/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | /* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | for details on configuring this project to bundle and minify static web assets. */ 3 | 4 | a.navbar-brand { 5 | white-space: normal; 6 | text-align: center; 7 | word-break: break-all; 8 | } 9 | 10 | /* Sticky footer styles 11 | -------------------------------------------------- */ 12 | html { 13 | font-size: 14px; 14 | } 15 | @media (min-width: 768px) { 16 | html { 17 | font-size: 16px; 18 | } 19 | } 20 | 21 | .border-top { 22 | border-top: 1px solid #e5e5e5; 23 | } 24 | .border-bottom { 25 | border-bottom: 1px solid #e5e5e5; 26 | } 27 | 28 | .box-shadow { 29 | box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05); 30 | } 31 | 32 | button.accept-policy { 33 | font-size: 1rem; 34 | line-height: inherit; 35 | } 36 | 37 | /* Sticky footer styles 38 | -------------------------------------------------- */ 39 | html { 40 | position: relative; 41 | min-height: 100%; 42 | } 43 | 44 | body { 45 | /* Margin bottom by footer height */ 46 | margin-bottom: 60px; 47 | } 48 | .footer { 49 | position: absolute; 50 | bottom: 0; 51 | width: 100%; 52 | white-space: nowrap; 53 | /* Set the fixed height of the footer here */ 54 | height: 60px; 55 | line-height: 60px; /* Vertically center the text there */ 56 | } 57 | -------------------------------------------------------------------------------- /RazorPages1/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | /* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | for details on configuring this project to bundle and minify static web assets. */ 3 | 4 | a.navbar-brand { 5 | white-space: normal; 6 | text-align: center; 7 | word-break: break-all; 8 | } 9 | 10 | /* Sticky footer styles 11 | -------------------------------------------------- */ 12 | html { 13 | font-size: 14px; 14 | } 15 | @media (min-width: 768px) { 16 | html { 17 | font-size: 16px; 18 | } 19 | } 20 | 21 | .border-top { 22 | border-top: 1px solid #e5e5e5; 23 | } 24 | .border-bottom { 25 | border-bottom: 1px solid #e5e5e5; 26 | } 27 | 28 | .box-shadow { 29 | box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05); 30 | } 31 | 32 | button.accept-policy { 33 | font-size: 1rem; 34 | line-height: inherit; 35 | } 36 | 37 | /* Sticky footer styles 38 | -------------------------------------------------- */ 39 | html { 40 | position: relative; 41 | min-height: 100%; 42 | } 43 | 44 | body { 45 | /* Margin bottom by footer height */ 46 | margin-bottom: 60px; 47 | } 48 | .footer { 49 | position: absolute; 50 | bottom: 0; 51 | width: 100%; 52 | white-space: nowrap; 53 | /* Set the fixed height of the footer here */ 54 | height: 60px; 55 | line-height: 60px; /* Vertically center the text there */ 56 | } 57 | -------------------------------------------------------------------------------- /VBRazorSample/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | /* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | for details on configuring this project to bundle and minify static web assets. */ 3 | 4 | a.navbar-brand { 5 | white-space: normal; 6 | text-align: center; 7 | word-break: break-all; 8 | } 9 | 10 | /* Sticky footer styles 11 | -------------------------------------------------- */ 12 | html { 13 | font-size: 14px; 14 | } 15 | @media (min-width: 768px) { 16 | html { 17 | font-size: 16px; 18 | } 19 | } 20 | 21 | .border-top { 22 | border-top: 1px solid #e5e5e5; 23 | } 24 | .border-bottom { 25 | border-bottom: 1px solid #e5e5e5; 26 | } 27 | 28 | .box-shadow { 29 | box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05); 30 | } 31 | 32 | button.accept-policy { 33 | font-size: 1rem; 34 | line-height: inherit; 35 | } 36 | 37 | /* Sticky footer styles 38 | -------------------------------------------------- */ 39 | html { 40 | position: relative; 41 | min-height: 100%; 42 | } 43 | 44 | body { 45 | /* Margin bottom by footer height */ 46 | margin-bottom: 60px; 47 | } 48 | .footer { 49 | position: absolute; 50 | bottom: 0; 51 | width: 100%; 52 | white-space: nowrap; 53 | /* Set the fixed height of the footer here */ 54 | height: 60px; 55 | line-height: 60px; /* Vertically center the text there */ 56 | } 57 | -------------------------------------------------------------------------------- /VbRazor/PathHelper.vb: -------------------------------------------------------------------------------- 1 | 2 | Public NotInheritable Class PathHelper 3 | 4 | Private Sub New() 5 | End Sub 6 | 7 | Public Shared Function GetAbsolutePath(ByVal executingFilePath As String, ByVal pagePath As String) As String 8 | ' Path is not valid or a page name; no change required. 9 | If String.IsNullOrEmpty(pagePath) OrElse (Not IsRelativePath(pagePath)) Then 10 | Return pagePath 11 | End If 12 | 13 | If IsAbsolutePath(pagePath) Then 14 | ' An absolute path already; no change required. 15 | Return pagePath.Replace("~/", String.Empty) 16 | End If 17 | 18 | ' Given a relative path i.e. not yet application-relative (starting with "~/" or "/"), interpret 19 | ' path relative to currently-executing view, if any. 20 | If String.IsNullOrEmpty(executingFilePath) Then 21 | ' Not yet executing a view. Start in app root. 22 | Return $"/{pagePath}" 23 | End If 24 | 25 | ' Get directory name (including final slash) but do not use Path.GetDirectoryName() to preserve path 26 | ' normalization. 27 | Dim index = executingFilePath.LastIndexOf("/"c) 28 | Return executingFilePath.Substring(0, index + 1) & pagePath 29 | End Function 30 | 31 | Public Shared Function IsAbsolutePath(name As String) As Boolean 32 | Return name.StartsWith("~/") OrElse name.StartsWith("/") 33 | End Function 34 | 35 | ' Though ./ViewName looks like a relative path, framework searches for that view using view locations. 36 | Public Shared Function IsRelativePath(name As String) As Boolean 37 | Return Not IsAbsolutePath(name) 38 | End Function 39 | End Class 40 | -------------------------------------------------------------------------------- /RazorPages1/Startup.vb: -------------------------------------------------------------------------------- 1 | Imports Microsoft.AspNetCore.Builder 2 | Imports Microsoft.AspNetCore.Hosting 3 | Imports Microsoft.AspNetCore.Http 4 | Imports Microsoft.AspNetCore.HttpsPolicy 5 | Imports Microsoft.AspNetCore.Mvc 6 | Imports Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation 7 | Imports Microsoft.Extensions.Configuration 8 | Imports Microsoft.Extensions.DependencyInjection 9 | Imports Microsoft.Extensions.Hosting 10 | 11 | Public Class Startup 12 | Public Sub New(configuration As IConfiguration) 13 | configuration = configuration 14 | End Sub 15 | 16 | Public ReadOnly Property Configuration As IConfiguration 17 | 18 | ' This method gets called by the runtime. Use this method to add services to the container. 19 | Public Sub ConfigureServices(services As IServiceCollection) 20 | services.Configure(Of CookiePolicyOptions)( 21 | Sub(options) 22 | ' This lambda determines whether user consent for non-essential cookies Is needed for a given request. 23 | options.CheckConsentNeeded = Function(context) True 24 | options.MinimumSameSitePolicy = SameSiteMode.None 25 | End Sub) 26 | 27 | services.AddMvc().AddRazorRuntimeCompilation() 28 | services.AddMvc().AddNewtonsoftJson() 29 | 30 | End Sub 31 | 32 | ' This method gets called by the runtime. Use this method to configure the HTTP request pipeline. 33 | Public Sub Configure(app As IApplicationBuilder, env As IWebHostEnvironment) 34 | 35 | If (env.IsDevelopment()) Then 36 | app.UseDeveloperExceptionPage() 37 | Else 38 | app.UseExceptionHandler("/Home/Error") 39 | ' The default HSTS value Is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. 40 | app.UseHsts() 41 | End If 42 | 43 | app.UseHttpsRedirection() 44 | app.UseStaticFiles() 45 | 46 | app.UseRouting(Sub(routes) routes.MapRazorPages()) 47 | 48 | app.UseCookiePolicy() 49 | app.UseAuthorization() 50 | 51 | 'Vazor.VazorViewMapper.AddStatic(New LayoutView()) 52 | 53 | End Sub 54 | End Class -------------------------------------------------------------------------------- /WebApp1/Startup.vb: -------------------------------------------------------------------------------- 1 | Imports Microsoft.AspNetCore.Builder 2 | Imports Microsoft.AspNetCore.Hosting 3 | Imports Microsoft.AspNetCore.Http 4 | Imports Microsoft.AspNetCore.HttpsPolicy 5 | Imports Microsoft.AspNetCore.Mvc 6 | Imports Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation 7 | Imports Microsoft.Extensions.Configuration 8 | Imports Microsoft.Extensions.DependencyInjection 9 | Imports Microsoft.Extensions.Hosting 10 | 11 | Public Class Startup 12 | Public Sub New(configuration As IConfiguration) 13 | configuration = configuration 14 | End Sub 15 | 16 | Public ReadOnly Property Configuration As IConfiguration 17 | 18 | ' This method gets called by the runtime. Use this method to add services to the container. 19 | Public Sub ConfigureServices(services As IServiceCollection) 20 | services.Configure(Of CookiePolicyOptions)( 21 | Sub(options) 22 | ' This lambda determines whether user consent for non-essential cookies Is needed for a given request. 23 | options.CheckConsentNeeded = Function(context) True 24 | options.MinimumSameSitePolicy = SameSiteMode.None 25 | End Sub) 26 | 27 | services.AddMvc().AddRazorRuntimeCompilation() 28 | services.AddMvc().AddNewtonsoftJson() 29 | 30 | End Sub 31 | 32 | ' This method gets called by the runtime. Use this method to configure the HTTP request pipeline. 33 | Public Sub Configure(app As IApplicationBuilder, env As IWebHostEnvironment) 34 | 35 | If (env.IsDevelopment()) Then 36 | app.UseDeveloperExceptionPage() 37 | Else 38 | app.UseExceptionHandler("/Home/Error") 39 | ' The default HSTS value Is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. 40 | app.UseHsts() 41 | End If 42 | 43 | app.UseHttpsRedirection() 44 | app.UseStaticFiles() 45 | 46 | app.UseRouting( 47 | Sub(routes) 48 | routes.MapControllerRoute( 49 | name:="default", 50 | template:="{controller=Home}/{action=Index}/{id?}") 51 | routes.MapRazorPages() 52 | End Sub) 53 | 54 | app.UseCookiePolicy() 55 | app.UseAuthorization() 56 | 57 | 58 | End Sub 59 | End Class -------------------------------------------------------------------------------- /VbRazor/VBRazorViewEngine.vb: -------------------------------------------------------------------------------- 1 | Imports System.IO 2 | Imports Microsoft.AspNetCore.Mvc 3 | Imports Microsoft.AspNetCore.Mvc.ViewEngines 4 | 5 | Public Class VBRazorViewEngine 6 | Implements IViewEngine 7 | 8 | Public Function GetNormalizedRouteValue(ByVal context As ActionContext, ByVal key As String) As String 9 | If context Is Nothing Then 10 | Throw New ArgumentNullException(NameOf(context)) 11 | End If 12 | 13 | If key Is Nothing Then 14 | Throw New ArgumentNullException(NameOf(key)) 15 | End If 16 | 17 | Dim routeValue As Object 18 | If Not context.RouteData.Values.TryGetValue(key, routeValue) Then 19 | Return Nothing 20 | End If 21 | 22 | Dim normalizedValue As String = Nothing 23 | Dim value As String 24 | If context.ActionDescriptor.RouteValues.TryGetValue(key, value) AndAlso (Not String.IsNullOrEmpty(value)) Then 25 | normalizedValue = value 26 | End If 27 | 28 | Dim stringRouteValue = routeValue?.ToString() 29 | Return If(String.Equals(normalizedValue, stringRouteValue, StringComparison.OrdinalIgnoreCase), normalizedValue, stringRouteValue) 30 | End Function 31 | 32 | Public Function FindView(context As ActionContext, viewName As String, isMainPage As Boolean) As ViewEngineResult Implements IViewEngine.FindView 33 | Dim controllerName = GetNormalizedRouteValue(context, "controller") 34 | Dim areaName = GetNormalizedRouteValue(context, "area") 35 | 36 | Dim checkedLocations = New List(Of String)() 37 | Return ViewEngineResult.Found("Default", New VBRazorView()) 38 | 39 | End Function 40 | 41 | Private Function IViewEngine_GetView(executingFilePath As String, viewPath As String, isMainPage As Boolean) As ViewEngineResult Implements IViewEngine.GetView 42 | Dim applicationRelativePath = PathHelper.GetAbsolutePath(executingFilePath, viewPath) 43 | 44 | If Not PathHelper.IsAbsolutePath(viewPath) Then 45 | ' Not a path this method can handle. 46 | Return ViewEngineResult.NotFound(applicationRelativePath, Enumerable.Empty(Of String)()) 47 | End If 48 | 49 | ' ReSharper disable once Mvc.ViewNotResolved 50 | Return ViewEngineResult.Found("Default", New VBRazorView()) 51 | 52 | End Function 53 | End Class 54 | -------------------------------------------------------------------------------- /VBRazorSample/Startup.vb: -------------------------------------------------------------------------------- 1 | Imports System 2 | Imports System.Collections.Generic 3 | Imports System.Linq 4 | Imports System.Threading.Tasks 5 | Imports Microsoft.AspNetCore.Builder 6 | Imports Microsoft.AspNetCore.Hosting 7 | Imports Microsoft.AspNetCore.Http 8 | Imports Microsoft.AspNetCore.HttpsPolicy 9 | Imports Microsoft.AspNetCore.Mvc 10 | Imports Microsoft.AspNetCore.Mvc.ViewEngines 11 | Imports Microsoft.Extensions.Configuration 12 | Imports Microsoft.Extensions.DependencyInjection 13 | Imports Microsoft.Extensions.Options 14 | 15 | Public Class Startup 16 | 17 | Public Sub New(ByVal configuration As IConfiguration) 18 | 19 | Me.Configuration = configuration 20 | End Sub 21 | 22 | Public ReadOnly Property Configuration() As IConfiguration 23 | 24 | ' This method gets called by the runtime. Use this method to add services to the container. 25 | Public Sub ConfigureServices(ByVal services As IServiceCollection) 26 | 27 | services.Configure(Of CookiePolicyOptions)( 28 | Sub(options) 29 | ' This lambda determines whether user consent for non-essential cookies is needed for a given request. 30 | options.CheckConsentNeeded = Function(context) True 31 | options.MinimumSameSitePolicy = SameSiteMode.None 32 | End Sub) 33 | 34 | services.AddTransient(Of IConfigureOptions(Of MvcViewOptions), VBRazor.VBRazorMvcViewOptionsSetup)() 35 | services.AddSingleton(Of IViewEngine, VBRazor.VBRazorViewEngine)() 36 | 37 | 38 | services.AddMvc().AddNewtonsoftJson() 39 | 40 | End Sub 41 | 42 | ' This method gets called by the runtime. Use this method to configure the HTTP request pipeline. 43 | Public Sub Configure(ByVal app As IApplicationBuilder, ByVal env As IHostingEnvironment) 44 | 45 | If env.IsDevelopment() Then 46 | app.UseDeveloperExceptionPage() 47 | 48 | Else 49 | app.UseExceptionHandler("/Home/Error") 50 | ' The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. 51 | app.UseHsts() 52 | End If 53 | 54 | app.UseHttpsRedirection() 55 | 56 | app.UseStaticFiles() 57 | 58 | app.UseRouting( 59 | Sub(routes) 60 | routes.MapControllerRoute( 61 | name:="default", 62 | template:="{controller=Home}/{action=Index}/{id?}") 63 | routes.MapRazorPages() 64 | End Sub) 65 | 66 | app.UseCookiePolicy() 67 | 68 | app.UseAuthorization() 69 | 70 | End Sub 71 | 72 | End Class 73 | -------------------------------------------------------------------------------- /VB.NET MVC Core Sample.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.28705.295 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{778DAE3C-4631-46EA-AA77-85C1314464D9}") = "WebApp1", "WebApp1\WebApp1.vbproj", "{9540656A-EB63-412E-AD30-343B15E7D1CA}" 7 | EndProject 8 | Project("{778DAE3C-4631-46EA-AA77-85C1314464D9}") = "RazorPages1", "RazorPages1\RazorPages1.vbproj", "{A1DAF3E6-FF95-487A-ADF5-2E40FF3B098F}" 9 | EndProject 10 | Project("{778DAE3C-4631-46EA-AA77-85C1314464D9}") = "VbRazor", "VbRazor\VbRazor.vbproj", "{14C11FFA-A0E8-43FF-BEB9-902D639F3E01}" 11 | EndProject 12 | Project("{778DAE3C-4631-46EA-AA77-85C1314464D9}") = "VBMvcSample", "VBRazorSample\VBMvcSample.vbproj", "{C8A77870-8506-4B89-AB3C-1125D6B0D44A}" 13 | EndProject 14 | Global 15 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 16 | Debug|Any CPU = Debug|Any CPU 17 | Release|Any CPU = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 20 | {9540656A-EB63-412E-AD30-343B15E7D1CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 21 | {9540656A-EB63-412E-AD30-343B15E7D1CA}.Debug|Any CPU.Build.0 = Debug|Any CPU 22 | {9540656A-EB63-412E-AD30-343B15E7D1CA}.Release|Any CPU.ActiveCfg = Release|Any CPU 23 | {9540656A-EB63-412E-AD30-343B15E7D1CA}.Release|Any CPU.Build.0 = Release|Any CPU 24 | {A1DAF3E6-FF95-487A-ADF5-2E40FF3B098F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 25 | {A1DAF3E6-FF95-487A-ADF5-2E40FF3B098F}.Debug|Any CPU.Build.0 = Debug|Any CPU 26 | {A1DAF3E6-FF95-487A-ADF5-2E40FF3B098F}.Release|Any CPU.ActiveCfg = Release|Any CPU 27 | {A1DAF3E6-FF95-487A-ADF5-2E40FF3B098F}.Release|Any CPU.Build.0 = Release|Any CPU 28 | {14C11FFA-A0E8-43FF-BEB9-902D639F3E01}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 29 | {14C11FFA-A0E8-43FF-BEB9-902D639F3E01}.Debug|Any CPU.Build.0 = Debug|Any CPU 30 | {14C11FFA-A0E8-43FF-BEB9-902D639F3E01}.Release|Any CPU.ActiveCfg = Release|Any CPU 31 | {14C11FFA-A0E8-43FF-BEB9-902D639F3E01}.Release|Any CPU.Build.0 = Release|Any CPU 32 | {C8A77870-8506-4B89-AB3C-1125D6B0D44A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 33 | {C8A77870-8506-4B89-AB3C-1125D6B0D44A}.Debug|Any CPU.Build.0 = Debug|Any CPU 34 | {C8A77870-8506-4B89-AB3C-1125D6B0D44A}.Release|Any CPU.ActiveCfg = Release|Any CPU 35 | {C8A77870-8506-4B89-AB3C-1125D6B0D44A}.Release|Any CPU.Build.0 = Release|Any CPU 36 | EndGlobalSection 37 | GlobalSection(SolutionProperties) = preSolution 38 | HideSolutionNode = FALSE 39 | EndGlobalSection 40 | GlobalSection(ExtensibilityGlobals) = postSolution 41 | SolutionGuid = {870DAF7F-0F05-4BEC-BB8F-805DC6BF6ECE} 42 | EndGlobalSection 43 | EndGlobal 44 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Note: 2 | I use a better way in [Vazor](https://github.com/VBAndCs/Vazor) to make use of tag helpers and other Razor capabililties. 3 | 4 | This is a working VB.NET ASP.NET MVC Core Razor sample! 5 | I implemented a simple VBRazorViewEngine in the VbRazor project. 6 | To use VBRazorViewEngine in the web project: 7 | 1- Add a reference to VBRazor.dll 8 | 2- Added these two statements to the Startup.ConfigureServices method: 9 | ```VB.NET 10 | services.AddTransient(Of IConfigureOptions(Of MvcViewOptions), VBRazor.VBRazorMvcViewOptionsSetup)() 11 | services.AddSingleton(Of IViewEngine, VBRazor.VBRazorViewEngine)() 12 | ``` 13 | 14 | 3- Creat a Razor Virew class: 15 | The VBRazor is just a VB class that implements the IVBRazor Interface: 16 | ```VB.NET 17 | Public Interface IVBRazor 18 | ReadOnly Property Razor As String 19 | 20 | End Interface 21 | ``` 22 | 23 | The Razor property uses the xml literals to compose the HTML code and returns it as a string.. Example: 24 | ```VB.NET 25 | Imports VbRazor 26 | 27 | Public Class IndexView 28 | Implements IVBRazor 29 | 30 | Dim students As List(Of Student) 31 | 32 | Public Sub New(students As List(Of Student)) 33 | Me.students = students 34 | End Sub 35 | 36 | Public ReadOnly Property Razor As String Implements IVBRazor.Razor 37 | Get 38 | Dim x = 39 |

Browse Students

40 |

Select from <%= students.Count() %> students:

41 |
    42 | <%= (Iterator Function() 43 | For Each std In students 44 | Yield
  • <%= std.Name %>
  • 45 | Next 46 | End Function)() %> 47 |
48 | 49 | Return x.ToString() 50 | 51 | End Get 52 | End Property 53 | End Class 54 | ``` 55 | 56 | 4- To use the Razor View Class from the Controller: 57 | in the action method, pass an instance of the razor class to the View method, and pass the model data to its constructor: 58 | ```VB.NET 59 | Public Function Index() As IActionResult 60 | Return View(New IndexView(Students)) 61 | End Function 62 | ``` 63 | 64 | And that’s all! 65 | If you run the project, you will see the web page that VBRazor composed!.. In this example, it will be as in the image: 66 | 67 | ![VBRazor](https://user-images.githubusercontent.com/48354902/54750257-bcde8280-4bdf-11e9-9692-a12a989edc15.jpg) 68 | 69 | 70 | This was really easy, but needs more work, so I hope you start contribute to this project to make it a real productive tool! 71 | The first thing to do, it to create a VB.NET template for ASP.NET MVC Core. I had to create a C# project then convert it to VB! 72 | 73 | The second thing to do, is to add intellisense support for html attributes in xml literals in VB! 74 | 75 | We need to try more advanced pages with JavaScript and other components. I hope VB team give us the support wee need to make the most of xml literals. 76 | 77 | -------------------------------------------------------------------------------- /VBRazorSample/My Project/app.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 52 | 59 | 60 | 61 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /RazorPages1/Pages/Shared/_Layout.cshtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | @ViewData["Title"] - RazorPages1 7 | 8 | 9 | 10 | 11 | 12 | 17 | 18 | 19 | 20 | 21 |
22 | 41 |
42 |
43 | 44 |
45 | @RenderBody() 46 |
47 |
48 | 49 |
50 |
51 | © 2019 - RazorPages1 - Privacy 52 |
53 |
54 | 55 | 56 | 57 | 58 | 59 | 60 | 66 | 72 | 73 | 74 | 75 | @RenderSection("Scripts", required: false) 76 | 77 | 78 | -------------------------------------------------------------------------------- /VBRazorSample/Views/Shared/_Layout.cshtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | @ViewData["Title"] - WebApplication1 7 | 8 | 9 | 10 | 11 | 12 | 17 | 18 | 19 | 20 | 21 |
22 | 41 |
42 |
43 | 44 |
45 | @RenderBody() 46 |
47 |
48 | 49 |
50 |
51 | © 2019 - WebApplication1 - Privacy 52 |
53 |
54 | 55 | 56 | 57 | 58 | 59 | 60 | 66 | 72 | 73 | 74 | 75 | @RenderSection("Scripts", required: false) 76 | 77 | 78 | -------------------------------------------------------------------------------- /WebApp1/Views/Shared/_Layout.cshtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | @ViewData["Title"] - WebApp1 7 | 8 | 9 | 10 | 11 | 12 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 42 |
43 | 44 |
45 | 46 |
47 | @RenderBody() 48 |
49 |
50 | 51 |
52 |
53 | _vazor_amp_copy; 2019 - WebApplication2 - Privacy 54 |
55 |
56 | 57 | 58 | 59 | 60 | 61 | 62 | 68 | 74 | 75 | 76 | @RenderSection("Scripts", required: false) 77 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /VBRazorSample/Views/Shared/LayoutView.vb: -------------------------------------------------------------------------------- 1 | Imports Microsoft.AspNetCore.Mvc.ModelBinding 2 | Imports VbRazor 3 | 4 | Public Class LayoutView 5 | Implements ILayoutRazor 6 | 7 | Public Sub New(body As XElement, viewBag As Object, modelState As ModelStateDictionary) 8 | Me.Body = body 9 | Me.ViewBag = viewBag 10 | Me.ModelState = modelState 11 | End Sub 12 | 13 | Public Property Body As XElement Implements ILayoutRazor.Body 14 | 15 | Public Property ViewBag As Object Implements ILayoutRazor.ViewBag 16 | 17 | Public Property ModelState As ModelStateDictionary Implements ILayoutRazor.ModelState 18 | 19 | Function Razor() As XElement Implements IRazor.Razor 20 | Return _ 21 | 22 | 23 | 24 | 25 | <%= ViewBag.Title %> - WebApplication1 26 | 27 | 28 | 29 | 30 | 31 | 36 | 37 | 38 | 39 | 40 |
41 | 60 |
61 |
62 | 63 |
64 | <%= Body %> 65 |
66 |
67 | 68 |
69 |
70 | copy; 2019 - WebApplication1 - Privacy 71 |
72 |
73 | 74 | 75 | 76 | 77 | 78 | 79 | 85 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | ' <%= RenderSection("Scripts", required False) %> 98 | End Function 99 | 100 | Public Function RenderView() As XElement Implements IRazor.RenderView 101 | Return Razor() 102 | End Function 103 | End Class 104 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Build results 17 | [Dd]ebug/ 18 | [Dd]ebugPublic/ 19 | [Rr]elease/ 20 | [Rr]eleases/ 21 | x64/ 22 | x86/ 23 | [Aa][Rr][Mm]/ 24 | [Aa][Rr][Mm]64/ 25 | bld/ 26 | [Bb]in/ 27 | [Oo]bj/ 28 | [Ll]og/ 29 | 30 | # Visual Studio 2015/2017 cache/options directory 31 | .vs/ 32 | # Uncomment if you have tasks that create the project's static files in wwwroot 33 | #wwwroot/ 34 | 35 | # Visual Studio 2017 auto generated files 36 | Generated\ Files/ 37 | 38 | # MSTest test Results 39 | [Tt]est[Rr]esult*/ 40 | [Bb]uild[Ll]og.* 41 | 42 | # NUNIT 43 | *.VisualState.xml 44 | TestResult.xml 45 | 46 | # Build Results of an ATL Project 47 | [Dd]ebugPS/ 48 | [Rr]eleasePS/ 49 | dlldata.c 50 | 51 | # Benchmark Results 52 | BenchmarkDotNet.Artifacts/ 53 | 54 | # .NET Core 55 | project.lock.json 56 | project.fragment.lock.json 57 | artifacts/ 58 | 59 | # StyleCop 60 | StyleCopReport.xml 61 | 62 | # Files built by Visual Studio 63 | *_i.c 64 | *_p.c 65 | *_h.h 66 | *.ilk 67 | *.meta 68 | *.obj 69 | *.iobj 70 | *.pch 71 | *.pdb 72 | *.ipdb 73 | *.pgc 74 | *.pgd 75 | *.rsp 76 | *.sbr 77 | *.tlb 78 | *.tli 79 | *.tlh 80 | *.tmp 81 | *.tmp_proj 82 | *_wpftmp.csproj 83 | *.log 84 | *.vspscc 85 | *.vssscc 86 | .builds 87 | *.pidb 88 | *.svclog 89 | *.scc 90 | 91 | # Chutzpah Test files 92 | _Chutzpah* 93 | 94 | # Visual C++ cache files 95 | ipch/ 96 | *.aps 97 | *.ncb 98 | *.opendb 99 | *.opensdf 100 | *.sdf 101 | *.cachefile 102 | *.VC.db 103 | *.VC.VC.opendb 104 | 105 | # Visual Studio profiler 106 | *.psess 107 | *.vsp 108 | *.vspx 109 | *.sap 110 | 111 | # Visual Studio Trace Files 112 | *.e2e 113 | 114 | # TFS 2012 Local Workspace 115 | $tf/ 116 | 117 | # Guidance Automation Toolkit 118 | *.gpState 119 | 120 | # ReSharper is a .NET coding add-in 121 | _ReSharper*/ 122 | *.[Rr]e[Ss]harper 123 | *.DotSettings.user 124 | 125 | # JustCode is a .NET coding add-in 126 | .JustCode 127 | 128 | # TeamCity is a build add-in 129 | _TeamCity* 130 | 131 | # DotCover is a Code Coverage Tool 132 | *.dotCover 133 | 134 | # AxoCover is a Code Coverage Tool 135 | .axoCover/* 136 | !.axoCover/settings.json 137 | 138 | # Visual Studio code coverage results 139 | *.coverage 140 | *.coveragexml 141 | 142 | # NCrunch 143 | _NCrunch_* 144 | .*crunch*.local.xml 145 | nCrunchTemp_* 146 | 147 | # MightyMoose 148 | *.mm.* 149 | AutoTest.Net/ 150 | 151 | # Web workbench (sass) 152 | .sass-cache/ 153 | 154 | # Installshield output folder 155 | [Ee]xpress/ 156 | 157 | # DocProject is a documentation generator add-in 158 | DocProject/buildhelp/ 159 | DocProject/Help/*.HxT 160 | DocProject/Help/*.HxC 161 | DocProject/Help/*.hhc 162 | DocProject/Help/*.hhk 163 | DocProject/Help/*.hhp 164 | DocProject/Help/Html2 165 | DocProject/Help/html 166 | 167 | # Click-Once directory 168 | publish/ 169 | 170 | # Publish Web Output 171 | *.[Pp]ublish.xml 172 | *.azurePubxml 173 | # Note: Comment the next line if you want to checkin your web deploy settings, 174 | # but database connection strings (with potential passwords) will be unencrypted 175 | *.pubxml 176 | *.publishproj 177 | 178 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 179 | # checkin your Azure Web App publish settings, but sensitive information contained 180 | # in these scripts will be unencrypted 181 | PublishScripts/ 182 | 183 | # NuGet Packages 184 | *.nupkg 185 | # The packages folder can be ignored because of Package Restore 186 | **/[Pp]ackages/* 187 | # except build/, which is used as an MSBuild target. 188 | !**/[Pp]ackages/build/ 189 | # Uncomment if necessary however generally it will be regenerated when needed 190 | #!**/[Pp]ackages/repositories.config 191 | # NuGet v3's project.json files produces more ignorable files 192 | *.nuget.props 193 | *.nuget.targets 194 | 195 | # Microsoft Azure Build Output 196 | csx/ 197 | *.build.csdef 198 | 199 | # Microsoft Azure Emulator 200 | ecf/ 201 | rcf/ 202 | 203 | # Windows Store app package directories and files 204 | AppPackages/ 205 | BundleArtifacts/ 206 | Package.StoreAssociation.xml 207 | _pkginfo.txt 208 | *.appx 209 | 210 | # Visual Studio cache files 211 | # files ending in .cache can be ignored 212 | *.[Cc]ache 213 | # but keep track of directories ending in .cache 214 | !?*.[Cc]ache/ 215 | 216 | # Others 217 | ClientBin/ 218 | ~$* 219 | *~ 220 | *.dbmdl 221 | *.dbproj.schemaview 222 | *.jfm 223 | *.pfx 224 | *.publishsettings 225 | orleans.codegen.cs 226 | 227 | # Including strong name files can present a security risk 228 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 229 | #*.snk 230 | 231 | # Since there are multiple workflows, uncomment next line to ignore bower_components 232 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 233 | #bower_components/ 234 | # ASP.NET Core default setup: bower directory is configured as wwwroot/lib/ and bower restore is true 235 | **/wwwroot/lib/ 236 | 237 | # RIA/Silverlight projects 238 | Generated_Code/ 239 | 240 | # Backup & report files from converting an old project file 241 | # to a newer Visual Studio version. Backup files are not needed, 242 | # because we have git ;-) 243 | _UpgradeReport_Files/ 244 | Backup*/ 245 | UpgradeLog*.XML 246 | UpgradeLog*.htm 247 | ServiceFabricBackup/ 248 | *.rptproj.bak 249 | 250 | # SQL Server files 251 | *.mdf 252 | *.ldf 253 | *.ndf 254 | 255 | # Business Intelligence projects 256 | *.rdl.data 257 | *.bim.layout 258 | *.bim_*.settings 259 | *.rptproj.rsuser 260 | *- Backup*.rdl 261 | 262 | # Microsoft Fakes 263 | FakesAssemblies/ 264 | 265 | # GhostDoc plugin setting file 266 | *.GhostDoc.xml 267 | 268 | # Node.js Tools for Visual Studio 269 | .ntvs_analysis.dat 270 | node_modules/ 271 | 272 | # Visual Studio 6 build log 273 | *.plg 274 | 275 | # Visual Studio 6 workspace options file 276 | *.opt 277 | 278 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 279 | *.vbw 280 | 281 | # Visual Studio LightSwitch build output 282 | **/*.HTMLClient/GeneratedArtifacts 283 | **/*.DesktopClient/GeneratedArtifacts 284 | **/*.DesktopClient/ModelManifest.xml 285 | **/*.Server/GeneratedArtifacts 286 | **/*.Server/ModelManifest.xml 287 | _Pvt_Extensions 288 | 289 | # Paket dependency manager 290 | .paket/paket.exe 291 | paket-files/ 292 | 293 | # FAKE - F# Make 294 | .fake/ 295 | 296 | # JetBrains Rider 297 | .idea/ 298 | *.sln.iml 299 | 300 | # CodeRush personal settings 301 | .cr/personal 302 | 303 | # Python Tools for Visual Studio (PTVS) 304 | __pycache__/ 305 | *.pyc 306 | 307 | # Cake - Uncomment if you are using it 308 | # tools/** 309 | # !tools/packages.config 310 | 311 | # Tabs Studio 312 | *.tss 313 | 314 | # Telerik's JustMock configuration file 315 | *.jmconfig 316 | 317 | # BizTalk build output 318 | *.btp.cs 319 | *.btm.cs 320 | *.odx.cs 321 | *.xsd.cs 322 | 323 | # OpenCover UI analysis results 324 | OpenCover/ 325 | 326 | # Azure Stream Analytics local run output 327 | ASALocalRun/ 328 | 329 | # MSBuild Binary and Structured Log 330 | *.binlog 331 | 332 | # NVidia Nsight GPU debugger configuration file 333 | *.nvuser 334 | 335 | # MFractors (Xamarin productivity tool) working folder 336 | .mfractor/ 337 | 338 | # Local History for Visual Studio 339 | .localhistory/ 340 | 341 | # BeatPulse healthcheck temp database 342 | healthchecksdb --------------------------------------------------------------------------------