Git Product home page Git Product logo

entropy's Introduction

Entropy

AppVeyor: AppVeyor

Travis: Travis

Entropy is "a measure of the disorder that exists in a system."

This repo is a chaotic experimental playground for new features and ideas. Check here for small and simple samples for individual features.

This project is part of ASP.NET Core. You can find samples, documentation and getting started instructions for ASP.NET Core at the Home repo.

entropy's People

Contributors

ajaybhargavb avatar ajcvickers avatar analogrelay avatar anpete avatar brennanconroy avatar bricelam avatar chengtian avatar davidfowl avatar dougbu avatar eilon avatar halter73 avatar haok avatar hishamco avatar javiercn avatar jbagga avatar juntaoluo avatar kichalla avatar kirthik avatar lodejard avatar loudej avatar mikeharder avatar natemcmaster avatar ntaylormullen avatar pakrym avatar pranavkm avatar ryanbrandenburg avatar rynowak avatar sonjakhan avatar tratcher avatar troydai 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

entropy's Issues

CompileModule sample is not supported in dotnet

Dnx used to support CompileModule but after moving to dotnet I believe it is going away or at least it's not currently clear what the plan will be. This affects the Project.CompileModule sample so once we find out whether the support will be available we need to update or remove this sample.

cc @muratg @davidfowl

Create config particles

Startup class that demonstrates:

  • Add configuration sources to a configuration
  • Pass configuration to settings factory method
  • Navigating configuration based on key prefix from user code
  • Notification of configuration source changes, flows to settings objects
  • Implementing a custom source in an application

[Dependency Fail Information] Unhandled Exception: System.ArgumentNullException: Value cannot be null. Parameter name: assemblyName

Hello aspnet,

When we run the project present in the following folder : "Entropy/samples/Mvc.RenderViewToString/"
We cannot avoid the exception that we see here:
image
This is the result of dotnet core failing to instantiate the needed dependencies for the RazorViewToStringRenderer.
Since we took this code as an example to build our own Razor view renderer, we experienced the same exception when upgrading to dotnet core.
Do you manage to make this Mvc.RenderViewToString project run properly ?

Thank you for your returns.

Clean up compilation warnings

Entropy builds for .NET Core App emit warnings such as

CSC : warning CS1701: Assuming assembly reference 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' used by 'System.Resources.ResourceManager' matches identity 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' of 'System.Runtime', you may need to supply runtime policy [C:\dd\dnx\Universe\Entropy\samples\Localization.CustomResourceManager\Localization.CustomResourceManager.csproj]
obj\Debug\netcoreapp1.1\zh\Localization.CustomResourceManager.resources.cs(15,12): warning CS1701: Assuming assembly reference 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' used by 'System.Resources.ResourceManager' matches identity 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' of 'System.Runtime', you may need to supply runtime policy [C:\dd\dnx\Universe\Entropy\samples\Localization.CustomResourceManager\Localization.CustomResourceManager.csproj]

Clean these up once that is possible. dotnet/sdk#954 currently blocks fixing this issue.

Can't run Localization.StarterWeb on *nix

Localization.StartrWeb.csproj

 <PropertyGroup>
    <IsPackable>false</IsPackable>
    <TargetFrameworks>net451;netcoreapp1.1</TargetFrameworks>
    <UserSecretsId>aspnet5-Localization.StarterWeb-4772c50f-56f3-4058-bd61-75f1352aeca7</UserSecretsId>
  </PropertyGroup>

Got the following error:

/sdk/1.0.0-rc3-004530/Sdks/Microsoft.NET.Sdk/build/Microsoft.NET.RuntimeIdentifierInference.targets(49,5): error : RuntimeIden
tifier must be set for .NETFramework executables. Consider RuntimeIdentifier=win7-x86 or RuntimeIdentifier=win7-x64. [/Entrop
y/samples/Localization.StarterWeb/Localization.StarterWeb.csproj]
The build failed. Please fix the build errors and run again.

