Giter Club home page Giter Club logo

blazor-workshop's People

Contributors

ardalis avatar baspaap avatar bradygaster avatar chrissainty avatar creeeeeg avatar csharpfritz avatar danroth27 avatar dotnetspark avatar edcharbeneau avatar erikpetersendev avatar franksbrain avatar habeebmatrix avatar jglozano avatar joe-larue avatar jongalloway avatar ksantacr avatar lukehook avatar maherjendoubi avatar marcelo-maciel avatar maxmommersteeg avatar mdelbrocco-od avatar mkartakmsft avatar morgemoensch avatar poteb avatar rms81 avatar rynowak avatar steventcramer avatar stevesandersonms avatar toiwright avatar wicksipedia avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

blazor-workshop's Issues

Blazor Language Services extension for 2017

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.

User's display name encoding

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");

Failed to Run

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

Error app.UseBlazor<Client.Startup>();

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()

Missing "using" directive for map component in _Imports.razor

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.

app.UseClientSideBlazor<TStartup>() before or after app.UseRouting()?

Hi @SteveSandersonMS,

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");
        });`

https://github.com/dotnet-presentations/blazor-workshop/blob/b6c29b13e374d68e9f613251e7dab1cad18f1bd2/src/BlazingPizza.Server/Startup.cs

Thanks,
Maher

Update to preview 6 and new auth features

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.

minor gammar

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.

Client does not navigate to details display in save-point 03

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.

Just did a download and updated packages, will not build

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.

Components not loading

Completed projected compiled and run components not showing on page errors displayed in debug
image

Typo on line 76

var newOrderId = wait HttpClient.PostJsonAsync("orders", OrderState.Order);
Blazing Pizza.Client Pages Index

DeliveryLocation is null resulting in an error

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 ?

OrdersController PlaceOrder does not return OrderId in save-point 00

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.

Simplify Index.cshtml

  • Remove WaitDialog
  • Use AppState pattern
  • Fix cart state issue
  • Break into smaller components

Solutions in save-points 00 and 01 do not build/

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?

Live-reload on this workshop projects

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.

Server application lacks UseBlazorDebugging call

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?

Compile error

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"

Cleanup main readme

Add some intro text
Add setup instructions
Cleanup workshop outline
Add session links

Associate orders with individual users

I've implemented most of the auth stuff:

  • The UI shows login state at the top, and forces you to log in before you can do certain things (submit order or view existing orders)
  • The backend uses ASP.NET Core's general authentication system. In this case it's wired up to Twitter via 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.
  • The backend enforces "you must be signed in" via [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.

Add per section content

For each section:

  • Start and end code point
  • Step-by-step instructions
  • Presentation content

Publish Blazor VSIX builds to MyGet

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.