Samples for ASP.NET and ASP.NET Core.
ASP.NET samples are under the samples/aspnet directory.
ASP.NET Core samples are under the samples/aspnetcore directory.
Samples for ASP.NET Core
License: Other
Samples for ASP.NET and ASP.NET Core.
ASP.NET samples are under the samples/aspnet directory.
ASP.NET Core samples are under the samples/aspnetcore directory.
On March 11, we're going to rename the default branch in this repository to main. For more details, see our earlier announcement.
please, if possible, integrate with "Secure an ASP.NET Core Blazor WebAssembly hosted app with Identity Server" and roles
Trying to convert this app from client-side to server-side. I believe I have everything changed over
Solution code builds fine, but when browser loads, I just get a blank screen with no errors in the dev console.
Might be related to the issue mentioned here, but not sure
https://blog.jonblankenship.com/2018/11/02/experiences-converting-from-client-side-to-server-side-blazor/
What can I check?
I have several .net core sdk's installed
.NET Core SDKs installed:
1.0.4 [C:\Program Files\dotnet\sdk]
1.1.0 [C:\Program Files\dotnet\sdk]
2.0.2 [C:\Program Files\dotnet\sdk]
2.1.2 [C:\Program Files\dotnet\sdk]
2.1.4 [C:\Program Files\dotnet\sdk]
2.1.103 [C:\Program Files\dotnet\sdk]
2.1.201 [C:\Program Files\dotnet\sdk]
2.1.202 [C:\Program Files\dotnet\sdk]
2.1.300 [C:\Program Files\dotnet\sdk]
2.1.403 [C:\Program Files\dotnet\sdk]
2.1.500 [C:\Program Files\dotnet\sdk]
2.2.100 [C:\Program Files\dotnet\sdk]
when i run your sample on docker , the page fails to load with security warning.
Secure Connection Failed
An error occurred during a connection to parveen.local:7081. PR_END_OF_FILE_ERROR
The page you are trying to view cannot be shown because the authenticity of the received data could not be verified.
Please contact the website owners to inform them of this problem.
Learn moreβ¦
Any tip will be appreciated.
This sample will probably be ported to Razor Components in the near future. You should change service lifetime to scoped
. Otherwise state will be shared between all users which is not what you want.
Hi there
I was checking the code sample FileUpload and just realized that the ActionResult instance type is FileResult that currently is abstract.
FileResult: https://docs.microsoft.com/en-us/dotnet/api/system.web.mvc.fileresult?view=aspnet-mvc-5.2
This needs to be updated to one of the inherit types i guess:
System.Web.Mvc.FileContentResult
System.Web.Mvc.FilePathResult
System.Web.Mvc.FileStreamResult
Would be nice to have
------ Rebuild All started: Project: FlightFinder.Client, Configuration: Debug Any CPU ------
microsoft.aspnetcore.blazor.build\0.6.0\targets\RazorCompilation.targets(184,5): error : rzc generate exited with code 1.
On VS2019
is avaiable any demo page ?
These samples only seem to cover Angular and React scenarios. We have Typescript with just jQuery apps. Using/rendering Blazor components with just jQuery is not demonstrated and is not obvious. I've tried and cannot get it to work.
Is it a standalone client-side app or full-stack ASP.NET Core app?
If trying to learn/build a specific one of the above, I have no idea (at all never having seen blazor) if what I'm seeing is something to learn from for my use case, or if it will mislead and confuse me because it is the wrong type of blazor sample. If it has both, that further muddies learning.
Severity Code Description Project File Line Suppression State
Error CS0246 The type or namespace name 'Main' could not be found (are you missing a using directive or an assembly reference?) FlightFinder.Client C:\Code\samples\samples\aspnetcore\blazor\FlightFinder\FlightFinder.Client\Startup.cs 16 Active
Error NETSDK1045 The current .NET SDK does not support targeting .NET Core 3.0. Either target .NET Core 2.1 or lower, or use a version of the .NET SDK that supports .NET Core 3.0. FlightFinder.Server C:\Program Files\dotnet\sdk\2.1.508\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets 137
The class Main is missing.
I am trying to get the renderviewtostring sample working in DotNet Core 3.1 in a console application i.e. running Razor standalone.
The first statement in Main gives
'HostBuilder' does not contain a definition for 'ConfigureWebHost' ...
What is the correct setup for this sample in DotNet Core 3.1 ?
Thanks
The Web Socket sample is very contrived. using statements which shorten long delegates which use tuples and everything works in a weird async task of an echo server....
I've been trying to figure out how to write a simple web socket server to send events (ie - not respond to messages but send events from my self hosted owin console app) but this sample is just not good.
Please could you guys write a better one? Maybe properly structured which use properly named classes and methods (please no usings shortcuts or tuples) and maybe give some more info on how to do things like respond to a websocket message (in this current sample) but also how to do broadcasts and such... π
Oh and please don't tell me to use SignalR - I know I can but I just want websockets and signalr does not do "just websockets" well...
In the aspnet\WebApi\BasicAuthentication
project the web.config file references a local DB
aspnet-BasicAuthentication-20131121044235.mdf
It's not in the App_Data
folder, or anywhere I've been able to find. I didn't notice any documentation for manually creating it.
Can someone tell me where it is, or where the schema is so I can create it?
@SteveSandersonMS I started refactoring the Scss files in the FlightFinder project.
Currently the FlightFinder app can be themed by changing a single variable. Also, I've switched to Bootstrap 4 Scss. The variables are now mapped to Bootstrap as well, so one change updates all UI components being used in FlightFInder including Bootstrap.
The blazor Flight Finder demo is a solution with three projects, FlightFinder.Server, FlightFinder.Client and FlightFinder.Shared. In visual studio 2019 I can run it without problems. However, when I deploy it to an IIS, it deploys without error, but when called stays in the "Loading..." screen forever.
I can't figure out, how to deploy this correctly. Should I just deploy the server-project? Seems not to work. Should I deploy both projects, client and server, to separate paths? Then where do I inform the client about the server location?
Please include deployment instructions.
I am looking at the JS component generation example at:
https://github.com/aspnet/samples/tree/main/samples/aspnetcore/blazor/JSComponentGeneration
and would like to run the tasks for an external DLL that contains blazor components.
BlazorAppGeneratingJSComponents
project and re-generating the Counter
component will also be helpful. Still, my main scenario is to run the generator over a custom set of UI components and see which of them are "generatable" and potentially update the generator when necessary.@SteveSandersonMS
2. Looking at the custom elements sample Can you add some details if the following statement for child content:
https://github.com/dotnet/AspNetCore.Docs/blob/5417884bf9f97ce9724092a7e2836ccff2662a82/aspnetcore/blazor/components/prerendering-and-integration.md#dynamically-add-root-components
[!NOTE] Rendering child content of a dynamically-rendered component isn't supported.
is a current limitation and whether it can be supported in the future? The official docs does not have this section, but most of the components in my 3rd party library have child components in their definition, so as far as I understand it, they cannot be used in custom elements/angular/react/etc scenarios, e.g:
<BlazorComponent>
<ChildComponent1></ChildComponent1>
</BlazorComponent
cd samples/aspnetcore/blazor/JSComponentGeneration/JSComponentGeneration.Build
dotnet build
cd ../BlazorAppGeneratingJSComponents
dotnet watch
From another prompt:
cd samples/aspnetcore/blazor/JSComponentGeneration/react-app-with-blazor
export NODE_OPTIONS=--openssl-legacy-provider
npm run start
Browse to http://localhost:3000 and click button Add Blazor counter
.
The browser displays: Unhandled Rejection (Error): Dynamic root components have not been enabled in this application.
.
The offending code seems to be in react-app-with-blazor/src/blazor-react.js on line 32:
return Blazor.rootComponents.add(parentElement, `${identifier}-react`, props);
It would be nice to see a working 0.4.0 sample so that I can have a good reference
Can you please enhance the Blazor example to demonstrate how we can deploy the Display attribute?
Can we add a Display attribute to a model.
Then show us how the form label can use this attribute?
TIA
It appears that the Binary Submit sample for Blazor is missing the JavaScript code that would make it work.
When I run it, I get the error :
Error: Microsoft.JSInterop.JSException: Could not find 'getStream' ('getStream' was undefined).
Error: Could not find 'getStream' ('getStream' was undefined).
I went ahead to create my own getStream function but then another JavaScript function, 'readBytes', used in the ChunkedStream.cs class (line 51) is missing as well.
Is there a plan to update the BinarySubmit sample?
We have a concrete sample of this. We just need to do some clean-up on it.
I would like to run the OwinSelfhostSample project as a Windows Service.
I have successfully installed the service using the command sc create MyService binPath=...
.
The service fails to start and Event Viewer shows error event ID 7009 and 7000, "A timeout was reached (30000) milliseconds) while waiting for ..." and "The service did not respond to the start or control...".
Any ideas? Thanks.
Hello everyone!
So I just downloaded the latest release and opened it in VS but I can't build the project. the Error message being the below text repeatedly(like two thousand times):
Project "F:\aspnetcore-8.0.1\artifacts\bin\GenerateFiles\Directory.Build.targets" was not imported by "F:\aspnetcore-8.0.1\Directory.Build.targets" at (176,3), due to the file not existing.
I even tried making the GenerateFiles directory and copying Directory.Build.targets from the root of the project. I know it might look dumb but I really tried, spent the whole night and day on it ^_^
Any help is really appreciated here. 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.