When I add the RuntimeIdentifier in the .csproj file:

  <PropertyGroup>
    <IsPackable>false</IsPackable>
    <TargetFrameworks>net451;netcoreapp1.1</TargetFrameworks>
    <RuntimeIdentifier>win7-x64</RuntimeIdentifier>
    <UserSecretsId>aspnet5-Localization.StarterWeb-4772c50f-56f3-4058-bd61-75f1352aeca7</UserSecretsId>
  </PropertyGroup>

I got this error:

/sdk/1.0.0-rc3-004530/Microsoft.Common.CurrentVersion.targets(1110,5): error MSB3644: The reference assemblies for framework "
.NETFramework,Version=v4.5.1" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your applicat
ion to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assem
bly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend
. [/Entropy/samples/Localization.StarterWeb/Localization.StarterWeb.csproj]
/sdk/1.0.0-rc3-004530/Sdks/Microsoft.NET.Sdk/build/Microsoft.NET.Sdk.targets(76,5): error : Assets file '/Entropy/samples/Localization.StarterWeb/obj/project.assets.json' doesn't have a target for '.NETFramework,Version=v4.5.1/win7-x64'. Ensure you ha
ve restored this project for TargetFramework='net451' and RuntimeIdentifier='win7-x64'. [/Entropy/samples/Localization.Starte
rWeb/Localization.StarterWeb.csproj]
The build failed. Please fix the build errors and run again.

When I remove the .Net451 target framework

  <PropertyGroup>
    <IsPackable>false</IsPackable>
    <TargetFrameworks>netcoreapp1.1</TargetFrameworks>
    <UserSecretsId>aspnet5-Localization.StarterWeb-4772c50f-56f3-4058-bd61-75f1352aeca7</UserSecretsId>
  </PropertyGroup>

I got this error:

Unable to run your project.
Please ensure you have a runnable project type and ensure 'dotnet run' supports this project.
The current OutputType is 'Exe'.

Cover simpler localization approach for custom validation attributes in MVC localization sample

The Mvc Localization Sample demonstrates creating a custom validation attribute adapter i.e. an IValidationAttributeAdapterProvider and the IAttributeAdapter implementation it returns. As mentioned in aspnet/Mvc#5402, it's usually easier to override IsValid(object, ValidationContext) and to implement IClientModelValidator in the custom ValidationAttribute itself.

Extend the sample to demonstrate this simpler approach as well.

Create IoC particles

Startup class that demonstrates:

  • user provided container populated with third party and framework services, which implies chaining host container.
  • fallback container providing framework services (default scenario with no customer IoC), implies chaining host container
  • override individual framework services
  • IoC interaction with configuration, e.g. framework is given IConfiguration when producing default service descriptors
  • request scoped service, e.g. DbContext

Model problem in RenderViewToString<TModel>(string name, TModel model) method

You can't pass a model (e.g.: List<>()) to the RenderViewToString<TModel>(string name, TModel model) method. When you do it, an exception is thrown:

