.Net Devops Website
dotnetdevops / dotnetdevops.extensions.azurefunctions Goto Github PK
View Code? Open in Web Editor NEWExtensions for Azure Functions to run AspNetCore applications.
Extensions for Azure Functions to run AspNetCore applications.
Given the following context: a MyNamespace.FunctionHost
project with an azure function and a MyNamespace.AspNetCoreWebsite
with a aspnet core website with razor pages and referencing the website from the function project.
When building the azure function project, it copies over all the dlls and put them in a bin folder under the function output.
Note that the compiled razor views are there too, but not placed in the bin folder.
<RazorCompileOnBuild>True</RazorCompileOnBuild>
<RazorCompileOnPublish>True</RazorCompileOnPublish>
<RazorEmbeddedResource>True</RazorEmbeddedResource>
<PreserveCompilationContext>true</PreserveCompilationContext>
<MvcRazorExcludeRefAssembliesFromPublish>false</MvcRazorExcludeRefAssembliesFromPublish>
<CopyRefAssembliesToPublishDirectory>true</CopyRefAssembliesToPublishDirectory>
When publishing the function project, the output also contains the wwwroot and appsettings files.
Everything actually runs with func host start
in the published output folder.
But when running from visual studio with/without debug (F5), it results in razor issues:
I suspect that the issue here is related to that I in the implementation here for the aspnet core runner, is setting the contentPath(when running with environment=development) to the website project folder - meaning that it properly also detects the /Pages/* razor .cshtml files in the project folder. (Assumption correct?)
The reason that I made this development attribute to change content path, is because as outlined above - that when running in visual studio it do not do a full publish and the content files are not copied over and the only idea I had to fix that was to change the content path.
So how do we create a better development experience for this? Are there any magic way to make the build also copy over content files for the function project when F5? Or is the best way to set content path? If so, how do we then make sure that razor works?
I think when vs runs a aspnet core site, it also is setting content path to the project folder. Is this not what makes you able to change wwwroot files and they are reflected right away without rebuild?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.