andrewlock / blog-examples Goto Github PK
View Code? Open in Web Editor NEWSample applications for blog posts on https://andrewlock.net
License: MIT License
Sample applications for blog posts on https://andrewlock.net
License: MIT License
Hello thanks for this, can you update to .ne core 8.
Also we are often dealing so much with user membership can you please add a good self hosted and firebase authentication sample since these two offer free options.
Hello can you show example of such.
Allow user to create claims/roles in the UI, and apply to objects/entities from UI.
Currently the user creates an entity objects with some fields and wants to attach a claim.
Sorry for disturbing you, I noticed about this problem about a week ago and I'm not sure I understand this correctly, but looks like this generator is not incremental at all.
Here I read that
I think I know what tutorial you probably followed here, but I'm afraid it was just completely incorrect.
...
You should never have any compilations or symbols in any steps of your incremental pipelines, and especially in output steps.
Those objects are not equatable and not meant to be used this way.
If I correct it would super cool to fix this place and update your tutorial. A lot of people follow that tutorial and obtain this error.
Again, I'm not sure I understand the things correctly. Sorry if I'm wrong.
Thanks!
I'm having the same problem, but my projects are of type WorkerService and AzureFunctions, as I don't have Asp.NetCore I won't be able to use IHttpContextAccessor, can you help me in this scenario?
I'm trying the JsonFileDataAttribute, but I'm getting the error shown above when it attempts run run "JsonTests" below. If I put a breakpoint in the constructor for JsonFileDataAttribute I never hit it. Any ideas?
[Theory] [JsonFileData("blah")] public void JsonTests(object test) { Console.WriteLine(JsonConvert.SerializeObject(test)); }
Thank you for this demo.
I used this codes but i get error on this line :
Image sourceImage = await this.LoadImageFromUrl(url);
That says : Cannot declare a variable of static type 'Image'
I am using DotNet Core 2.
I need to save one image on my host and resize that image by calling an address but not save other sizes on disk.
I need to load resized images from catch.
Please help i need it very urgent .
There is a check in SecurityHeadersMiddleware for the _policy argument being null when it should be on policy. This causes a runtime error.
Nice post on Auth0 + SS Blazor
Just a heads up the url in the post for the sample gives a 404
Blog Post
https://andrewlock.net/adding-authentication-to-a-blazor-server-app-using-auth0/
404 Url
https://github.com/andrewlock/blog-examples/tree/master/Auth0BlazorServer
PS
would love to learn some more on the Next Steps - ie permissions/claims.
I referenced the artical https://andrewlock.net/sharing-appsettings-json-configuration-files-between-projects-in-asp-net-core/
that share appsettings.json files between projects. it works OK.
but when debug with docker ,it told us that can't find the files,which means still need to copy the linked file to the real file location.
is there any way to fix it?
tks.
Hello,
I've read your series about Blazor with source generators.
I'm creating a blog using Blazor WASM and markdown files as the backend for my articles.
I want to get all possibles routes (meaning all the paths to get my markdown files). So for now i'm generating a .json with a powershell script as a PostBuildEvent. Then during runtime i'm downloading this file and i can populate my navigation.
But is it possible to embed it in the code directly ?
I would create a service in a .cs that will have that list of paths and returns it. The interface of that service should be added to the DI and injected in my razor files to generate the paths at runtime.
Or is my only option to disable the new source generation of razor ?
Hi Andrew,
In this blogpost you're talking about sharing appsettings accross multiple projects.
.ConfigureAppConfiguration((hostingContext, config) =>
{
var env = hostingContext.HostingEnvironment;
var sharedFolder = Path.Combine(env.ContentRootPath, "..", "Shared");
config
.AddJsonFile(Path.Combine(sharedFolder, "SharedSettings.json"), optional: true) // When running using dotnet run
.AddJsonFile("SharedSettings.json", optional: true) // When app is published
.AddJsonFile("appsettings.json", optional: true)
.AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true);
config.AddEnvironmentVariables();
})
The behavior I observe when setting the Build action
and Copy to Output directory
properties of my SharedSettings.json file to Content
and Copy if newer
, respectively, is that dotnet run
copies the SharedSettings.json to the build directory as expected. Therefore, it is not needed to specify a path (as seen below) to the relative location of SharedSettings.json.
.AddJsonFile(Path.Combine(sharedFolder, "SharedSettings.json"), optional: true) // When running using dotnet run
This will work for local development, as well post publish. Is this correct? Or am I missing something?
Thanks!
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.