fail: Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware[0]
      An unhandled exception has occurred while executing the request
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
   at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
   at System.Collections.Generic.List`1.get_Item(Int32 index)
   at Microsoft.AspNetCore.Mvc.Routing.UrlHelper.GetVirtualPathData(String routeName, RouteValueDictionary values)
   at Microsoft.AspNetCore.Mvc.Routing.UrlHelper.Action(UrlActionContext actionContext)
   at Microsoft.AspNetCore.Mvc.ViewFeatures.DefaultHtmlGenerator.GenerateActionLink(ViewContext viewContext, String linkText, String actionName, String controllerName, String protocol, String hostname, String fragment, Object routeValues, Object htmlAttributes)
   at Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper.Process(TagHelperContext context, TagHelperOutput output)
   at Microsoft.AspNetCore.Razor.TagHelpers.TagHelper.ProcessAsync(TagHelperContext context, TagHelperOutput output)
   at Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperRunner.<RunAsync>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at AspNetCore._Views__AssignType_Index_cshtml.<ExecuteAsync>d__29.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Mvc.Razor.RazorView.<RenderPageAsync>d__14.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Mvc.Razor.RazorView.<RenderAsync>d__13.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at FairOrg.Tools.ViewRenderService.<RenderToStringAsync>d__6.MoveNext() in C:\code\...\ViewRenderService.cs:line 103

RenderViewToString : viewLocationBasePath is irrevelant

First thanks for sharing.

The following code is useless / does not work as expected.

WebRootFileProvider = new PhysicalFileProvider(viewLocationBasePath ?? applicationEnvironment.ApplicationBasePath)

The web root is used when looking for static files, aka the wwwroot folder (as described in the source code comments).
It is not used for razor views lookup.
Thus, setting the parameter does not work if the views directory is outside the project directory, which what I try to achieve.

Mvc.CustomRoutingConvention is broken

Upon startup:

System.TypeLoadException: Method 'get_Configuration' in type 'Microsoft.AspNet.H
osting.HostingEnvironment' from assembly 'Microsoft.AspNet.Hosting, Version=1.0.
0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' does not have an implemen
tation.
   at Microsoft.AspNet.Hosting.WebHostBuilder..ctor(IConfiguration config, Boole
an captureStartupErrors)
   at Microsoft.AspNet.Hosting.WebApplication.Run(Type startupType, String[] arg
s)
   at Microsoft.AspNet.Hosting.Program.Main(String[] args)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.Dnx.Runtime.Common.EntryPointExecutor.Execute(Assembly assembly,
 String[] args, IServiceProvider serviceProvider)
   at Microsoft.Dnx.ApplicationHost.Program.<>c__DisplayClass3_0.<ExecuteMain>b_
_0()
   at System.Threading.Tasks.Task`1.InnerInvoke()
   at System.Threading.Tasks.Task.Execute()

Problem with Mvc.RenderViewToString and Url.Action

Using the code from the samples, if I try to use an anchor tag helper on my razor view I get:

An unhandled exception occurred while processing the request.

ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
ThrowArgumentOutOfRangeException

Same if I try to use Url.Action

any idea how to overcome this limitation? thanks.

File Logger Provider

@Eilon Can I make a PR for FileLoggerProvider as a show case of the extensible points of the logging system in ASP.NET Core?

Antiforgery.Angular1 example not applicable to the Real World

The example in Antiforgery.Angular1 places the functionality of the '/api/items' route directly into the startup and removes the separation of concerns between middleware and controller. This is not a real world example.

In MVC using an Antiforgery token is simple, each page/controller action would drop down a token in the form and it is all good. In WebApi, in context of Angular, however, the example should demonstrate setting up the cookie and header as it is outlined in the $http Documentation so that angular can handle is properly and WebApi endpoints can continue to use the built in facilities for validating a token. With WebApi there will also be a need to illustrate how to place the XSRF token into a cookie so that Angular will properly pick it up.

  • [Should outline how to set the XSRF Header]
  • [Should outline how to set the XSRF Cookie]
  • [How to write the XSRF into the requests through a Middleware solution]

Release branch doesn't compile

Just getting the repo from git, with no change done, the solution doesn't build.

The project Mvc.CustomRoutingConvention gives the following 10 errors: (all project references are downloaded)

