dotnet-presentations / blazor-workshop Goto Github PK
View Code? Open in Web Editor NEWBlazor workshop
Home Page: https://aka.ms/blazorworkshop
License: MIT License
Blazor workshop
Home Page: https://aka.ms/blazorworkshop
License: MIT License
The latest Blazor Language Services extension will not install for 2017, where can we get that to do this tutorial with VS 2017? Install 2019 RC and Core 3 and extensions still will not install. Running the VSIX directly says is cant find any version to install to. Running from manage extensions in 2019 says it fails due to:
3/18/2019 10:15:18 AM - Beginning to install extension to Microsoft Visual Studio Enterprise 2019...
3/18/2019 10:15:18 AM - Found setup instance 9d67d567 but not in launchable state.
3/18/2019 10:15:18 AM - Install Error : System.InvalidOperationException: Cannot find setup engine instance.
I resolved this with help from the Dev Community post:
Will Vasquez · Jan 09 at 12:33 AM 0 Share
Not very obvious but if you go to Tools -> Options and search for .NET Core you'll see a checkbox that says "Use previews of the .NET Core SDK". After checking this I was able to load the projects just fine.
UserController.SignInCompleted
returns userState in json. But this will not be able to handle accent characters like my name László. I suggest adding some encoding and UserStateProvider.OnSignInStateChanged
method should decode or fire
CurrentUser = await HttpClient.GetJsonAsync<UserState>($"/user");
Severity Code Description Project File Line Suppression State
Error MSB3073 The command "dotnet "C:\Users\liudm.nuget\packages\microsoft.aspnetcore.blazor.build\3.0.0-preview5-19227-01\targets../tools/Microsoft.AspNetCore.Blazor.Build.dll" write-boot-json "obj\Debug\netstandard2.0\BlazingPizza.Client.dll" --references "C:\Users\liudm\Downloads\blazor-workshop-master\src\BlazingPizza.Client\obj\Debug\netstandard2.0\blazor\bootjson-references.txt" --embedded-resources "C:\Users\liudm\Downloads\blazor-workshop-master\src\BlazingPizza.Client\obj\Debug\netstandard2.0\blazor\embedded.resources.txt" --linker-enabled --output "C:\Users\liudm\Downloads\blazor-workshop-master\src\BlazingPizza.Client\obj\Debug\netstandard2.0\blazor\blazor.boot.json"" exited with code -2147450730. BlazingPizza.Client C:\Users\liudm.nuget\packages\microsoft.aspnetcore.blazor.build\3.0.0-preview5-19227-01\targets\Blazor.MonoRuntime.targets 633
When I gave the workshop attendees were a bit stuck on this step: https://github.com/dotnet-presentations/blazor-workshop/blob/master/docs/04-refactor-state-management.md#exploring-state-changes
Many were not sure how to integrate OrderState into the Index component. Some additional guidance should be added here to guide users through the process.
Installed preview 5 etc.
System.IO.DirectoryNotFoundException
HResult=0x80070003
Message=C:\Users\liudm\Downloads\blazor-workshop-master\src\BlazingPizza.Client\bin\Debug\netstandard2.0\dist
Source=Microsoft.Extensions.FileProviders.Physical
StackTrace:
at Microsoft.Extensions.FileProviders.PhysicalFileProvider..ctor(String root, ExclusionFilters filters)
at Microsoft.AspNetCore.Builder.BlazorApplicationBuilderExtensions.UseBlazor(IApplicationBuilder app, BlazorOptions options)
at BlazingPizza.Server.Startup.Configure(IApplicationBuilder app, IWebHostEnvironment env) in C:\Users\liudm\Downloads\blazor-workshop-master\src\BlazingPizza.Server\Startup.cs:line 75
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Microsoft.AspNetCore.Hosting.Internal.ConfigureBuilder.Invoke(Object instance, IApplicationBuilder builder)
at Microsoft.AspNetCore.Hosting.Internal.ConfigureBuilder.<>c__DisplayClass4_0.b__0(IApplicationBuilder builder)
at Microsoft.AspNetCore.Hosting.Internal.GenericWebHostBuilder.<>c__DisplayClass13_0.b__2(IApplicationBuilder app)
at Microsoft.AspNetCore.Mvc.Filters.MiddlewareFilterBuilderStartupFilter.<>c__DisplayClass0_0.g__MiddlewareFilterBuilder|0(IApplicationBuilder builder)
at Microsoft.AspNetCore.Server.IIS.Core.IISServerSetupFilter.<>c__DisplayClass2_0.b__0(IApplicationBuilder app)
at Microsoft.AspNetCore.HostFilteringStartupFilter.<>c__DisplayClass0_0.b__0(IApplicationBuilder app)
at Microsoft.AspNetCore.Hosting.Internal.GenericWebHostService.d__31.MoveNext()
Hi,
I'm doing this awesome workshop on "preview5" branch (downgraded to preview4 because preview5 is not yet out) and I couldn't get the map to work.
It turns out that the save point projects for chapters 00-05 are missing using statment for map component in BlazingPizza.Client\_Imports.razor
:
@using BlazingPizza.ComponentsLibrary.Map
Either this should be mentioned in chapter about map or it should be added to the _Imports.razor
file in save point projects.
Some of the older screens shots still use the same image for all pizzas. We should update the screen shots at some point.
Would be great to see a RC/server-side version of the blazzing pizza application and workshop with best practices on authentication, identity, validations, etc
I searched various branches but I couldn't find it.
I am a little confused about this :
In one hand :
Remove any call to app.UseBlazor() and instead add a call to app.UseClientSideBlazor() before the call to app.UseRouting(). Also add a call to endpoints.MapFallbackToClientSideBlazor("index.html") in the call to app.UseEndpoints().
`app.UseClientSideBlazorFiles<Client.Startup>();
app.UseRouting();
app.UseAuthentication();
app.UseAuthorization();
app.UseEndpoints(endpoints =>
{
endpoints.MapControllers();
endpoints.MapFallbackToClientSideBlazor<Client.Startup>("index.html");
});`
https://devblogs.microsoft.com/aspnet/asp-net-core-and-blazor-updates-in-net-core-3-0-preview-6/
In the other hand:
`app.UseRouting();
app.UseAuthentication();
app.UseAuthorization();
app.UseClientSideBlazorFiles<Client.Startup>();
app.UseEndpoints(endpoints =>
{
endpoints.MapControllers();
endpoints.MapFallbackToClientSideBlazor<Client.Startup>("index.html");
});`
Thanks,
Maher
Slider?
BootstrapRadioButton?
I'm not sure if the updated tooling will be shipped early enough to use preview 6 for NDC Oslo, but if it is, we can switch over to the built-in auth features. If we change to a redirection flow instead of the popup, most of the code will disappear entirely.
We can keep the popup if we want, but that will involve retaining more of the custom code.
Now as soon as the server accepts the order, the browser will switch to the "order details" display and being polling for updates.
should be
Now as soon as the server accepts the order, the browser will switch to the "order details" display and begin polling for updates.
If the app uses authentication/authorization features such as AuthorizePage or [Authorize], place the call to UseAuthentication and UseAuthorization after UseRouting.
03-show-order-status.md mentions the following:
It would be nice if, once the order is placed, you navigated to the details display for that order automatically. This is quite easy to do.
Now as soon as the server accepts the order, the browser will switch to the "order details" display and begin polling for updates.
However, this does not happen. The sample code simply navigates to "myorders", which is the list of orders, not the order details.
I am running VS 2019 Preview
Microsoft Visual Studio Community 2019 Preview
Version 16.2.0 Preview 2.0
VisualStudio.16.Preview/16.2.0-pre.2.0+29006.145
Microsoft .NET Framework
Version 4.7.03056
Installed Version: Community
I did a git pull on this project. I updated all Nuget Packages to Preview versions. Will not compile.
Severity Code Description Project File Line Suppression State
Error CS1061 'IApplicationBuilder' does not contain a definition for 'UseBlazor' and no accessible extension method 'UseBlazor' accepting a first argument of type 'IApplicationBuilder' could be found (are you missing a using directive or an assembly reference?) BlazingPizza.Server C:\Blazor\Pizza\blazor-workshop\src\BlazingPizza.Server\Startup.cs 73 Active
Severity Code Description Project File Line Suppression State
Error CS1061 'IApplicationBuilder' does not contain a definition for 'UseAuthorization' and no accessible extension method 'UseAuthorization' accepting a first argument of type 'IApplicationBuilder' could be found (are you missing a using directive or an assembly reference?) BlazingPizza.Server C:\Blazor\Pizza\blazor-workshop\src\BlazingPizza.Server\Startup.cs 69 Active
I have googled and googled for a solution, but nothing.
Add member to calc total price instead of linq
Look for repeated stuff, not educational stuff, etc
var newOrderId = wait HttpClient.PostJsonAsync("orders", OrderState.Order);
Blazing Pizza.Client Pages Index
Is this possible? I have tried numerous pathways and no luck.
in the latest .net core 3 preview 6 version, the delivery location is added as an Owned type. When I run it (both Src or save points) the DeliveryLocation is saved to the database, but with retrieving the orders (for the myorder overview or detail screen) the deliveryLocation property stays null resulting in an error.
When I explicitly include the DeliveryLocation in the query in the ordersController ( .Include(o => o.DeliveryLocation) it works.
Not sure if anyone else experience this also ?
I created a server side version of this project (.Net Core 3.0 Preview 4) at:
https://github.com/ADefWebserver/BlazingPizza
I am following allow the tutorial adding adding all code to the save-point 00 set of projects. When attempting to follow the instructions for https://github.com/dotnet-presentations/blazor-workshop/blob/master/docs/03-show-order-status.md#automatically-navigating-to-order-details the application throws an error because the Orders Controller method PlaceOrder does not return the OrderId. Would you please consider returning the OrderId in save-point 00 - 02
This appears to be related to #71
Thank you.
The sample code for the PollForUpdates() method under Polling for order details throws an exception when called. The URL for the api that HttpClient calls should not start with a forward slash.
I've cloned the repo and opened the BlazingPizza.sln solutions in the 00-starting-point and 01-Components-and-layouts folder, but when trying to build them I get the following build error:
C:\Users\johnsteed\.nuget\packages\microsoft.aspnetcore.blazor.build\3.0.0-preview5-19227-01\targets\Blazor.MonoRuntime.targets(633,5): error MSB3073: The command "dotnet "C:\Users\johnsteed\.nuget\packages\microsoft.aspnetcore.blazor.build\3.0.0-preview5-19227-01\targets\../tools/Microsoft.AspNetCore.Blazor.Build.dll" write-boot-json "obj\Debug\netstandard2.0\BlazingPizza.Client.dll" --references "C:\Users\johnsteed\Source\Repos\blazor-workshop\save-points\01-Components-and-layout\BlazingPizza.Client\obj\Debug\netstandard2.0\blazor\bootjson-references.txt" --embedded-resources "C:\Users\johnsteed\Source\Repos\blazor-workshop\save-points\01-Components-and-layout\BlazingPizza.Client\obj\Debug\netstandard2.0\blazor\embedded.resources.txt" --linker-enabled --output "C:\Users\johnsteed\Source\Repos\blazor-workshop\save-points\01-Components-and-layout\BlazingPizza.Client\obj\Debug\netstandard2.0\blazor\blazor.boot.json"" exited with code -2147450730.
I'm running .NET Core 3 Preview 4 and have the latest Blazor tools for Visual Studio installed. I can't find any information with regard to exit codes of the dotnet CLI so I have no idea what the problem could be. Any ideas?
I just wondering that how can we do the live-reload feature which is really important when we do a front-end development. Could we use dotnet watch run
command on the Server project? I have tried it, but it was not working.
I am trying to debug the application but since it's started from the BlazingPizza.Server Project and not the BlazingPizza.Client Project the debugger does not seem to start.
After entering the keys Shift + Alt + D, a new tab opens with the message:
http://localhost:64589/_framework/debug?url=http%3A%2F%2Flocalhost%3A64589%2F
Running the following command in the run dialog doesn't work either:
"%programfiles(x86)%\Google\Chrome\Application\chrome.exe" --remote-debugging-port=9222 http://localhost:64589/
What is the right way to debug this application?
File : src/BlazingPizza.Client/Pages/Index.razor
Function : async Task PlaceOrder()
Line No : 75
var newOrderId = wait HttpClient.PostJsonAsync<int>("orders", OrderState.Order);
written mistake in "wait" -> "await"
Add some intro text
Add setup instructions
Cleanup workshop outline
Add session links
I've implemented most of the auth stuff:
AddTwitter
, but the client doesn't know anything specific to Twitter, so it could easily be swapped for any ASP.NET Core-compatible authentication mechanism.[Authorize]
on OrdersController
What I haven't done yet is stamp the current user's ID onto each Order
as it gets persisted, and use the current user's ID as a "where" clause when retrieving existing orders. It's after midnight here now - @rynowak, do you think you might be able to finish that bit off?
The net result of all the auth stuff is pretty good in some respects (I particularly love the ForceSignInLayout
which is the UI equivalent of [Authorize]
on a @page
). But it's also a bit complex (particularly the JS interop code in index.html
), so rather than getting attendees to write all this by hand, we might want to factor some of it out into a library.
For each section:
Not difficult or urgent, but will look better. I can do this at some point, maybe at the weekend.
We used to publish the Blazor VSIX builds to the blazor-dev feed on MyGet. You can add MyGet feeds as extension feeds in VS. We should now be publishing the Blazor VSIX builds to the aspnetcore-dev feed.
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.