25>C:\Users\user\Documents\GitHub\Entropy\samples\Mvc.CustomRoutingConvention\NameSpaceRoutingConvention.cs(1,28): ASP.NET 5.0 error CS0234: The type or namespace name 'ApplicationModels' does not exist in the namespace 'Microsoft.AspNet.Mvc' (are you missing an assembly reference?)
25>C:\Users\user\Documents\GitHub\Entropy\samples\Mvc.CustomRoutingConvention\NameSpaceRoutingConvention.cs(5,49): ASP.NET 5.0 error CS0246: The type or namespace name 'IApplicationModelConvention' could not be found (are you missing a using directive or an assembly reference?)
25>C:\Users\user\Documents\GitHub\Entropy\samples\Mvc.CustomRoutingConvention\NameSpaceRoutingConvention.cs(7,27): ASP.NET 5.0 error CS0246: The type or namespace name 'ApplicationModel' could not be found (are you missing a using directive or an assembly reference?)
25>C:\Users\user\Documents\GitHub\Entropy\samples\Mvc.CustomRoutingConvention\Startup.cs(18,61): ASP.NET 5.0 error CS1503: Argument 1: cannot convert from 'NamespaceRouting.NameSpaceRoutingConvention' to 'Microsoft.AspNet.Mvc.ApplicationModel.IGlobalModelConvention'
25>C:\Users\user\Documents\GitHub\Entropy\samples\Mvc.CustomRoutingConvention\NameSpaceRoutingConvention.cs(14,51): ASP.NET 5.0 error CS0246: The type or namespace name 'AttributeRouteModel' could not be found (are you missing a using directive or an assembly reference?)
25>C:\Users\user\Documents\GitHub\Entropy\samples\Mvc.CustomRoutingConvention\NameSpaceRoutingConvention.cs(1,28): ASP.NET Core 5.0 error CS0234: The type or namespace name 'ApplicationModels' does not exist in the namespace 'Microsoft.AspNet.Mvc' (are you missing an assembly reference?)
25>C:\Users\user\Documents\GitHub\Entropy\samples\Mvc.CustomRoutingConvention\NameSpaceRoutingConvention.cs(5,49): ASP.NET Core 5.0 error CS0246: The type or namespace name 'IApplicationModelConvention' could not be found (are you missing a using directive or an assembly reference?)
25>C:\Users\user\Documents\GitHub\Entropy\samples\Mvc.CustomRoutingConvention\NameSpaceRoutingConvention.cs(7,27): ASP.NET Core 5.0 error CS0246: The type or namespace name 'ApplicationModel' could not be found (are you missing a using directive or an assembly reference?)
25>C:\Users\user\Documents\GitHub\Entropy\samples\Mvc.CustomRoutingConvention\Startup.cs(18,61): ASP.NET Core 5.0 error CS1503: Argument 1: cannot convert from 'NamespaceRouting.NameSpaceRoutingConvention' to 'Microsoft.AspNet.Mvc.ApplicationModel.IGlobalModelConvention'
25>C:\Users\user\Documents\GitHub\Entropy\samples\Mvc.CustomRoutingConvention\NameSpaceRoutingConvention.cs(14,51): ASP.NET Core 5.0 error CS0246: The type or namespace name 'AttributeRouteModel' could not be found (are you missing a using directive or an assembly reference?)

I just checked, and the dll that gets downloaded from myget (Microsoft.AspNet.Mvc.Core\6.0.0-beta1-11874) doesn't contain any definition of the ApplicationModels namespace.

Also references in one of the projects fail to load:]
image

and the error list says:

Microsoft.Framework.Runtime.Roslyn.RoslynCompilationException: error CS0656: Missing compiler required member 'System.Collections.Generic.EqualityComparer`1.Equals'
error CS0656: Missing compiler required member 'System.Collections.Generic.EqualityComparer`1.GetHashCode'
error CS0656: Missing compiler required member 'System.Collections.Generic.EqualityComparer`1.get_Default'
   at Microsoft.Framework.Runtime.Roslyn.RoslynProjectReference.Load(IAssemblyLoadContext loadContext)
   at Microsoft.Framework.DesignTimeHost.ApplicationContext.Initialize(String appPath, String configuration, Boolean triggerBuildOutputs)
   at Microsoft.Framework.DesignTimeHost.ApplicationContext.Calculate()
   at Microsoft.Framework.DesignTimeHost.ApplicationContext.DoProcessLoop()
   at Microsoft.Framework.DesignTimeHost.ApplicationContext.ProcessLoop(Object state)   

The same project also gives the following errors... those kind of make sense as the projectreference project doesn't have config for the CoreCLR

Show Details    Severity    Code    Description Project File    Line
    Error   CS0234  The type or namespace name 'ApplicationModels' does not exist in the namespace 'Microsoft.AspNet.Mvc' (are you missing an assembly reference?)  Mvc.CustomRoutingConvention.ASP.NET 5.0 NameSpaceRoutingConvention.cs   1
    Error   CS0234  The type or namespace name 'ProjectReference' does not exist in the namespace 'Project' (are you missing an assembly reference?)    Project.Dependencies.ASP.NET Core 5.0   Program.cs  7
    Error   CS0234  The type or namespace name 'ProjectReference' does not exist in the namespace 'Project' (are you missing an assembly reference?)    Project.Dependencies.ASP.NET Core 5.0   Program.cs  7
    Error   CS0234  The type or namespace name 'ProjectReference' does not exist in the namespace 'Project' (are you missing an assembly reference?)    Project.Dependencies.ASP.NET Core 5.0   Program.cs  7
    Error   CS0518  Predefined type 'System.String' is not defined or imported  Project.Dependencies.ASP.NET Core 5.0   Program.cs  17
    Error   CS1061  'string' does not contain a definition for 'ToLower2' and no extension method 'ToLower2' accepting a first argument of type 'string' could be found (are you missing a using directive or an assembly reference?)   Project.Dependencies.ASP.NET Core 5.0   Program.cs  17

Fix and restore commented out tests

There are a couple of tests which have had their InlineData's commented out. Restore those and resolve any failures. At worst if we can't resolve the underlying issue at this time we can skip, which has the benefit of being easier to tell that something isn't being tested.

Add functional test for each sample

Although we build each sample, they may not run. This happens very often due to breaking changes and we don't discover this until the samples are tested manually. For example, I have fixed Config.CustomProviders.Web twice in 7e8cedf and 4b56220.

Currently our functional tests do not cover all the samples but we should at least have functional tests that launch each sample so regressions are caught more frequently.

Clean up functional tests

The functional tests are a bit warty and have lots of repetitive code and functions with lots of arguments. Simplify and de-duplicate the tests and their underlying code. The Mvc functional tests would likely make a good guide.

Nginx tests failing on travis ci ubuntu

I see failures with the errors:

Failed   EntropyTests.Diagnostics.DiagnosticsStatusCodesMvcTestsForNonExistingPage.NgnixX64NonWindows
Error Message:
 System.Exception : Failed to start Nginx
Stack Trace:
   at Microsoft.AspNetCore.Server.IntegrationTesting.NginxDeployer.SetupNginx(String redirectUri, Uri originalUri)
   at Microsoft.AspNetCore.Server.IntegrationTesting.NginxDeployer.Deploy()
   at EntropyTests.TestServices.<RunSiteTest>d__4.MoveNext() in /home/travis/build/aspnet/Entropy/test/FunctionalTests/TestServices.cs:line 76
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)Standard Output Messages:
 | Information [Diagnostics.StatusCodes.Mvc:Nginx:CoreClr:x64]: Executing command dotnet publish  --output "/tmp/67f9f5e2-3f92-4af4-9974-e7133ca74e35" --framework netcoreapp1.1 --configuration Debug 
 | Information [Diagnostics.StatusCodes.Mvc:Nginx:CoreClr:x64]: Removing environment variable ASPNETCORE_ENVIRONMENT
 | Information [Diagnostics.StatusCodes.Mvc:Kestrel:CoreClr:x64]: Host process shutting down.
 | Information [Diagnostics.StatusCodes.Mvc:Nginx:CoreClr:x64]: Microsoft (R) Build Engine version 15.2.47.30403
 | Information [Diagnostics.StatusCodes.Mvc:Nginx:CoreClr:x64]: Copyright (C) Microsoft Corporation. All rights reserved.
 | Information [Diagnostics.StatusCodes.Mvc:Nginx:CoreClr:x64]: 
 | Information [Diagnostics.StatusCodes.Mvc:Nginx:CoreClr:x64]:   Diagnostics.StatusCodes.Mvc -> /home/travis/build/aspnet/Entropy/samples/Diagnostics.StatusCodes.Mvc/bin/Debug/netcoreapp1.1/Diagnostics.StatusCodes.Mvc.dll
 | Warning [Diagnostics.StatusCodes.Mvc:Nginx:CoreClr:x64]: 
 | Information [Diagnostics.StatusCodes.Mvc:Nginx:CoreClr:x64]: 
 | Information [Diagnostics.StatusCodes.Mvc:Nginx:CoreClr:x64]: dotnet publish finished with exit code : 0
 | Information [Diagnostics.StatusCodes.Mvc:Nginx:CoreClr:x64]: Executing dotnet /tmp/67f9f5e2-3f92-4af4-9974-e7133ca74e35/Diagnostics.StatusCodes.Mvc.dll --server.urls http://localhost:36483/  --server Microsoft.AspNetCore.Server.Kestrel
 | Information [Diagnostics.StatusCodes.Mvc:Nginx:CoreClr:x64]: Removing environment variable ASPNETCORE_ENVIRONMENT
 | Information [Diagnostics.StatusCodes.Mvc:Nginx:CoreClr:x64]: SET ASPNETCORE_DETAILEDERRORS=true
 | Information [Diagnostics.StatusCodes.Mvc:Nginx:CoreClr:x64]: Started dotnet. Process Id : 16023
 | Warning [Diagnostics.StatusCodes.Mvc:Nginx:CoreClr:x64]: nginx: nginx: [emerg] invalid number of arguments in "user" directive in /tmp/tmpILYc5H.tmp:2
 | Information [Diagnostics.StatusCodes.Mvc:Nginx:CoreClr:x64]: Attempting to cancel process 16023
 | Information [Diagnostics.StatusCodes.Mvc:Nginx:CoreClr:x64]: 
 | Error [Diagnostics.StatusCodes.Mvc:Nginx:CoreClr:x64]: 
 | Warning [Diagnostics.StatusCodes.Mvc:Nginx:CoreClr:x64]: Unable to terminate the host process with process Id '16023
 | Information [Diagnostics.StatusCodes.Mvc:Nginx:CoreClr:x64]: Host process shutting down.
 | Information [Diagnostics.StatusCodes.Mvc:Nginx:CoreClr:x64]: [Time]: Total time taken for this test variation '0' seconds

https://travis-ci.org/aspnet/Entropy/jobs/215642938#L3988-L4024

Fix or remove WebListener test variants

Some of the functional tests have a variant that claims to test WebListener. However, none of the sample apps are set up to dynamically toggle between servers in Main. They still use an old mechanic where you used to be able to toggle via a simple config string. This hasn't worked for almost a year, you have to explicitly call UseKestrel or UseHttpSys. (see MusicStore).

See the outdated comment in most of the Startup.Main methods: "We set the server by name before default args so that command line arguments can override it. This is used to allow deployers to choose the server for testing."

WebListener isn't a meaningful variation for most of these test scenarios, we may be able to just remove those variants (and the comment).
https://github.com/aspnet/Entropy/search?p=1&q=weblistener&utf8=%E2%9C%93

Create routing particle

Startup class that demonstrates:

  • Adding route middleware with simple route handler
  • Adding n-deep route handling topology
  • Shows soft 404 aka backtracking aka continuing execution
  • Sharing route handler for multiple routes
  • Path creation for route values
  • Observe route processing (Glimpse)

Localization.StarterWeb test failures

Still investigating but just going to list what I have found so far.

The failure I'm seeing on the CI is at http://aspnetci/viewLog.html?buildId=100911&buildTypeId=Lite_UniverseTest&tab=buildLog#_focus=64532 which is caused by:

info: Localization.StarterWeb:Kestrel:Clr:x64[0]
      System.InvalidOperationException: Can not find assembly file Microsoft.DotNet.Cli.Utils.dll at 'C:\Users\johluo\AppData\Local\Temp\058a9647-0c7a-4181-82f3-158ee5541928\refs,C:\Users\johluo\AppData\Local\Temp\058a9647-0c7a-4181-82f3-158ee5541928\'
info: Localization.StarterWeb:Kestrel:Clr:x64[0]
         at Microsoft.Extensions.DependencyModel.Resolution.AppBaseCompilationAssemblyResolver.TryResolveAssemblyPaths(CompilationLibrary library, List`1 assemblies)
info: Localization.StarterWeb:Kestrel:Clr:x64[0]
         at Microsoft.Extensions.DependencyModel.Resolution.CompositeCompilationAssemblyResolver.TryResolveAssemblyPaths(CompilationLibrary library, List`1 assemblies)
info: Localization.StarterWeb:Kestrel:Clr:x64[0]
         at Microsoft.Extensions.DependencyModel.CompilationLibrary.ResolveReferencePaths()
info: Localization.StarterWeb:Kestrel:Clr:x64[0]
         at Microsoft.AspNetCore.Mvc.Razor.Compilation.MetadataReferenceFeatureProvider.PopulateFeature(IEnumerable`1 parts, MetadataReferenceFeature feature)
info: Localization.StarterWeb:Kestrel:Clr:x64[0]
         at Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartManager.PopulateFeature[TFeature](TFeature feature)

This seems to have started after the changes in aspnet/Mvc#4498. The reason this error occurs is that for the net451 TFM, while the assembly Microsoft.DotNet.Cli.Utils.dll appears in the build output of the project, it does not show up in the published output. What I'm curious about is why this dotnet cli assembly is being loaded even in full framework and whether this is a publish issue or an issue with how Razor is loading the assemblies.

cc @CesarBS @pranavkm

Localization of data annotation attributes in Localization.StarterWeb

I am looking for an example showing how to localize data annotation attributes. I feel like this should belong in the Localization.StarterWeb sample, but unfortunately it is not implemented. Here you can see English field names and validation messages when the French language is selected:

image

There are mostly 4 things that I would like to see:

  1. Localization of messages of ValidationAttributes (e.g. [Required], "The {0} field is required.")
  2. Localization of display names ([Display(Name = "Email Address")])
  3. Localization of built-in validation messages ("The field {0} must be a number.")
  4. Display of numbers and dates in a format matching the current culture, and properly taking that format into account in the built-in front-end validation (jquery.validate)

Ideally, in a way that is compatible with implementing a custom IStringLocalizer to retrieve the translations...

I would be willing to submit a PR given some pointers.

Any help appreciated.

Unable to build Entropy/samples/Localization.StarterWeb

When I try to build the sample it fails due to the dotnet restore failing.

As far as I can see there are too issues:

  • Microsoft.AspNetCore.Mvc": "1.1.0-*

The .* causes a known exception in VisualStudio, but I don't see anything in the wiki or readme to help people with this issue

The second thing is that its looking for a 1.1.0 version of a package that is at 1.0.1 on nuget:

Again no explanation, please remember that these samples are supposed to be helping people migrate to .NET core so a little guidance would be nice

Create logging particle

Startup class that demonstrates:

  • Configuring a sink
  • Turning on a specific source, create a logger for this class or this component
  • Turn on logging for a specific severity (per source? Inherited by source prefix?)
  • Do above without recompiling the app (no app recycle)
  • Configure third party logging framework
  • How to implement a shim to observe log statements (glimpse)

Owin.OwinWebSockets sample broken

An internal error occurs when running this sample. Using diagnostics I see:

System.Collections.Generic.KeyNotFoundException: websocket.Accept
   at Microsoft.AspNet.Owin.OwinEnvironment.System.Collections.Generic.IDictionary<System.String,System.Object>.get_Item(String key)
   at SelfHostServer.Startup.<>c__DisplayClass0_0.<<Configure>b__2>d.MoveNext() in C:\gh\Entropy\samples\Owin.OwinWebSockets\Startup.cs:line 47
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNet.Owin.WebSocketAcceptAdapter.<>c__DisplayClass6_0.<<AdaptWebSockets>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNet.Diagnostics.DeveloperExceptionPageMiddleware.<Invoke>d__7.MoveNext()

Seems like we need to handle the case when the key doesn't even exist.

Get tests working on Travis / Linux

Entropy builds have been erroring or failing consistently on Travis for a while. Looks like the last successful Travis run was 16 days ago. (Admittedly, that span may include runs where Linux succeeded but OS X failed.)

The current unique issue appears to be a failure while executing dotnet publish. It's likely some of the recent infrastructure changes have either not yet been applied in this repo or been miss-applied.

See failures in https://travis-ci.org/aspnet/Entropy/jobs/111584356 for example.

Problems here may relate to aspnet/KestrelHttpServer#654

Some samples have incorrect dependencies

Errors in C:\work\Universe\Entropy\samples\Localization.StarterWeb\project.json
Package Microsoft.Extensions.Configuration.FileProviderExtensions 1.0.0-rc1-final is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package Microsoft.Extensions.Configuration.FileProviderExten
sions 1.0.0-rc1-final supports
:
- dotnet5.4 (.NETPlatform,Version=v5.4)
- net451 (.NETFramework,Version=v4.5.1)
- netcore50 (.NETCore,Version=v5.0)
One or more packages are incompatible with .NETCoreApp,Version=v1.0.

Errors in C:\work\Universe\Entropy\samples\MusicStore.Spa\project.json
Package AutoMapper 4.0.0-alpha1 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package AutoMapper 4.0.0-alpha1 supports:
- dnx46 (DNX,Version=v4.6)
- dnxcore50 (DNXCore,Version=v5.0)
- monoandroid (MonoAndroid,Version=v0.0)
- monotouch (MonoTouch,Version=v0.0)
- net45 (.NETFramework,Version=v4.5)
- portable-net45+win8+wp8+wpa81 (.NETPortable,Version=v0.0,Profile=Profile259)
- sl5 (Silverlight,Version=v5.0)
- win (Windows,Version=v0.0)
- wp8 (WindowsPhone,Version=v8.0)
- wpa81 (WindowsPhoneApp,Version=v8.1)
- xamarinios10 (Xamarin.iOS,Version=v1.0)
One or more packages are incompatible with .NETCoreApp,Version=v1.0.

Errors in C:\work\Universe\Entropy\samples\Mvc.FileUpload\project.json
Package Newtonsoft.Json 7.0.1 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package Newtonsoft.Json 7.0.1 supports:
- net20 (.NETFramework,Version=v2.0)
- net35 (.NETFramework,Version=v3.5)
- net40 (.NETFramework,Version=v4.0)
- net45 (.NETFramework,Version=v4.5)
- portable-dnxcore50+net45+win8+wp8+wpa81 (.NETPortable,Version=v0.0,Profile=net45+wp80+win8+wpa81+dnxcore50)
- portable-net40+sl5+win8+wp8+wpa81 (.NETPortable,Version=v0.0,Profile=Profile328)
One or more packages are incompatible with .NETCoreApp,Version=v1.0.

Cleanup samples ported over from Mvc

As part of porting over the Entropy samples, we noticed it had a bunch of code and comments based on design disccusions. It'll be nice to clean this up so they make for better samples

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.