text:
Consider adding an analyzer that warns when MvcOptions.EnableEndpointRouting=false but endpoint routing middleware is used

Based on the issue filed here: https://github.com/aspnet/AspNetCore/issues/17138
public void ConfigureServices(IServiceCollection services)
{
    services.AddMvc(config =>
    {
        config.EnableEndpointRouting = false;
        var policy = new AuthorizationPolicyBuilder().RequireAuthenticatedUser().Build();
        config.Filters.Add(new AuthorizeFilter(policy));
        config.Filters.Add(new AutoValidateAntiforgeryTokenAttribute()); //  it validates all of requests, except for GET requests
    }).SetCompatibilityVersion(CompatibilityVersion.Version_3_0);

    services.AddAuthorization(options =>
    {
        options.AddPolicy("Permissions", policy =>
        {
            policy.RequireAssertion(context => PermissionGranted(context));
        });
    });
}

public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IAntiforgery antiforgery)
{
    ...
    app.UseRouting();
    app.UseAuthentication();
    app.UseAuthorization();

    app.UseEndpoints(endpoints =>
    {
        endpoints.MapControllerRoute(
            name: "default",
            pattern: "{controller=Login}/{action=Index}/{id?}");
    });
}

The user's app has EnableEndpointRouting = false, but also configures the endpoint routing middleware. We should consider flagging this as a warning since it's not something we claim to support works correctly.

Let's throw exception in this case going forward.

authors: mkArtakMSFT pranavkm


text:
Update compatibility infrastructure in 3.0

Summary
The new compatibility infrastructure introduced in 2.1 will need to be updated in 3.0 to rationalize our overall philosophy for breaking behavior changes.
The basic idea is: when we introduce a change in existing behavior in a minor release, we make it opt-in to avoid creating barriers for users to update to the latest ASP.NET Core. We make these changes for a good reason, and we believe that the new behavior is compelling enough that we want it to eventually become the default.
This item tracks what's needed to make those new things the default 👍
Checklist of small things

[x] Update MvcCompatiblityOptions.CompatibilityVersion to point to a new enum value (Version_3_0)
[x] Obsolete all of the Version_2_X enum values
[x] Make ConfigureCompatibilityOptions throw when presented with an old value
[ ] Empty-out all implementations of ConfigureCompatibilityOptions.DefaultValues
[ ] Remove all current uses of CompatibilitySwitch including the properties on options types
[x] Update template to use Version_3_0
[ ] Copy the content of this issue and create a new issue for 4.0 😁

Removing old features
Now that you've done all of the above, you should have bunch of code that doesn't compile due to removing properties from options types. Congratulations! We are free of these old behaviors forever. We can delete the code and tests that implement the legacy behaviors.

Part two of three: 708dc5cb5a

Work completed in f113a20dfd

source: gharchive/issue

authors: dougbu rynowak

repo: aspnet/AspNetCore

license: MIT

license_type: permissive

license_source: github-api


text:
Directory.GetCurrentDirectory not correct in test project

I have 2 projects , the one is another's test project
Now I have to read an image from wwwroot/images.
So i call Directory.GetCurrentDirectory first for read the project's directory.
Then i run the integration test( not unit test) project.
and its' Directory.GetCurrentDirectory result is the directory of the test project.
and i write this in the WebApplicationFactory's sub class still useless:
builder                 .UseContentRoot(@"E:\TFSWorkspace\WorkspaceForDotNetDevCoder\DotNetDevCoder\Services\Identity\IdentityService")
or  programs.cs:
WebHost.CreateDefaultBuilder(args)             .UseContentRoot(@"E:\TFSWorkspace\WorkspaceForDotNetDevCoder\DotNetDevCoder\Services\Identity\IdentityService")                 .UseStartup<Startup>();
other info :
asp.net core 2.2 on windows vs 2017
and use this helper class for fix the Directory.GetCurrentDirectory issue which not get the right path from iis express

Temporarily copy the folder and content from wwwroot/images/someimg.png  to the integration test project.But i know it's still the bug its use UseContentRoot and UseWebRoot but useless in the customize WebApplicationFactory which still locale result of Directory.GetCurrentDirectory target to the bin folder of the integration test project.

Thanks for contacting us, @jingliancui.
@javiercn  can you please answer this question? Thanks!

Thanks for reaching out @jingliancui
I'm not sure I understand your issue. Could you provide a repro project showcasing the issue?

ok I will upload sample code later.thanks

WebSample.zip
Today i use vs2019 to repeat the step and found that this issue https://github.com/aspnet/AspNetCore/issues/4206 fixed .
Then focus on the test project/Unitest1.cs and modify the path locale the code project or sln
            _factory = factory.WithWebHostBuilder(builder =>
            {
                //not work
                builder.UseContentRoot(@"D:\TempApps\WebSample\WebSample");

                //not work
                builder.UseSolutionRelativeContentRoot(@"D:\TempApps\WebSample");//.sln path

            }) as CustomWebApplicationFactory<Startup>;

Then Debug Test1(not debug webproject)
Then exception throw.
I can do trick now is to set property of the PrivateResources/cat1.png to "copy if newer" then vs will copy the file with path to the webproject when test run or debug.
other info:
var projectRootDirectory = Directory.GetCurrentDirectory();
in web project 's HomeController.ImageResource action.
So I don't know if is the bug with UseContentRoot and UseSolutionRelativeContentRoot methods

/ping @javiercn

authors: javiercn jingliancui mkArtakMSFT


text:
Avoid allocating the CandidateSet when there's a single match

Add fast path for 0 route values, and policies

####?s

####?s

Will get some. I went awaty but now I'm back

source: gharchive/pull-request

authors: davidfowl rynowak


text:
Output Blazor version info in blazor.js or similar file

I don't think this is super important, but it would be nice to know what version of a Blazor my website is running by inspecting via view source code

Thanks for the suggestion.
Technically it is already possible to determine the version (e.g., by using ILDasm or ILSpy on the Microsoft.AspNetCore.Blazor.dll file delivered to your browser). I appreciate this isn't as convenient but it is an option if you need it.
Since this is a very obscure requirement, I hope you don't mind but I'm going to close it as "probably not, at least for now". We can always reconsider if more people keep asking for it in the future.

authors: SteveSandersonMS humbersoft

repo: aspnet/Blazor


text:
In-process hosting model graphic is not consistent with description

The graphic suggests that the IISHttpServer sits in the middle between the ASP.NET Core Module and the application code. But in the description below it says that the request is handled first by the IISHttpServer, which passes it on to the ASP.NET Core Module and then to the application code as an HttpContext.
It also says that the application code passes the response directly to IIS. Is there no involvement of IISHttpServer or ASP.NET Core Module?

Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: d8f53b58-a048-69ca-2e89-3625bb4cc839
Version Independent ID: 32a343a1-ba87-7274-e861-2ac194d5aa3d
Content: Web server implementations in ASP.NET Core
Content Source: aspnetcore/fundamentals/servers/index.md
Product: aspnet-core
GitHub Login: @guardrex
Microsoft Alias: tdykstra

Hello @TaDe90 ...
It says that after the IIS HTTP Server processes the request, the request is pushed into the ASP.NET Core middleware pipeline, not to ANCM.

It also says that the application code passes the response directly to IIS.

It doesn't say "directly." I'd like to add "back through IIS HTTP Server" to make it clear. I'll put that change in now. Thanks for suggesting it.

repo: aspnet/Docs


text:
Solution for: 'No executable found matching command "dotnet-watch"

While I'm assuming that the sample projects .csproj file contains the correct DotNetCliToolReference, someone reading this might not have it entered in correctly and may be confused by the error they receive when executing 'dotnet watch' at the command line.  Would it make sense to add a note that the following lines are required in the .csproj file?
<ItemGroup>
...
<DotNetCliToolReference Include="Microsoft.DotNet.Watcher.Tools" Version="2.0.2" />
</ItemGroup>

Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: 75e3163f-1903-f2c7-8909-d34f917944bf
Version Independent ID: 55aae418-9d32-5b2b-1df7-5e4e76313ec4
Content: Develop ASP.NET Core apps using a file watcher
Content Source: aspnetcore/tutorials/dotnet-watch.md
Product: asp.net-core
GitHub Login: @Rick-Anderson
Microsoft Alias: riande

I though @scottaddie  updated this for 2.1, but the download is using 2.0
@scottaddie  can comment.
@streetwiseherc  are you using 2.1 .Net Core SDK ?

@streetwiseherc The ASP.NET Core 2.0 version of the doc contains instructions for adding the DotNetCliToolReference element: https://docs.microsoft.com/aspnet/core/tutorials/dotnet-watch?view=aspnetcore-2.0#add-dotnet-watch-to-a-project. That section isn't present in the ASP.NET Core 2.1 version of the doc because you would have .NET Core SDK 2.1 installed. The 2.1 SDK comes bundled with the dotnet-watch tool.

authors: Rick-Anderson scottaddie streetwiseherc


text:
CREATE FILE encountered operating system error CREATE DATABASE failed. Some file names listed could not be created. Check related errors.

Access is denied ??? I hope someone help me

Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: 6719f08e-3bd7-dc1a-71df-f2ef9fbca9d8
Version Independent ID: 7096fdb3-612e-9e00-bd0b-8ea4886a09ce
Content: Add a model to a Razor Pages app in ASP.NET Core
Content Source: aspnetcore/tutorials/razor-pages/model.md
Product: aspnet-core
GitHub Login: @Rick-Anderson
Microsoft Alias: riande

What is the complete error? Try exit/restart VS.

When I update-database Up -> CREATE FILE encountered operating system error 5(Access is denied.) while attempting to open or create the physical file 'C:\Users\UserNameWebApplication1Context-d69ac59a-a7f9-41dc-987c-e83e17c12946.mdf'.
CREATE DATABASE failed. Some file names listed could not be created. Check related errors.
Can you help me resolve it ?

C:\Users\UserNameWebApplication1Context-d69ac59a-a7f9-41dc-987c-e83e17c12946.mdf is not a valid path. I've seen that error before. Can you update Visual Studio? Do that from the Help menu (select check for updates.)

I tried it, but it didn't work... Why access is denied and not a valid path ...

@jetaimefrc  what did set the full path using AttachDbFileName in the connection string to?

Oh ! Worked ! Thank's you. But I think it not generalize for any case. I don't know have other solution ?

@jetaimefrc  what version of Visual Studio are you using?

VS Community 2017 - ver 15.7.3

@jetaimefrc thanks, that's the current version.

Did you try https://support.microsoft.com/en-us/help/4096875/fix-access-is-denied-error-when-you-try-to-create-a-database-in-sql-se

authors: Rick-Anderson ivicacevis jetaimefrc


text:
Add article comparing gRPC with HTTP APIs

Addresses https://github.com/grpc/grpc-dotnet/issues/166
Would like to get some experts in HTTP/REST and gRPC to double check the content, can then work on fixing my awful language.
Internal preview - https://review.docs.microsoft.com/en-us/aspnet/core/grpc/comparison?view=aspnetcore-3.0&branch=pr-en-us-11677

@JamesNK I'll review/update it now.

authors: JamesNK Rick-Anderson


text:
New EF MVC tutorial series

This is an update of existing series for EF 6 MVC 5 at
http://www.asp.net/mvc/overview/getting-started/getting-started-with-ef-using-mvc/creating-an-entity-framework-data-model-for-an-asp-net-mvc-application
/cc @Rick-Anderson @spboyer

@tdykstra can you fix the build issues?

Reopened as #1879

authors: spboyer tdykstra


text:
File uploads doc update

Fixes #2553
... and with the usual updates:

Codeblocks (formatting fixed and in-text code is swapped for sample snippets)
Description + keywords
Code filenames to italics
Title and header casing
Minor grammatical changes
Links converted to xref format
Took en-us out of external links

Let me know how you handle line breaks in code to format the code for doc webpage presentation: Do you want code lines broken for a manual word-wrap where feasible, or you do want to just let them break naturally?

Hi @GuardRex, I'm your friendly neighborhood .NET Foundation Pull Request Bot (You can call me DNFBOT). Thanks for your contribution!
You've already signed the contribution license agreement. Thanks!
The agreement was validated by .NET Foundation and real humans are currently evaluating your PR.
TTYL, DNFBOT;

@GuardRex  thanks

authors: GuardRex Rick-Anderson dnfclas


text:
fix codesnippet in table && bookmark not found

fix codesnippet in table
bookmark not found

@yishengjin1413  this fixes the MarkDig parsing  error - right? Are you OK with the [Warning]NestedColumn have some invalid chars in the starting. ?
If so I can merge.

Yes. This PR used to fix the markdig parsing error.
For the [Warning]NestedColumn have some invalid chars in the starting., please ignore it. The next version of markdig will remove these warnings.


text:
Update using-gulp.rst

Clarified that the Task Runner Explorer was not the only way to kick off gulp tasks when working in ASP.Net 5. When reading the article as was I initially came away with the (false) impression that I couldn't use project.json to kick off Gulp tasks.  I thought this was worth highlighting for others that might be confused.

@madskristensen Please review

@Rick-Anderson Please review as well

Hi @Rick-Anderson,
I've made changes as requested.
One thing I haven't mentioned (and perhaps ought to be somewhere) is that to get project.json stages being triggered on a build in Visual Studio you need to (quotes @davidfowl ):

go into the project properties -> Build tab -> Produce outputs on build.

Is this worth mentioning somewhere?  Details here

@johnnyreilly Yes! It is confusing so please add that. I would add it within a Note.
.. note:: Note goes here.

@Rick-Anderson done!  Hope I got the note syntax correct.

Looks good to me :shipit:

Thank you! a93cfe3512b046fc681e3bbb7885497ff5189995

authors: Rick-Anderson danroth27 johnnyreilly madskristensen


text:
Raw SQL documentation (FromSql method) doesn't mention the assembly and namespace

Where is FromSql? The documentation should mention what assembly, namespace and class contains this method.

As a general approach, we want to cross link to the API documentation when we introduce an extension method (or any other API). We could also consider mentioning the namespaces and assemblies in the conceptual docs, but we want to avoid adding a lot of clutter.

Duplicate of #740

authors: ajcvickers diego-pathmatics divega


text:
Migrations for annotation changes

EF7 allows adding provider-specific traits to various entities - SqlServer has Clustered indices for example.
Does the migrations model differ handle alterations in such provider-specific traits, e.g. if an index becomes Clustered? I have no idea if this kind of change is actually supported in SqlServer, but I definitely have some examples of PostgreSQL-specific traits that can be altered (e.g. a table's tablespace).

If you provide an implementation of MigrationsAnnotationProvider, those annotations will be diffed.
You will run into one issue, however: We don't currently have an AlterTableOperation to capture changed annotations on the entity type level.

That's good news, thanks @bricelam. Do you mean that for anything other than table (e.g. column) I can access the annotations diff? Could you point out how that's done (am not seeing anything like that in MigrationOperation, Annotatable...)

You won't get a diff, but you'll get an alter operation with the new value.

OK, thanks for the clarification. Getting just the new value is insufficient for at least some cases - the old value may be necessary to generate the alteration SQL etc.
Just want to stress this isn't a critical issue or anything (definitely not RTM), just raising this so it's treated at some point.

Retrieving the old value could be enabled by #1911

Closing since I think the the work for this is already tracked by #1911.

FYI, @roji, @AndriySvyryd is going to add AlterDatabase and AlterTable operations that will be generated when annotations on the model and entity types are changed.
I'm going to re-open this issue since it's a new feature that just happens will get implemented as part of #6405.

Note: The old annotations are now also available on AlterColumnOperation.

authors: bricelam roji

repo: aspnet/EntityFramework


text:
Updating Nuget packages yields different results on VS 2015 and 2013

I guess this might be more of a Nuget 3 issue but maybe you can guide me towards them then.
I'm on .NET 4.5.2 and just now moving to use VS 2015. The problem is that upgrading EF 7 nuget packages from the myget feed on VS 2015, it wants to install a lot of System.* beta packages, like System.Collections 4.0.10-beta-22231.
Here's the output from VS 2015 Package Manager Console:
PM> Update-Package EntityFramework.Commands -Project DataAccess.Contexts.SqlServer -Source https://www.myget.org/F/aspnetvnext/ -Version 7.0.0-beta8-15721 -whatif -DependencyVersion Lowest
Attempting to gather dependencies information for multiple packages with respect to project '04 - Data Access\Contexts\DataAccess.Contexts.SqlServer', targeting '.NETFramework,Version=v4.5.2'
Attempting to resolve dependencies for multiple packages
Resolving actions install multiple packages
Uninstall Microsoft.Framework.Caching.Memory 1.0.0-beta8-15567
Uninstall Microsoft.Framework.OptionsModel 1.0.0-beta8-15562
Uninstall Microsoft.Framework.Logging 1.0.0-beta8-15562
Uninstall Microsoft.Framework.Logging.Abstractions 1.0.0-beta8-15562
Uninstall Microsoft.Framework.DependencyInjection 1.0.0-beta8-15562
Uninstall Microsoft.Framework.DependencyInjection.Abstractions 1.0.0-beta8-15562
Uninstall Microsoft.Framework.Configuration.Binder 1.0.0-beta8-15567
Uninstall Microsoft.Framework.Configuration 1.0.0-beta8-15567
Uninstall Microsoft.Framework.Configuration.Abstractions 1.0.0-beta8-15567
Uninstall Microsoft.Framework.Caching.Abstractions 1.0.0-beta8-15567
Uninstall Microsoft.AspNet.Razor 4.0.0-beta8-15589
Install Microsoft.AspNet.Razor 4.0.0-beta8-15611
Install Microsoft.Framework.Caching.Abstractions 1.0.0-beta8-15583
Install Microsoft.Framework.Configuration.Abstractions 1.0.0-beta8-15586
Install Microsoft.Framework.Configuration 1.0.0-beta8-15586
Install Microsoft.Framework.Configuration.Binder 1.0.0-beta8-15586
Install Microsoft.Framework.DependencyInjection.Abstractions 1.0.0-beta8-15574
Install Microsoft.Framework.DependencyInjection 1.0.0-beta8-15574
Install Microsoft.Framework.Logging.Abstractions 1.0.0-beta8-15575
Install Microsoft.Framework.Logging 1.0.0-beta8-15575
Install Microsoft.Framework.OptionsModel 1.0.0-beta8-15574
Install Microsoft.Framework.Caching.Memory 1.0.0-beta8-15583
Install System.Linq 4.0.0
Install System.Resources.ResourceManager 4.0.0
Install System.Runtime 4.0.10-beta-23019
Install System.Collections 4.0.10-beta-22231
Install System.Diagnostics.Debug 4.0.10-beta-22231
Install System.Globalization 4.0.10-beta-22231
Install System.Runtime.Extensions 4.0.10-beta-22231
Install System.Threading.Tasks 4.0.0-beta-23019
Install System.Threading 4.0.10-beta-22605
Install System.Collections.Immutable 1.1.37
Install EntityFramework.Core 7.0.0-beta8-15721
Install EntityFramework.Relational 7.0.0-beta8-15721
Install EntityFramework.SqlServer 7.0.0-beta8-15679
Install System.Reflection.Metadata 1.1.0-alpha-00012
Install Microsoft.CodeAnalysis.Common 1.1.0-beta1-20150907-01
Install Microsoft.CodeAnalysis.CSharp 1.1.0-beta1-20150907-01
Install EntityFramework.Relational.Design 7.0.0-beta8-15721
Install EntityFramework.Commands 7.0.0-beta8-15721
And the VS 2013 one for reference:
PM> Update-Package EntityFramework.Commands -Project DataAccess.Contexts.SqlServer -Source https://www.myget.org/F/aspnetvnext/ -Version 7.0.0-beta8-15721 -Prerelease -whatif
Updating 'EntityFramework.Commands' from version '7.0.0-beta8-15679' to '7.0.0-beta8-15721' in project 'DataAccess.Contexts.SqlServer'.
Remove 'EntityFramework.Commands 7.0.0-beta8-15679' from project DataAccess.Contexts.SqlServer.
Remove 'EntityFramework.Relational.Design 7.0.0-beta8-15679' from project DataAccess.Contexts.SqlServer.
Remove 'Microsoft.AspNet.Razor 4.0.0-beta8-15589' from project DataAccess.Contexts.SqlServer.
Remove 'EntityFramework.Relational 7.0.0-beta8-15679' from project DataAccess.Contexts.SqlServer.
Remove 'EntityFramework.Core 7.0.0-beta8-15679' from project DataAccess.Contexts.SqlServer.
Remove 'Microsoft.Framework.Logging 1.0.0-beta8-15562' from project DataAccess.Contexts.SqlServer.
Remove 'Microsoft.Framework.Logging.Abstractions 1.0.0-beta8-15562' from project DataAccess.Contexts.SqlServer.
Remove 'Microsoft.Framework.DependencyInjection 1.0.0-beta8-15562' from project DataAccess.Contexts.SqlServer.
Remove 'Microsoft.Framework.Caching.Memory 1.0.0-beta8-15567' from project DataAccess.Contexts.SqlServer.
Remove 'Microsoft.Framework.OptionsModel 1.0.0-beta8-15562' from project DataAccess.Contexts.SqlServer.
Remove 'Microsoft.Framework.Configuration.Binder 1.0.0-beta8-15567' from project DataAccess.Contexts.SqlServer.
Remove 'Microsoft.Framework.Configuration 1.0.0-beta8-15567' from project DataAccess.Contexts.SqlServer.
Remove 'Microsoft.Framework.Configuration.Abstractions 1.0.0-beta8-15567' from project DataAccess.Contexts.SqlServer.
Remove 'Microsoft.Framework.DependencyInjection.Abstractions 1.0.0-beta8-15562' from project DataAccess.Contexts.SqlServer.
Remove 'Microsoft.Framework.Caching.Abstractions 1.0.0-beta8-15567' from project DataAccess.Contexts.SqlServer.
Add 'Microsoft.Framework.Caching.Abstractions 1.0.0-beta8-15583' to project DataAccess.Contexts.SqlServer.
Install 'Microsoft.Framework.Caching.Abstractions 1.0.0-beta8-15583'
Add 'Microsoft.Framework.DependencyInjection.Abstractions 1.0.0-beta8-15574' to project DataAccess.Contexts.SqlServer.
Install 'Microsoft.Framework.DependencyInjection.Abstractions 1.0.0-beta8-15574'
Add 'Microsoft.Framework.Configuration.Abstractions 1.0.0-beta8-15586' to project DataAccess.Contexts.SqlServer.
Install 'Microsoft.Framework.Configuration.Abstractions 1.0.0-beta8-15586'
Add 'Microsoft.Framework.Configuration 1.0.0-beta8-15586' to project DataAccess.Contexts.SqlServer.
Install 'Microsoft.Framework.Configuration 1.0.0-beta8-15586'
Add 'Microsoft.Framework.Configuration.Binder 1.0.0-beta8-15586' to project DataAccess.Contexts.SqlServer.
Install 'Microsoft.Framework.Configuration.Binder 1.0.0-beta8-15586'
Add 'Microsoft.Framework.OptionsModel 1.0.0-beta8-15574' to project DataAccess.Contexts.SqlServer.
Install 'Microsoft.Framework.OptionsModel 1.0.0-beta8-15574'
Add 'Microsoft.Framework.Caching.Memory 1.0.0-beta8-15583' to project DataAccess.Contexts.SqlServer.
Install 'Microsoft.Framework.Caching.Memory 1.0.0-beta8-15583'
Add 'Microsoft.Framework.DependencyInjection 1.0.0-beta8-15574' to project DataAccess.Contexts.SqlServer.
Install 'Microsoft.Framework.DependencyInjection 1.0.0-beta8-15574'
Add 'Microsoft.Framework.Logging.Abstractions 1.0.0-beta8-15575' to project DataAccess.Contexts.SqlServer.
Install 'Microsoft.Framework.Logging.Abstractions 1.0.0-beta8-15575'
Add 'Microsoft.Framework.Logging 1.0.0-beta8-15575' to project DataAccess.Contexts.SqlServer.
Install 'Microsoft.Framework.Logging 1.0.0-beta8-15575'
Add 'EntityFramework.Core 7.0.0-beta8-15721' to project DataAccess.Contexts.SqlServer.
Install 'EntityFramework.Core 7.0.0-beta8-15721'
Add 'EntityFramework.Relational 7.0.0-beta8-15721' to project DataAccess.Contexts.SqlServer.
Install 'EntityFramework.Relational 7.0.0-beta8-15721'
Add 'Microsoft.AspNet.Razor 4.0.0-beta8-15611' to project DataAccess.Contexts.SqlServer.
Install 'Microsoft.AspNet.Razor 4.0.0-beta8-15611'
Add 'EntityFramework.Relational.Design 7.0.0-beta8-15721' to project DataAccess.Contexts.SqlServer.
Install 'EntityFramework.Relational.Design 7.0.0-beta8-15721'
Add 'EntityFramework.Commands 7.0.0-beta8-15721' to project DataAccess.Contexts.SqlServer.
Install 'EntityFramework.Commands 7.0.0-beta8-15721'
Uninstall 'EntityFramework.Commands 7.0.0-beta8-15679'.
Uninstall 'EntityFramework.Relational.Design 7.0.0-beta8-15679'.
Uninstall 'Microsoft.AspNet.Razor 4.0.0-beta8-15589'.
Uninstall 'EntityFramework.Relational 7.0.0-beta8-15679'.
Uninstall 'EntityFramework.Core 7.0.0-beta8-15679'.
Uninstall 'Microsoft.Framework.Logging 1.0.0-beta8-15562'.
Uninstall 'Microsoft.Framework.Logging.Abstractions 1.0.0-beta8-15562'.
Uninstall 'Microsoft.Framework.DependencyInjection 1.0.0-beta8-15562'.
Uninstall 'Microsoft.Framework.Caching.Memory 1.0.0-beta8-15567'.
Uninstall 'Microsoft.Framework.OptionsModel 1.0.0-beta8-15562'.
Uninstall 'Microsoft.Framework.Configuration.Binder 1.0.0-beta8-15567'.
Uninstall 'Microsoft.Framework.Configuration 1.0.0-beta8-15567'.
Uninstall 'Microsoft.Framework.Configuration.Abstractions 1.0.0-beta8-15567'.
Uninstall 'Microsoft.Framework.DependencyInjection.Abstractions 1.0.0-beta8-15562'.
Uninstall 'Microsoft.Framework.Caching.Abstractions 1.0.0-beta8-15567'.
Any ideas on what's wrong? For now, I've been using VS 2013 to upgrade the packages.

This seems to be caused by System.Collections.Immutable v. 1.1.37+. I just saw similar behavior with NLog and started looking around and then found this: https://github.com/dotnet/corefx/issues/2984.

Stay on version 1.1.36!

@htuomola yeah this doesn't seem to be anything EF related. Can you open up an issue in the NuGet repo https://github.com/NuGet/Home

authors: ErikEJ htuomola rowanmiller


text:
My Seed Data is not adding to Database

Hi Guys,
I have a problem with the initial data I added to my Migration Configuration Seed.
CrmCoreApplicationHelpers crmHelper = new CrmCoreApplicationHelpers();
var customerList = new List
{
new Customer { .. data here ..  },
};
customerList.ForEach(x => context.Customers.AddOrUpdate(y => y.Firstname, x));
context.SaveChanges();
when I run update-database, there are no errors.
But my Customers table is not updated with data.

Hey,
This site is for EF7, for EF6 please file an issue on http://entityframework.codeplex.com/. There isn't really enough info here for us to reproduce the issue. If you open an issue on CodePlex can you be sure to include a code listing that we can run to reproduce the issue.
~Rowan

authors: AlgebraBurger rowanmiller


text:
Build fixes for SqlServer 2008

@anpete @maumar
Some of the tests which relied on Supporting offset are made ConditionalFact
For, rownumberpaging we did not modify select expression if it was wrapped inside Exists. Causing invalid queries for SqlServer2008.

:shipit:

authors: maumar smitpatel


text:
Microsoft.AspNetCore.All 2.0.6 crashing on azure

This package, when deployed to azure won't start reporting a 502.5... i had to rollback to 2.0.0

The Azure deployment hasn't completed yet. Follow https://github.com/Azure/app-service-announcements/issues/92

authors: Leonardo-Ferreira Tratcher

repo: aspnet/Home


text:
Flaky test: TestValidateAndBuild

This test fails occasionally with the following error:
System.InvalidOperationException : Restore failed with exit code: 1 :: Dotnet path: /mnt/work/33bdfc1cae7b2a38/.dotnet/dotnet
   at Microsoft.VisualStudio.Web.CodeGeneration.MsBuildProjectSetupHelper.RestoreAndBuild(String path, ITestOutputHelper output) in /_/test/Shared/MsBuildProjectSetupHelper.cs:line 114
   at Microsoft.VisualStudio.Web.CodeGenerators.Mvc.IdentityGeneratorTemplateModelBuilderTests.TestValidateAndBuild() in /_/test/VS.Web.CG.Mvc.Test/IdentityGeneratorTemplateModelBuilderTests.cs:line 44
--- End of stack trace from previous location where exception was thrown ---
------- Stdout: -------
Restoring packages for /mnt/temp/buildTmp/tmpfiles/dddbf267-b7c9-4975-a80d-51eb1df52637/Library1/Library1.csproj...
  Restoring packages for /mnt/temp/buildTmp/tmpfiles/dddbf267-b7c9-4975-a80d-51eb1df52637/Root/Test.csproj...
/mnt/work/33bdfc1cae7b2a38/.dotnet/sdk/2.1.302/NuGet.targets(114,5): error : Unable to load the service index for source https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json. [/mnt/temp/buildTmp/tmpfiles/dddbf267-b7c9-4975-a80d-51eb1df52637/Root/Test.csproj]
/mnt/work/33bdfc1cae7b2a38/.dotnet/sdk/2.1.302/NuGet.targets(114,5): error :   Resource temporarily unavailable [/mnt/temp/buildTmp/tmpfiles/dddbf267-b7c9-4975-a80d-51eb1df52637/Root/Test.csproj]
/mnt/work/33bdfc1cae7b2a38/.dotnet/sdk/2.1.302/NuGet.targets(114,5): error : NuGet.Protocol.Core.Types.FatalProtocolException: Unable to load the service index for source https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json. ---> System.Net.Http.HttpRequestException: Resource temporarily unavailable ---> System.Net.Sockets.SocketException: Resource temporarily unavailable [/mnt/temp/buildTmp/tmpfiles/dddbf267-b7c9-4975-a80d-51eb1df52637/Root/Test.csproj]
/mnt/work/33bdfc1cae7b2a38/.dotnet/sdk/2.1.302/NuGet.targets(114,5): error :    at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken) [/mnt/temp/buildTmp/tmpfiles/dddbf267-b7c9-4975-a80d-51eb1df52637/Root/Test.csproj]
/mnt/work/33bdfc1cae7b2a38/.dotnet/sdk/2.1.302/NuGet.targets(114,5): error :    --- End of inner exception stack trace --- [/mnt/temp/buildTmp/tmpfiles/dddbf267-b7c9-4975-a80d-51eb1df52637/Root/Test.csproj]
/mnt/work/33bdfc1cae7b2a38/.dotnet/sdk/2.1.302/NuGet.targets(114,5): error :    at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken) [/mnt/temp/buildTmp/tmpfiles/dddbf267-b7c9-4975-a80d-51eb1df52637/Root/Test.csproj]
/mnt/work/33bdfc1cae7b2a38/.dotnet/sdk/2.1.302/NuGet.targets(114,5): error :    at System.Threading.Tasks.ValueTask`1.get_Result() [/mnt/temp/buildTmp/tmpfiles/dddbf267-b7c9-4975-a80d-51eb1df52637/Root/Test.csproj]
/mnt/work/33bdfc1cae7b2a38/.dotnet/sdk/2.1.302/NuGet.targets(114,5): error :    at System.Net.Http.HttpConnectionPool.CreateConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken) [/mnt/temp/buildTmp/tmpfiles/dddbf267-b7c9-4975-a80d-51eb1df52637/Root/Test.csproj]
/mnt/work/33bdfc1cae7b2a38/.dotnet/sdk/2.1.302/NuGet.targets(114,5): error :    at System.Threading.Tasks.ValueTask`1.get_Result() [/mnt/temp/buildTmp/tmpfiles/dddbf267-b7c9-4975-a80d-51eb1df52637/Root/Test.csproj]
/mnt/work/33bdfc1cae7b2a38/.dotnet/sdk/2.1.302/NuGet.targets(114,5): error :    at System.Net.Http.HttpConnectionPool.WaitForCreatedConnectionAsync(ValueTask`1 creationTask) [/mnt/temp/buildTmp/tmpfiles/dddbf267-b7c9-4975-a80d-51eb1df52637/Root/Test.csproj]
/mnt/work/33bdfc1cae7b2a38/.dotnet/sdk/2.1.302/NuGet.targets(114,5): error :    at System.Threading.Tasks.ValueTask`1.get_Result() [/mnt/temp/buildTmp/tmpfiles/dddbf267-b7c9-4975-a80d-51eb1df52637/Root/Test.csproj]
/mnt/work/33bdfc1cae7b2a38/.dotnet/sdk/2.1.302/NuGet.targets(114,5): error :    at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken) [/mnt/temp/buildTmp/tmpfiles/dddbf267-b7c9-4975-a80d-51eb1df52637/Root/Test.csproj]
/mnt/work/33bdfc1cae7b2a38/.dotnet/sdk/2.1.302/NuGet.targets(114,5): error :    at System.Net.Http.AuthenticationHelper.SendWithAuthAsync(HttpRequestMessage request, Uri authUri, ICredentials credentials, Boolean preAuthenticate, Boolean isProxyAuth, Boolean doRequestAuth, HttpConnectionPool pool, CancellationToken cancellationToken) [/mnt/temp/buildTmp/tmpfiles/dddbf267-b7c9-4975-a80d-51eb1df52637/Root/Test.csproj]
/mnt/work/33bdfc1cae7b2a38/.dotnet/sdk/2.1.302/NuGet.targets(114,5): error :    at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) [/mnt/temp/buildTmp/tmpfiles/dddbf267-b7c9-4975-a80d-51eb1df52637/Root/Test.csproj]
/mnt/work/33bdfc1cae7b2a38/.dotnet/sdk/2.1.302/NuGet.targets(114,5): error :    at System.Net.Http.DecompressionHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) [/mnt/temp/buildTmp/tmpfiles/dddbf267-b7c9-4975-a80d-51eb1df52637/Root/Test.csproj]
/mnt/work/33bdfc1cae7b2a38/.dotnet/sdk/2.1.302/NuGet.targets(114,5): error :    at NuGet.Protocol.ServerWarningLogHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) [/mnt/temp/buildTmp/tmpfiles/dddbf267-b7c9-4975-a80d-51eb1df52637/Root/Test.csproj]
/mnt/work/33bdfc1cae7b2a38/.dotnet/sdk/2.1.302/NuGet.targets(114,5): error :    at NuGet.Protocol.HttpSourceAuthenticationHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) [/mnt/temp/buildTmp/tmpfiles/dddbf267-b7c9-4975-a80d-51eb1df52637/Root/Test.csproj]
/mnt/work/33bdfc1cae7b2a38/.dotnet/sdk/2.1.302/NuGet.targets(114,5): error :    at System.Net.Http.HttpClient.FinishSendAsyncUnbuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts) [/mnt/temp/buildTmp/tmpfiles/dddbf267-b7c9-4975-a80d-51eb1df52637/Root/Test.csproj]
/mnt/work/33bdfc1cae7b2a38/.dotnet/sdk/2.1.302/NuGet.targets(114,5): error :    at NuGet.P
...

Other tests within that build may have failed with a similar message, but they are not listed here. Check the link above for more info.
CC @Eilon,@muratg,@mkArtakMSFT
This issue was made automatically. If there is a problem contact @ryanbrandenburg.

Please use this workflow to address this flaky test issue, including checking applicable checkboxes and filling in the applicable "TODO" entries:

Is this actually a flaky test?

No, this is a regular test failure, fix the test/product (TODO: Link to commit/PR)
Yes, proceed below...

Is this test failure caused by product code flakiness? (Either this product, or another product this test depends on.)

[ ] File a bug against the product (TODO: Link to other bug)
Is it possible to change the test to avoid the flakiness?

Yes? Go to the "Change the test!" section.
No?

[ ] Disable the test (TODO: Link to PR/commit)
[ ] Wait for other bug to be resolved
[ ] Wait for us to get build that has the fix
[ ] Re-enable our test (TODO: Link to PR/commit)
[ ] Close this bug

Is it that the test itself is flaky? This includes external transient problems (e.g. remote server problems, file system race condition, etc.)

Is there is a way to change our test to avoid this flakiness?

Yes? Change the test!

[ ] Change the test to avoid the flakiness, for example by using a different test strategy, or by adding retries w/ timeouts (TODO: Link to PR/commit)
[ ] Run the test 100 times locally as a sanity check.
[ ] Close this bug

No?

[ ] Delete the test because flaky tests are not useful (TODO: Link to PR/commit)

This comment was made automatically. If there is a problem contact @ryanbrandenburg.

TestControllerGenerators failed again.
This comment was made automatically. If there is a problem contact @ryanbrandenburg.

TestIdentityGenerator_IndividualFiles_AllFilesBuild failed again.
This comment was made automatically. If there is a problem contact @ryanbrandenburg.

@natemcmaster / @ryanbrandenburg - would this be a NuGet failure? Or an Azure blob failure?

It looks like the result of networking issues on our agents.

authors: Eilon natemcmaster ryanbrandenburg


text:
Sanitise loops

Use jit recognised for (var i; i < a.length; i++) for bounds check elimination.

Hi @benaadams, I'm your friendly neighborhood .NET Foundation Pull Request Bot (You can call me DNFBOT). Thanks for your contribution!
You've already signed the contribution license agreement. Thanks!
The agreement was validated by .NET Foundation and real humans are currently evaluating your PR.
TTYL, DNFBOT;

:shipit:

authors: Tratcher benaadams dnfclas

repo: aspnet/Hosting


text:
Test failure: HttpsClientCert_GetCertInformation

 Failed   Microsoft.AspNetCore.Server.IIS.FunctionalTests.ClientCertificateTests.HttpsClientCert_GetCertInformation(variant: Server: IISExpress, TFM: netcoreapp2.2, Type: Portable, Arch: x64, ANCM: V2, Host: InProcess)
  Error Message:
   Assert.Equal() Failure
             (pos 0)
  Expected: Enabled;BAF8529DF729239A8D4E871846FD4AA08···
  Actual:   <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML ···
             (pos 0)
  Stack Trace:
     at Microsoft.AspNetCore.Server.IIS.FunctionalTests.ClientCertificateTests.ClientCertTest(TestVariant variant, Boolean sendClientCert) in /_/test/Common.FunctionalTests/ClientCertificateTests.cs:line 77
  --- End of stack trace from previous location where exception was thrown ---
  Standard Output Messages:
   | [0.001s] TestLifetime Information: Starting test HttpsClientCert_GetCertInformation-Server: IISExpress, TFM: netcoreapp2.2, Type: Portable, Arch: x64, ANCM: V2, Host: InProcess at 2018-09-20T19:04:44
   | [0.002s] Microsoft.AspNetCore.Server.IntegrationTesting.IIS.IISExpressDeployer Information: Deploying [Variation] :: ServerType=IISExpress, Runtime=CoreClr, Arch=x64, BaseUrlHint=https://localhost:44300/, Publish=False
   | [0.002s] Microsoft.AspNetCore.Server.IntegrationTesting.IIS.IISExpressDeployer Information: Executing: dotnet C:\projects\iisintegration\test\WebSites\InProcessWebSite\bin\x64\Release\netcoreapp2.2\InProcessWebSite.dll
   | [0.031s] Microsoft.AspNetCore.Server.IntegrationTesting.IIS.IISExpressDeployer Information: ContentRoot: C:\projects\iisintegration\test\WebSites\InProcessWebSite
   | [0.032s] Microsoft.AspNetCore.Server.IntegrationTesting.IIS.IISExpressDeployer Information: Attempting to start IIS Express on port: 44300
   | [0.034s] Microsoft.AspNetCore.Server.IntegrationTesting.IIS.IISExpressDeployer Debug: Saving Config to C:\Users\appveyor\AppData\Local\Temp\1\tmp831.tmp
   | [0.034s] Microsoft.AspNetCore.Server.IntegrationTesting.IIS.IISExpressDeployer Information: Executing command : C:\Program Files\IIS Express\iisexpress.exe /site:HttpTestSite /config:C:\Users\appveyor\AppData\Local\Temp\1\tmp831.tmp /trace:error /systray:false
   | [0.035s] Microsoft.AspNetCore.Server.IntegrationTesting.IIS.IISExpressDeployer Information: Removing environment variable ASPNETCORE_ENVIRONMENT
   | [0.035s] Microsoft.AspNetCore.Server.IntegrationTesting.IIS.IISExpressDeployer Information: SET ASPNETCORE_DETAILEDERRORS=true
   | [0.035s] Microsoft.AspNetCore.Server.IntegrationTesting.IIS.IISExpressDeployer Information: SET ASPNETCORE_MODULE_DEBUG=console
   | [0.035s] Microsoft.AspNetCore.Server.IntegrationTesting.IIS.IISExpressDeployer Information: SET LAUNCHER_PATH=dotnet
   | [0.035s] Microsoft.AspNetCore.Server.IntegrationTesting.IIS.IISExpressDeployer Information: SET LAUNCHER_ARGS=C:\projects\iisintegration\test\WebSites\InProcessWebSite\bin\x64\Release\netcoreapp2.2\InProcessWebSite.dll
   | [0.035s] Microsoft.AspNetCore.Server.IntegrationTesting.IIS.IISExpressDeployer Information: SET ASPNETCORE_CONTENTROOT=C:\projects\iisintegration\test\WebSites\InProcessWebSite
   | [0.036s] Microsoft.AspNetCore.Server.IntegrationTesting.IIS.IISExpressDeployer Information: iisexpress Process 6052 started
   | [0.104s] Microsoft.AspNetCore.Server.IntegrationTesting.IIS.IISExpressDeployer Information: iisexpress stdout: Starting IIS Express ...
   | [0.118s] Microsoft.AspNetCore.Server.IntegrationTesting.IIS.IISExpressDeployer Information: iisexpress stdout: Initializing the W3 Server Started CTC = 919656
   | [0.122s] Microsoft.AspNetCore.Server.IntegrationTesting.IIS.IISExpressDeployer Information: iisexpress stdout: W3 Server initializing WinSock.  CTC = 919671
   | [0.122s] Microsoft.AspNetCore.Server.IntegrationTesting.IIS.IISExpressDeployer Information: iisexpress stdout: W3 Server WinSock initialized.  CTC = 919671
   | [0.122s] Microsoft.AspNetCore.Server.IntegrationTesting.IIS.IISExpressDeployer Information: iisexpress stdout: W3 Server ThreadPool initialized (ipm has signalled).  CTC = 919671
   | [0.140s] Microsoft.AspNetCore.Server.IntegrationTesting.IIS.IISExpressDeployer Information: iisexpress stdout: [aspnetcorev2.dll] Initializing logs for 'C:\projects\iisintegration\test\IISExpress.FunctionalTests\bin\Release\netcoreapp2.2\x64\aspnetcorev2.dll'. Process Id: 6052.. File Version: 12.2.18263.0. Description: IIS ASP.NET Core Module V2. Commit: 2f4ebec7b5c08a307c934d3a53abf2efc78a2d1b.
   | [0.140s] Microsoft.AspNetCore.Server.IntegrationTesting.IIS.IISExpressDeployer Information: iisexpress stdout: Start listenerChannel http:0
   | [0.142s] Microsoft.AspNetCore.Server.IntegrationTesting.IIS.IISExpressDeployer Information: iisexpress stdout: Successfully registered URL "https://localhost:44300/" for site "HttpTestSite" application "/"
   | [0.142s] Microsoft.AspNetCore.Server.IntegrationTesting.IIS.IISExpressDeployer Information: iisexpress stdout: Registration completed for site "HttpTestSite"
   | [0.143s] Microsoft.AspNetCore.Server.IntegrationTesting.IIS.IISExpressDeployer Information: iisexpress stdout: AppPool 'IISExpressAppPool' initialized
   | [0.143s] Microsoft.AspNetCore.Server.IntegrationTesting.IIS.IISExpressDeployer Information: iisexpress stdout: InitComplete event signalled
   | [0.144s] Microsoft.AspNetCore.Server.IntegrationTesting.IIS.IISExpressDeployer Information: iisexpress stdout: IIS Express is running.
   | [0.144s] Microsoft.AspNetCore.Server.IntegrationTesting.IIS.IISExpressDeployer Information: Started iisexpress successfully. Process Id : 6052, Port: 44300
   | [0.146s] Microsoft.AspNetCore.Server.IntegrationTesting.IIS.IISExpressDeployer Information: Application ready at URL: https://localhost:44300/
   | [1.717s] HttpTestSite Debug: Method: GET, RequestUri: 'https://localhost:44300/GetClientCert', Version: 2.0, Content: <null>, Headers:
   |                              {
   |                              }
   | [1.729s] Microsoft.AspNetCore.Server.IntegrationTesting.IIS.IISExpressDeployer Information: iisexpress stdout: IncrementMessages called
   | [1.837s] Microsoft.AspNetCore.Server.IntegrationTesting.IIS.IISExpressDeployer Information: iisexpress stdout: Request ended: https://localhost:44300/GetClientCert with HTTP status 403.16
   | [1.850s] HttpTestSite Warning: StatusCode: 403, ReasonPhrase: 'Forbidden', Version: 1.1, Content: System.Net.Http.HttpConnection+HttpConnectionResponseContent, Headers:
   |                                {
   |                                  Cache-Control: private
   |                                  Server: Microsoft-IIS/10.0
   |                                  X-SourceFiles: =?UTF-8?B?QzpccHJvamVjdHNcaWlzaW50ZWdyYXRpb25cdGVzdFxXZWJTaXRlc1xJblByb2Nlc3NXZWJTaXRlXEdldENsaWVudENlcnQ=?=
   |                                  X-Powered-By: ASP.NET
   |                                  Date: Thu, 20 Sep 2018 19:04:46 GMT
   |                                  Content-Type: text/html; charset=utf-8
   |                                  Content-Length: 5218
   |                                }
   | [1.850s] HttpTestSite Warning: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

  <title>IIS 10.0 Detailed Error - 403.16 - Forbidden</title>

HTTP Error 403.16 - Forbidden

Your client certificate is either not trusted or is invalid.

   <fieldset>
Most likely causes:

The client certificate used for this request is not trusted by the Web server.

   </fieldset>

   <fieldset>
Things you can try:

The client may have an old certificate selected for client authentication to this Web site. Close all open client windows, open a new browser window, and then select a valid certificate for client authentication.

Verify that the client certificate is trusted by the Web server.

Verify that the root certificate is properly installed and trusted on the Web server.

Check the failed request tracing logs for additional information about this error. For more information, click here.

   </fieldset>

   <fieldset>
Detailed Error Information:

Module	   IIS Web Core

Notification	   BeginRequest

Handler	   aspNetCore

Error Code	   0x800b0109

Requested URL	   https://localhost:44300/GetClientCert

Physical Path	   C:\projects\iisintegration\test\WebSites\InProcessWebSite\GetClientCert

Logon Method	   Not yet determined

Logon User	   Not yet determined

Request Tracing Directory	   C:\Users\appveyor\Documents\IISExpress\TraceLogFiles\HTTPTESTSITE

   </fieldset>

   <fieldset>
More Information:

    A Secure Sockets Layer (SSL) client certificate identifies you as a valid user of the resource. This error can occur if you choose a client certificate created by a Certificate Authority (CA) that is not trusted by the Web server.

View more information »

   </fieldset>

   | [1.853s] Microsoft.AspNetCore.Server.IntegrationTesting.IIS.IISExpressDeployer Information: Attempting to cancel process 6052
   | [1.915s] Microsoft.AspNetCore.Server.IntegrationTesting.IIS.IISExpressDeployer Information: iisexpress Process 6052 shut down
   | [1.915s] Microsoft.AspNetCore.Server.IntegrationTesting.IIS.IISExpressDeployer Information: Host process shutting down.
   | [1.917s] Microsoft.AspNetCore.Server.IntegrationTesting.IIS.IISExpressDeployer Information: Successfully terminated host process with process Id '6052'
   | [1.917s] Microsoft.AspNetCore.Server.IntegrationTesting.IIS.IISExpressDeployer Debug: Deleting applicationHost.config file from C:\Users\appveyor\AppData\Local\Temp\1\tmp831.tmp
   | [1.918s] Microsoft.AspNetCore.Server.IntegrationTesting.IIS.IISExpressDeployer Information: [Time]: Total time taken for this test variation '1.9160615' seconds

cc @jkotalik

WindowsAuthTest failed with about the same error on master.
This comment was made automatically. If there is a problem contact ryanbrandenburg.

HttpsNoClientCert_NoClientCert failed with about the same error on master.
This comment was made automatically. If there is a problem contact ryanbrandenburg.

All other tests failures here are irrelevant to the original bug. Seems to be a net461 + Kestrel issue with packages.

There were 16 failures with about the same error on master:

HttpsHelloWorld
HttpsNoClientCert_NoClientCert
HttpsClientCert_GetCertInformation
HttpsHelloWorld
WindowsAuthTest
HttpsNoClientCert_NoClientCert
HelloWorld
HelloWorld
HttpsClientCert_GetCertInformation
WindowsAuthTest
(And 6 more test failures in this build)

This comment was made automatically. If there is a problem contact ryanbrandenburg.

There were 16 failures with about the same error on master:

HelloWorld
WindowsAuthTest
HttpsNoClientCert_NoClientCert
HttpsClientCert_GetCertInformation
HttpsHelloWorld
HttpsClientCert_GetCertInformation
HelloWorld
HttpsNoClientCert_NoClientCert
HttpsHelloWorld
WindowsAuthTest
(And 6 more test failures in this build)

This comment was made automatically. If there is a problem contact ryanbrandenburg.

There were 16 failures with about the same error on master:

HelloWorld
HttpsClientCert_GetCertInformation
HelloWorld
HttpsClientCert_GetCertInformation
HttpsHelloWorld
HttpsHelloWorld
HttpsNoClientCert_NoClientCert
HttpsNoClientCert_NoClientCert
WindowsAuthTest
WindowsAuthTest
(And 6 more test failures in this build)

This comment was made automatically. If there is a problem contact ryanbrandenburg.

There were 16 failures with about the same error on master:

HttpsNoClientCert_NoClientCert
HelloWorld
WindowsAuthTest
HttpsNoClientCert_NoClientCert
WindowsAuthTest
HttpsClientCert_GetCertInformation
HttpsHelloWorld
HttpsHelloWorld
HttpsClientCert_GetCertInformation
HelloWorld
(And 6 more test failures in this build)

This comment was made automatically. If there is a problem contact ryanbrandenburg.

There were 16 failures with about the same error on master:

HttpsNoClientCert_NoClientCert
HttpsClientCert_GetCertInformation
WindowsAuthTest
HttpsHelloWorld
WindowsAuthTest
HttpsNoClientCert_NoClientCert
HttpsHelloWorld
HelloWorld
HttpsClientCert_GetCertInformation
HelloWorld
(And 6 more test failures in this build)

This comment was made automatically. If there is a problem contact ryanbrandenburg.

There were 16 failures with about the same error on master:

HelloWorld
HttpsHelloWorld
WindowsAuthTest
HttpsClientCert_GetCertInformation
HttpsNoClientCert_NoClientCert
HttpsHelloWorld
WindowsAuthTest
HttpsClientCert_GetCertInformation
HttpsNoClientCert_NoClientCert
HelloWorld
(And 6 more test failures in this build)

This comment was made automatically. If there is a problem contact ryanbrandenburg.

This comment was made automatically. If there is a problem contact ryanbrandenburg.
There were 1 failures with about the same error on 2.2 at 1:53:25 AM:

HttpsClientCert_GetCertInformation

@jkotalik last failure is real:

HTTP Error 403.16 - Forbidden

Your client certificate is either not trusted or is invalid.

 <fieldset>
Most likely causes:

The client certificate used for this request is not trusted by the Web server.

 </fieldset>

 <fieldset>
Things you can try:

The client may have an old certificate selected for client authentication to this Web site. Close all open client windows, open a new browser window, and then select a valid certificate for client authentication.

Verify that the client certificate is trusted by the Web server.

Verify that the root certificate is properly installed and trusted on the Web server.

Check the failed request tracing logs for additional information about this error. For more information, click here.

 </fieldset>

Something in how we generate cert?

The HRESULT is CERT_E_UNTRUSTEDROOT, so somehow the machine doesn't trust the cert. I doubt it's an issue with how we generate the cert, but it's possible.

Will reopen if test start's failing again.

authors: aspnet-hello jkotalik pakrym

repo: aspnet/IISIntegration


text:
Guidance on new 2.1 stuff

Can we get guidance on adding user properties, renaming Identity tables and changing key types with all of these changes for 2.1 (i.e. #1690, #1679)
It seems like this was made easier, right? Can we see how it all comes together now?
Thanks!

@ajcvickers This is your bailiwick

See https://docs.microsoft.com/en-us/aspnet/core/security/authentication/customize_identity_model?view=aspnetcore-2.1

authors: ajcvickers blowdart natelaff

repo: aspnet/Identity


text:
Webpack Angular 2 SASS

Hi nice project. @scottaddie pointed me to this project.
https://github.com/aspnet/JavaScriptServices/tree/master/templates/Angular2Spa
I created, with @FabianGosebrink a similar template for Webpack, Visual Studio, angular 2 an ASP.NET core.
https://github.com/damienbod/Angular2WebpackVisualStudio
Maybe support for SASS could be added to this template.
Greetings Damien
Template issue: https://github.com/aspnet/Templates/issues/541

Thanks for the suggestion. Hopefully people will find it quite trivial to add SASS support to the projects generated with this template (or LESS, or any other CSS preprocessor) because it's just webpack. Simply adding a SASS/LESS/etc loader to webpack.config.js is enough to get SASS/LESS/etc support.

Closing as this is already covered by #132

authors: SteveSandersonMS damienbod

repo: aspnet/JavaScriptServices


text:
Using Swashbuckle.AspNetCore in Angular template project

I'm looking for a way to utilize the Swagger UI provided by this package in the angular starter.  I've looked at the answer proposed in #1119 (which in turn references #973) and it seems things have changed a bit, as I have no call to  MapSpaFallbackRoute in my Startup class.  I am having the same issue described in these issues, in which the request to /swagger gets proxied to the SPA and thus ends up at a 404 error.  I've tried moving the bits that enable the middleware above the call that enables mvc, not sure what else to do.  Thanks for any help! Here's my Startup.cs if it helps at all:
    public class Startup
    {
        public Startup(IConfiguration configuration)
        {
            Configuration = configuration;
        }

        public IConfiguration Configuration { get; }

        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddDbContext<ApplicationDbContext>(options =>
                {
                    options.UseNpgsql(Configuration.GetConnectionString("DefaultConnection"));
                }
            );

            services.AddIdentity<ApplicationUser, ApplicationRole>().AddEntityFrameworkStores<ApplicationDbContext>()
                .AddDefaultTokenProviders();

            services.AddAuthentication(opts =>
                {
                    opts.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme;
                    opts.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme;
                })
                .AddJwtBearer(options =>
                {
                    options.TokenValidationParameters = new TokenValidationParameters
                    {
                        ValidateIssuer = true,
                        ValidateAudience = true,
                        ValidateLifetime = true,
                        ClockSkew = TimeSpan.Zero,
                        ValidateIssuerSigningKey = true,
                        ValidIssuer = Configuration["Jwt:Issuer"],
                        ValidAudience = Configuration["Jwt:Issuer"],
                        IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(Configuration["Jwt:Key"]))
                    };
                });

            services.AddAuthorization(options =>
            {
                options.AddPolicy("TestPolicy", policy => policy.RequireClaim("testClaim", "potato"));
            });

            services.AddMvc().AddJsonOptions(options =>
            {
                options.SerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore;
            });

            services.AddCors();

            // Allow injection of configuration
            services.AddSingleton(Configuration);

            services.AddTransient<IUserService, ConsilioUserService>();
            services.AddTransient<ITimeService, ConsilioTimeService>();
            services.AddTransient<IHttpContextAccessor, HttpContextAccessor>();

            // In production, the Angular files will be served from this directory
            services.AddSpaStaticFiles(configuration => { configuration.RootPath = "ClientApp/dist"; });

            services.AddSwaggerGen(c => c.SwaggerDoc("v1", new Info {Title = "My API", Version = "v1"}));
        }

        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseExceptionHandler("/Home/Error");
            }

            app.UseStaticFiles();
            app.UseSpaStaticFiles();

            app.UseCors(builder =>
                builder.AllowAnyHeader().AllowAnyMethod().AllowAnyOrigin()
            );

            app.UseAuthentication();

            // Enable middleware to serve generated Swagger as a JSON endpoint.
            app.UseSwagger();

            // Enable middleware to serve swagger-ui (HTML, JS, CSS, etc.), specifying the Swagger JSON endpoint.
            app.UseSwaggerUI(c =>
            {
                c.SwaggerEndpoint("api/swagger/v1/swagger.json", "My API V1");
            });

            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "default",
                    template: "{controller}/{action=Index}/{id?}");
            });

            app.UseSpa(spa =>
            {
                spa.Options.SourcePath = "ClientApp";
                if (env.IsDevelopment())
                {
//                    spa.UseAngularCliServer(npmScript: "start");
                    spa.UseProxyToSpaDevelopmentServer("http://localhost:4200");
                }
            });
        }

Perhaps put:
app.UseSwagger();
Above:
app.UseAuthentication();

The SPA fallback routing is only used if none of the other middleware is handling the request (since your UseSpa middleware appears last). So if /swagger gets served by the SPA middleware, it must not be correctly wired up to the Swagger middleware. Please check Swagger docs for more info on how to set it up.
@ADefWebserver I don't know - if auth was interfering, I'm not sure how that would result in it ending up in the SPA middleware. Maybe you're right though!

authors: ADefWebserver SteveSandersonMS pha3l


text:
Ensures focus is in the Library Search text box on Install dialog load

Fixes internally tracked accessibility issue 893985.

I guess I added this last year, but I'm not sure if this is the right thing to do. Someone using the narrator might not know what the provider is(default one). Does it make sense to set focus to provider combo box instead so that when narrator is on it would announce provider and user can tab and move on to type required library?
If you think it's outside the scope of this review, I can look into it once this change is checked in.

authors: alexgav bhsubra

repo: aspnet/LibraryManager


text:
AmbiguousMatchException: Ambiguous match found.

running mvc 6 in 1.0.0-rc1-final also have 2 different Class Library added as reference in this project. one of them class library used for maintain sqlserver data model with identity and another is for maintain sqlite data model. after creating relationship between models and updating database every thing works fine. and then when i created a mvc form which has 3 entities one parent entity (a) and other two (b) and (c) both of them has  one-to-one relationship with entity (a)
builder.Entity<a>()
.HasOne(u => u.b)
.WithOne(t => t.a)
.HasForeignKey<b>(b=> b.pubID).IsRequired()
.OnDelete(Microsoft.Data.Entity.Metadata.DeleteBehavior.Cascade);
builder.Entity<a>()
.HasOne(u => u.c)
.WithOne(u => u.a)
.HasForeignKey<c>(b => b.pubID).IsRequired()
.OnDelete(Microsoft.Data.Entity.Metadata.DeleteBehavior.Cascade);
and the post controller public async Task<IActionResult> Create(A a).
when i submitting this single form with (a) and (c) entities its working fine but when i include (b) entity and submitting this form i getting an error.
I can't figure it out. i tried to debug using break point but no luck.
System.Reflection.AmbiguousMatchException.txt

Does your model class have two properties with the same name but different casings, or perhaps a property that uses new to hide a base class property?
/cc @Eilon

some how i solved the problem but know i stuck with new one
https://github.com/aspnet/EntityFramework/issues/3923
thanks for your suggestions

@himadrinath can you show the exact model code you have?

here is my 3 entities
Advertisement.txt
Contact.txt
CellPhone.txt

Indeed, I see many public properties that differ only by case:
        [DefaultValue("NA")]
        [Required(ErrorMessage = "select a type")]
        [Display(Name = "Commercial")]
        [RegularExpression(@"Offering|Wanted|NA")]
        [Column("commercial", TypeName = "nvarchar(30)")]
        public string commercial { get; set; }

        [NotMapped]
        public Dictionary<string, string> Commercial;

We could look at fixing this in MVC but it's definitely strongly recommended to avoid having public properties that different only by case.

thank you. i really appreciate it

@rynowak any thoughts on what we'd want to do here?

Make model binding case-sensitive? :trollface:
Supporting this would mean adding case-insensitivity to a lot of infrastructure that has historically always been case-sensitive (model-metadata, and all rendering code).

Could/should model binding proactively fail if it tries to bind such a property and say it isn't supported? (As opposed to failing in Reflection.)

We could definitely throw a better exception, but it probably would happen when model metadata is initialized if we're being thorough.

How bad would it be to throw when model metadata is initialized? Would the exception be thrown from a place that would make sense to someone? E.g. the first time that type is run through model binding?

How bad would it be to throw when model metadata is initialized? Would the exception be thrown from a place that would make sense to someone? E.g. the first time that type is run through model binding?

There's a few places this might show up:

Model Binding
Validation
HtmlHelpers/TagHelpers

Moving this to the backlog.
Ultimately, this is not a supported scenario in MVC. MVC cannot bind types that have properties that differ only by case.

Closing because we have no plans to support this.

authors: Eilon himadrinath rynowak

repo: aspnet/Mvc


text:
Cannot cast Newtonsoft.Json.Linq.JObject to Newtonsoft.Json.Linq.JToken in Microsoft.Extensions.DependencyModel.DependencyContextJsonReader

Steps to reproduce
install latest dotnet cli
git clone https://github.com/aspnet/cli-samples.git
update project.json with the following framework settings:
    "frameworks": {
        "netstandardapp1.5": {
            "imports": [
                "dnxcore50",
                "portable-net451+win8"
            ],
            "dependencies": {
                "NETStandard.Library": "1.5.0-*"
            }
        }
    }

dotnet restore
dotnet build
dotnet run
launch a browser to http://localhost:5000
Expected behavior
HTML with a static image and "Hello World"
Actual behavior
The following error:
An unhandled exception has occurred while executing the request
System.InvalidCastException: Cannot cast Newtonsoft.Json.Linq.JObject to Newtonsoft.Json.Linq.JToken.
   at Newtonsoft.Json.Linq.Extensions.Convert[T,U](T token)
   at Microsoft.Extensions.DependencyModel.DependencyContextJsonReader.Read(JObject root)
   at Microsoft.Extensions.DependencyModel.DependencyContextJsonReader.Read(Stream stream)
   at Microsoft.Extensions.DependencyModel.DependencyContextLoader.LoadAssemblyContext(Assembly assembly)
   at Microsoft.Extensions.DependencyModel.DependencyContextLoader.Load(Assembly assembly)
   at Microsoft.AspNetCore.Mvc.Infrastructure.DefaultAssemblyProvider..ctor(IHostingEnvironment environment)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.ConstructorCallSite.Invoke(ServiceProvider provider)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.TransientCallSite.Invoke(ServiceProvider provider)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.ConstructorCallSite.Invoke(ServiceProvider provider)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.TransientCallSite.Invoke(ServiceProvider provider)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.ConstructorCallSite.Invoke(ServiceProvider provider)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.TransientCallSite.Invoke(ServiceProvider provider)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.ClosedIEnumerableService.CallSite.Invoke(ServiceProvider provider)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.TransientCallSite.Invoke(ServiceProvider provider)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderExtensions.GetRequiredService[T](IServiceProvider provider)
   at Microsoft.AspNetCore.Mvc.Internal.ActionDescriptorCollectionProvider.GetCollection()
   at Microsoft.AspNetCore.Mvc.Internal.ActionDescriptorCollectionProvider.get_ActionDescriptors()
   at Microsoft.AspNetCore.Mvc.Internal.AttributeRoute.GetTreeRouter()
   at Microsoft.AspNetCore.Mvc.Internal.AttributeRoute.RouteAsync(RouteContext context)
   at Microsoft.AspNetCore.Routing.RouteCollection.<RouteAsync>d__9.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.Builder.RouterMiddleware.<Invoke>d__4.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.Diagnostics.DeveloperExceptionPageMiddleware.<Invoke>d__7.MoveNext()

Environment information:
.NET Command Line Tools (1.0.0-beta-001998)

Product Information:
 Version:     1.0.0-beta-001998
 Commit Sha:  cd35ba2a1a

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.11
 OS Platform: Darwin
 Runtime Id:  osx.10.11-x64

The most recent version of the CLI that we've tested against is 1.0.0.001718. We're working on updating to a newer version, but we using versions that we haven't tested (especially when the CLI is churning so much) is probably not a good idea.

@pranavkm Yep. That's what I've come to find out.
But just to be clear, if I somehow find version 1.0.0.001718 of the dotnet CLI for OS X - everything should work out of the box correct?
Or is there some framework version that will work with the latest CLI drop?

oh man, I'm hitting this problem too. I'm not even sure how to go back to 1.0.0.001718. Is there any way to do this?

Our latest bits (from aspnetcidev) were built using 1.0.0001718 and tested* on Travis + internal CIs so it should just work.

we use in memory servers for our tests, so we don't get coverage for tests over Kestrel and IIS. We get that indirectly via MusicStore which seems to be doing ok on OSX with that build of CLI + latest of Mvc.

@pranavkm Thanks for the info.
I just pulled the latest MusicStore and ran it against my current CLI (1.0.0-beta-001998) and ran into the Failed to initialize CoreCLR, HRESULT: 0x80004005 others have also hit.
I'll try to find the 1.0.0-beta-001718 binaries or installer, downgrade and hopefully get back to a stable build.

If you find a link to that version, please share it. I’m hunting for one as well now. I have the file for 0.0.0-beta-001897 and it was working for me last night, but I’m not sure how it will fare against today’s nightly libraries.
If you need 0.0.0-beta-001897, let me know and I'll put in a dropbox for you.

https://github.com/dotnet/cli/tree/rel/1.0.0/scripts/obtain/install.sh has a way to specify the version to install.

I tried that, it didn't work. I used git clone [repo] and went to the right directory, and ran .\install.ps1 -version #.#.#.# and it simply gave me an error.
PS C:\Users\Ciel\Documents\.NET\cli\scripts\obtain> .\install.ps1 -version 1.0.0.001718
dotnet_install: Downloading https://dotnetcli.blob.core.windows.net/dotnet/beta/Binaries/1.0.0.001718/dotnet-dev-win-x64.1.0.0.001718.zip
Invoke-WebRequest : BlobNotFoundThe specified blob does not exist.
RequestId:08a42a89-0001-007e-50b2-86f94a000000
Time:2016-03-25T16:20:20.8293200Z
At C:\Users\Ciel\Documents\.NET\cli\scripts\obtain\install.ps1:321 char:13
+     $resp = Invoke-WebRequest -UseBasicParsing $DownloadLink -OutFile ...
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebReques
   t], WebException
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCo
   mmand
PS C:\Users\Ciel\Documents\.NET\cli\scripts\obtain>

Hitting me too. Is there a way this can be fixed on the input side (what JSON is it reading)?

@pranavkm why would the version of the CLI affect the runtime of an ASP.NET app and which versions of Json.NET it's referencing?

@Eilon, there might be breaking changes in the DependencyModel json that gets produced by the CLI. They don't have a versioning scheme and their format is not backwards compatible - so older DependencyModel code might not be able to read it.

Oh so it's not a real Json.NET version issue, but more likely some schema issue.

For the record, out of pure curiousity... since I still had DNX installed on my machine I decided to try those tools to run MusicStore.
I upgraded to the latest runtime:
Active Version              Runtime Architecture OperatingSystem Alias
------ -------              ------- ------------ --------------- -----
       1.0.0-rc1-final      coreclr x64          darwin
       1.0.0-rc1-update1    coreclr x64          darwin
  *    1.0.0-rc2-20222      coreclr x64          darwin          default

Removed the net451 framework from project.json, ran dnu restore, dnu build, and dnx web and ran into this issue:
      An unhandled exception has occurred while executing the request
System.InvalidOperationException: The Razor page '/Views/Home/Index.cshtml' failed to compile. Ensure that your application's project.json sets the 'preserveCompilationContext' compilation property.

Digging through GH issues looks like this is all related to changes to DependencyModel as @pranavkm elluded to.

@miguellira see https://github.com/aspnet/Announcements/issues/154

@pranavkm Thanks. I'm subscribed to that repo and am usually good at remembering those announcements.
Updated per instructions, dnu restore, dnu build, and dnx web and now I get a new exception:
An unhandled exception has occurred while executing the request
System.MissingMethodException: Method not found: 'System.Reflection.MethodInfo[] System.Reflection.TypeExtensions.GetMethods(System.Type, System.Reflection.BindingFlags)'.

At some point this all worked fine and I'm hopeful I can "undo" my changes and get back to a working enviornment.
I truly hope that this thread is helping your team get to a more stable RC2 or at the very least serves as a place where others running into the same issues can feel some sort of comfort that they are not alone - but really there's no need in chasing down ghosts.

For those parties interested... I managed to get back to a "working enviornment".
As @pranavkm suggested, getting back to version 1.0.0-beta-001718 was the solution.
The install.sh file, however, is currently adding a -dev in the URL which results in an invalid download so I googled, found this Travis CI log and long story short...
These are the dotnet CLI bits you are looking for: https://dotnetcli.blob.core.windows.net/dotnet/beta/Binaries/1.0.0.001718/dotnet-osx-x64.1.0.0.001718.tar.gz
.NET Command Line Tools (1.0.0-beta-001718)

Product Information:
 Version:     1.0.0-beta-001718
 Commit Sha:  5b0afe7880

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.11
 OS Platform: Darwin
 Runtime Id:  osx.10.11-x64

Although dotnet-publish-iis results in many of the following warnings:
warn : Detected package downgrade: System.Dynamic.Runtime from 4.0.11-rc2-23923 to 4.0.11-rc2-23911
warn :  bin (>= 1.0.0) -> dotnet-publish-iis (>= 1.0.0) -> Microsoft.DotNet.ProjectModel (>= 1.0.0-beta-001943) -> Microsoft.CSharp (>= 4.0.1-rc2-23911) -> System.Dynamic.Runtime (>= 4.0.11-rc2-23923)
...[snip]...

I was able to run the HelloMvc app without modification.

Thank you so much for the file.
I really, really hope all this craziness settles soon. Right now I just have to grin and bear it because I know the teams are doing their best and pushing themselves as hard as they can to get this all up and running... But I never realized how much of the work Visual Studio abstracted away for me.
This whole .net core experience has made me appreciate Visual Studio and even ASP.NET MVC more than before.

@ciel You're welcome. Glad this long thread has helped someone.
I totally agree with your comment. My main work is on a Windows 10/VS2K15 setup and though I have all of the tooling up to date there I use my Mac to try out all the .NET Core bits - porting small ASP.NET apps (usually rich client side ones) with little or no dependency on .NET full.
Definitely looking forward to working with all this stuff on Visual Studio. Good luck!

@miguellira @pranavkm @Eilon I just hit this under dotnet cli -2076 on Win10 with a netcoreapp1.0 app. Is the workaround really to go all the way back to -1718?
.NET Command Line Tools (1.0.0-beta-002076)

Product Information:
 Version:     1.0.0-beta-002076
 Commit Sha:  8df6f5405d

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.10586
 OS Platform: Windows
 RID:         win10-x64

"dependencies": {
    "AppExceptions": "1.0.0",
    "ContactLog": "1.0.0",
    "CustomMvcRazorHost": "1.0.0",
    "Email": "1.0.0",
    "Microsoft.AspNetCore.Antiforgery": "1.0.0-*",
    "Microsoft.AspNetCore.Diagnostics": "1.0.0-*",
    "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-*",
    "Microsoft.AspNetCore.Mvc": "1.0.0-*",
    "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-*",
    "Microsoft.AspNetCore.StaticFiles": "1.0.0-*",
    "Microsoft.AspNetCore.Tooling.Razor": "1.0.0-*",
    "Microsoft.Extensions.Configuration": "1.0.0-*",
    "Microsoft.Extensions.Logging.Console": "1.0.0-*",
    "NETStandard.Library": "1.5.0-*",
    "StyleScriptInlining": "1.0.0",
    "WindowsAzure.Storage": "6.2.2-preview"
},
"frameworks": {
    "netcoreapp1.0": {
        "imports": [ "dnxcore50", "portable-net451+win8" ]
    }
},
"runtimes": {
    "win81-x64": {}
},

That CLI might be too new, you need 1718.

or you might be able to work around it by replacing the right services...

In case anyone wants the Win version of -1718, the binaries can be obtained at ...
https://dotnetcli.blob.core.windows.net/dotnet/beta/Binaries/1.0.0.001718/dotnet-win-x64.1.0.0.001718.zip

However and as I expected, that's a really, really old dotnet cli, so trying to use that resulted in this ...

I'd like to try your, @davidfowl, suggestion next. Besides getting past the OP exception, I want latest dotnet cli sauce for my goose.
I'm going to look into the casting situation in Microsoft.AspNetCore.Mvc.Infrastructure.DefaultAssemblyProvider and see what's what, but any additional tips on "replacing the right services" would be greatly appreciated.
It's also worth asking @pranavkm: When you say "We're working on updating to a newer version," I don't guess there is an open issue on that that we can track? Whatever I do today to get around this, I'd like to know when "nightly" dotnet cli and "nightly" CoreFX are holding hands again :heart:, so I can drop whatever I end up putting into place today.

@GuardRex FWIW... I decided to take your project.json, remove any private libraries and try it out against the latest CLI drop on OS X (1.0.0-beta-0021111) and was able to successfully run a simple MVC app without runtime errors. Here's what I got:
project.json
{
    "version": "1.0.0-*",
    "compilationOptions": {
        "emitEntryPoint": true,
        "preserveCompilationContext": true
    },
    "dependencies": {
        "Microsoft.AspNetCore.Antiforgery": "1.0.0-*",
        "Microsoft.AspNetCore.Diagnostics": "1.0.0-*",
        "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-*",
        "Microsoft.AspNetCore.Mvc": "1.0.0-*",
        "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-*",
        "Microsoft.AspNetCore.StaticFiles": "1.0.0-*",
        "Microsoft.AspNetCore.Tooling.Razor": "1.0.0-*",
        "Microsoft.Extensions.Configuration": "1.0.0-*",
        "Microsoft.Extensions.Logging.Console": "1.0.0-*",
        "NETStandard.Library": "1.5.0-*",
        "WindowsAzure.Storage": "6.2.2-preview"
    },
    "frameworks": {
        "netcoreapp1.0": {
            "imports": [
                "dnxcore50",
                "portable-net451+win8"
            ]
        }
    }
}

NuGet.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <!--To inherit the global NuGet package sources remove the <clear/> line below -->
    <clear />
    <add key="aspnetcidev" value="https://www.myget.org/F/aspnetcidev/api/v3/index.json" />
    <add key="dotnet-core" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />
    <add key="api.nuget.org" value="https://api.nuget.org/v3/index.json" />
  </packageSources>
</configuration>

Program.cs
using System;
using System.IO;
using Microsoft.AspNetCore.Hosting;

namespace GuardRex
{
    public class Program
    {
        public static void Main(string[] args)
        {
            var host = new WebHostBuilder()
                        .UseServer("Microsoft.AspNetCore.Server.Kestrel")
                        .UseContentRoot(Directory.GetCurrentDirectory())
                        .UseDefaultHostingConfiguration(args)
                        .UseStartup<Startup>()
                        .Build();

            host.Run();
        }
    }
}

Startup.cs
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.HttpOverrides;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;

namespace GuardRex
{
    public class Startup
    {
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddMvc();
        }

        public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
        {
            loggerFactory.AddConsole(LogLevel.Debug);

            app.UseForwardedHeaders(new ForwardedHeadersOptions
            {
                ForwardedHeaders = ForwardedHeaders.All
            });

            app.UseStaticFiles();

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseMvcWithDefaultRoute();
        }
    }
}

It's important to note that although I did not receive any runtime errors, I did get a restore error:
Errors in /Users/miguellira/Desktop/GuardRex/project.json
    System.Xml.XmlSerializer 4.0.0-beta-23109 provides a compile-time reference assembly for System.Xml.XmlSerializer on .NETCoreApp,Version=v1.0, but there is no run-time assembly compatible with osx.10.11-x64.
    One or more packages are incompatible with .NETCoreApp,Version=v1.0 (osx.10.11-x64).

Not sure if this will fair as well on Windows 10, I'll try later and update the thread. Cheers.

@miguellira I did get it running a few hours ago after it was failing earlier this morning, and I think something changed this morning in packages/runtime/tooling to make that possible.
The System.Xml.XmlSerializer issue is because the Azure Storage team pegged the dep to an old package for WindowsAzure.Storage. I think the next version of the Azure Storage library will clear that one up. In the meantime, I was given the good advice by Eric StJohn to add "System.Xml.XmlSerializer": "4.0.11-*" to the deps to shut-up the exception, and that seems to be working fine. https://github.com/dotnet/corefx/issues/6801#issuecomment-197553984

authors: Eilon GuardRex ciel davidfowl kwaclaw miguellira pranavkm


text:
Camel case not default for Model validation

MVC serializes JSON with camel case by default. However, it doesn't seem true for Model validation and still requires. .AddJsonFormatters(j => j.ContractResolver = new CamelCasePropertyNamesContractResolver())
Otherwise, the validation errors come back in pascal case as seen below on BadRequest(ModelState).
{
  "FirstName": [
    "The FirstName field is required."
  ]
}

where it should actually be
{
  "firstName": [
    "The FirstName field is required."
  ]
}

It's true the keys added to ModelState are generally based on C# properties (usually Pascal-cased) and not the incoming data. But names are matched case-insensitively in model binding and validation and the ModelStateDictionary does case-insensitive lookups.
Could you clarify why the line you added insufficient or perhaps an undue burden to adjust the system to match your preferences?

Adding the line isn't an undue burden but we assumed since camel case was the default json formatter that this line wouldn't be needed. When any other object is serialized to json which has pascal-cased properties it correctly uses the default formatter which is camel case. However, except for the returned validation result errors json.

Please describe your scenario in more detail, including the validation errors when submitted JSON has unexpected key casing. A small repro project hosted in a public GitHub repo would be ideal.

Here you go. camel-case-issue

@bryjshed your tests show that the service is indeed configured with the expected output formatter configuration. However, asserting specific key casing doesn't demonstrate an end-to-end problem.
Are you using a client-side JSON parser that is case-sensitive? If yes, configure the service to match the exact keys your client expects.

@dougbu I don't really think that the need for case-sensitivity is the issue. There is a work around. I think the issue is that this is unexpected behavior. As described here: https://github.com/aspnet/Mvc/issues/4842

@johnathan-walker I'm closing this as a duplicate of the #4842 discussion. Had thought you were reporting a bug.

The expected behavior for serializing ModelState is camel case. The actual behavior is pascal. I think that is a bug.

@dougbu

FYI the JSON serializer doesn't special case ModelState and it's handled like any other dictionary.

@dougbu This should really be a bug (since #4842 announces that the default casing in camel and in this case it is not) and fixed in upcoming releases, although there are workarounds as pointed out by @johnathan-walker and @bryjshed

Please see #4969 as well as discussion of the intentional distinction between code and data in #4842.
As I said earlier, MVC treates ModelState like any other dictionary. Feel free however to file a feature request for a special case in this area. Note it would be somewhat strange because ModelState keys come from both C# property names and users' submitted dictionary keys.

@dougbu C# property names are an internal implementation detail of the API code, and should not be exposed verbatim to the API clients.  I would argue that the same justification used to default to camel case should be applied here.
In other words, as an API client, when I submit a payload containing key, and it is incorrect, I don't expect to receive validation errors referring to a different property Key. I didn't send that and I should not be expected to map it back to the key name I sent to make sense of it.
For Javascript apps running in a browser, Javascript property lookups are case sensitive. Doing case-insensitive lookups is not trivial nor very performant.
And it shouldn't be necessary either if this issue is fixed.

Have to agree this is really an issue. It shouldn't be hard to fix.

authors: MaikuMori ajsebas bryjshed dougbu johnathan-walker nil4


text:
Add ViewBag to PageModel

In Razor Pages, I noticed that I can't use ViewBag within my class, but I can use it in a view! I do prefer ViewBag over ViewData. Is there something I'm doing wrong? How to get ViewBag back?

Seems like we missed adding the property to PageModel. For the time being, you should be able to create a custom BasePageModel type with a ViewBag property. Here's the relevant code from Controller: https://github.com/aspnet/Mvc/blob/dev/src/Microsoft.AspNetCore.Mvc.ViewFeatures/Controller.cs#L85-L96

@pranavkm  Thanks, this workaround works just perfectly. Would appreciate if it would be out-of-the-box!

We purposefully didn't add ViewBag because I wanted to discourage its use. As @pranavkm points out you can add it back easily enough if you wish but I don't have plans to add it back to the built-in base class.

@DamianEdwards Could you please explain why you insist on discouraging its use?

Sure, sorry. ViewBag uses dynamic which in our testing introduces a measurable performance impact on the processing of pages or views that use it. As such, I'd rather it not be available by default. We could investigate a simpler mechanism to allow folks to re-enable it if they really wish, but the given workaround seems suitable.

Well, this is some one-side logic. Perhaps you're telling about high-traffic web sites whose workload is on peek, but as to simple sites this is perfectly acceptable. Moreover, don't forget that typing and reading ViewBag properties is leaner rather ViewData ones.

I try to avoid ViewData as much as possible too, limiting to use only for passing values between pages/views and layouts for example. In the future we hope to create features to remove the need for that too. Given Razor Pages is an opportunity to "reset" the first-level concepts and features, we decided to leave out ViewBag as discussed.

Well, it's a pity it won't be included anymore. I hope with C# 8 "extension everything" I won't have to subclass PageModel and will attach ViewBag directly to it.

@DamianEdwards
But I still don't understand.

View has ViewBag
PageModel doesn't have ViewBag.
@pranavkm says "Seems like we missed adding the property to PageModel".
You say "we decided to leave out ViewBag as discussed".
So:
You missed it or it was intention?
What's the point of having it in View but not having in PageModel?
I really don't understand why excluding it? Let me re-iterate myself: if one doesn't need it, he won't use it.
If Razor Pages is a "reset" (as you say), then why there's still no other mechanism?

I made the call to exclude it, @pranavkm mis-remembered or wasn't aware of that. I've already answered everything else. Sometimes folks will disagree. You can use ViewData to pass data from the PageModel or the Page to the configured layout page, but beyond that one should be using model properties. You can add ViewBag back by sub-classing PageModel and/or the page base class.

OK. Thanks for explanations.

Why do you need it? To pass state to the layout page?

@davidfowl Yes. @DamianEdwards mentioned that "in the future we hope to create features to remove the need for that too". So, I asked him why there's still no alternative mechanism, but got no answer. And if you get rid of ViewBag, then remove it from View so not to confuse people.

Considering that the page model is already the model for the view, it’s super simple to add additional properties that you can then access in the view. Just add properties to the page model, and you can already access them in the view. And they are strongly typed which is much better than view data anyway.
The same is not true for MVC where you explicitly have to pass a model to the view. So view data there has a little more use.
The primary reason why it’s there in MVC is likely compatibility with classic ASP.NET though. Razor pages not being a part of earlier ASP.NET versions makes for a good opportunity to deprecate view data (by not exposing the ViewBag). There are many differences between Razor pages and controllers, so I don’t see how one having X should mean that the other has X too, as long as you can still solve the same problems.

For 2.1.0, we also have support properties annotated with ViewDataAttribute in both controllers and Razor Page models. We recommend using it over using ViewData or ViewBag.
Closing since it doesn't look like there's any further discussion to be had here.

authors: DamianEdwards JohnyL davidfowl poke pranavkm


text:
Model Binding, complex type binder: it is impossible to create  property list at run time.

Asp Core 2.
Use case: I have a meta model (as a class that at runtime has static instance) where it is described which fields are editable that means should be binded in MVC Controller. So I want to generate property list at run-time. When Asp.Core MVC standard binding model provides me only one possibility: to use BindAttribute.
My plan would be inherit from ComplexTypeModelBinder, setup it with static (means created at runtime property list) and override CanBindProperty for specific action.
public class GroupsController
    {
        #region Meta
        static ControllerMeta<Group, int?> meta = new ControllerMeta<Group, int?>(/* ... */);

        class CreateFieldsModelBinder : FieldsModelBinder<Group>
        {
            public CreateFieldsModelBinder(IModelMetadataProvider metadataProvider) : base(metadataProvider, meta.CreateBindedFields) { }
        }

        class EditFieldsModelBinder : FieldsModelBinder<Group>
        {
            public EditFieldsModelBinder(IModelMetadataProvider metadataProvider) : base(metadataProvider, meta.CreateBindedFields) { }
        }
        #endregion

        public async Task<IActionResult> Create()
        {
            // ...
        }

        [HttpPost, ValidateAntiForgeryToken]
        public async Task<IActionResult> Create([ModelBinder(typeof(CreateFieldsModelBinder))] Group entity)
        {
            // ...
        }

        public async Task<IActionResult> Edit(int? id)
        {
            // ...
        }

        [HttpPost, ValidateAntiForgeryToken]
        public async Task<IActionResult> Edit([ModelBinder(typeof(EditFieldsModelBinder))] Group entity)
        {
            // ...
        }
    }

There FieldsModelBinder could be inherited from ComplexTypeModelBinder.
What is worst: there are no easy way to  inherit class from ComplexTypeModelBinder since its constructor accepts IModelMetadataProvider which is not easy to construct without PRIVATE DefaultModelBinderProviderContext. May be it is possible to skip DefaultModelBinderProviderContext  , but that means solution will skip binder cache and will be extremely ineffective.
P.S. I even do not understand how to create my own ComplexTypeModelBinder that can be used in place with ModelBinder without inheriting ComplexTypeModelBinder since it is not clear how to accept all registered binders for concrete simple type.

@rpokrovskij , model binders are created by model binder providers that pass them the right data. On my blog I have a complete series of post on how to build model binders. The one below is about inheriting from the complex model binder: http://www.dotnet-programming.com/post/2017/03/17/Custom-Model-Binding-in-Aspnet-Core-2-Model-Binding-Interfaces.aspx

@frankabbruzzese I have started from your articles.
But I do not need providers, because in my use case "generate binder from model" I know exactly where to use my custom binder (one light binder per action) - so point it in the attribute is enough. What I need form mvc binding infratructure is to access to simple types "bindings/converters" (string -> datetime) .
Also I can't understand should I use the  EnterNestedScope or not. I'm not understand it role.
Here I just stopped trying to understand how to get the registered simple types "bindings/converters"
    public class FieldsModelBinder<T> : IModelBinder
    {
        private readonly Dictionary<string, Action<T,string>> propertyBinders;
        private readonly Func<T> constructor;

        public FieldsModelBinder(Func<T> constructor, Dictionary<string, Action<T, string>> propertyBinders)
        {
            this.constructor = constructor;
            this.propertyBinders = propertyBinders;
        }

        public Task BindModelAsync(ModelBindingContext bindingContext)
        {
            T t = constructor();
            foreach (var pair in propertyBinders)
            {
                var propertyName = pair.Key;
                var valueProvider = bindingContext.ValueProvider;
                var propertyValueProviderResult = valueProvider.GetValue(propertyName);
                if (propertyValueProviderResult == ValueProviderResult.None)
                {
                    bindingContext.Result = ModelBindingResult.Failed();
                    return Task.CompletedTask;
                }
                else
                {
                    var value = propertyValueProviderResult.FirstValue;
                    var action = pair.Value;
                    action(t, value);
                }
            }
            bindingContext.Result = ModelBindingResult.Success(t);
            return Task.CompletedTask;
        }
    }

Usage:

public class GroupsController : RoutineController
    {
        #region Meta
        static ControllerMeta<Group, int?> meta = new ControllerMeta<Group, int?>(
              // options how to configure meta
        );

        class CreateFieldsModelBinder : FieldsModelBinder<Group>
        {
            public CreateFieldsModelBinder(IModelMetadataProvider metadataProvider) : base(
                metadataProvider, meta.Constructor, meta.CreateBindedFields) { }
        }

        class EditFieldsModelBinder : FieldsModelBinder<Group>
        {
            public EditFieldsModelBinder(IModelMetadataProvider metadataProvider) : base(
                metadataProvider, meta.Constructor, meta.EditBindedFields) { }
        }
        #endregion

        CrudRoutineControllerConsumer<Group, int?> consumer;
        public GroupsController(IConfigurationRoot  configurationRoot) :base(configurationRoot)
        {
            consumer = new CrudRoutineControllerConsumer<Group, int?>(this, meta, (action, userContext) => userContext.HasPrivilege(Privilege.ConfigureSystem));
        }

        public async Task<IActionResult> Create()
        {
            // ...
        }

        [HttpPost, ValidateAntiForgeryToken]
        public async Task<IActionResult> Create([ModelBinder(typeof(CreateFieldsModelBinder))] Group entity)
        {
            // ...
        }

        public async Task<IActionResult> Edit(int? id)
        {
            // ...
        }

        [HttpPost, ValidateAntiForgeryToken]
        public async Task<IActionResult> Edit([ModelBinder(typeof(EditFieldsModelBinder))] Group entity)
        {
            // ...
        }
    }

You wrote "Create a meta data provider"... and register it globally and provide to it global meta model... So the architecture pushes me to register each peace of functionality globally (even if it can be accessed from the BI it is still global and only because it should work with MVC bindings model).
And it is not easy how you wrote, I spend several days even to understand most of what you are talking and writing, but still do no understand how to get default simple type binders inside the  IModelBinder.BindModelAsync  method (having defaul modelBindingContext and modelMetadataProvider that was get on BI). From code I see that they exists somewhere in DefaultModelBinderProvider cache.   Either I can't evaluate is it compex or not to implement my own IMetadataProvider (there are no samples in the internet, actually even your most comprehensive articles are not going so far).

In this custom complex model binder I create a nested scope to pass it a custom metadata provider:
https://github.com/MvcControlsToolkit/MvcControlsToolkit.Core/blob/master/src/MvcControlsToolkit.Core/ModelBinding/TransformationModelBinder.cs
Give a look to the code near .EnterNestedScope. You can't call directly another model binder, but you may invoke the whole model binding process on custom data and providers, then the framework creates the right contexts an invoke model binders properly.
Th code of the custom meta data provider is here:
https://github.com/MvcControlsToolkit/MvcControlsToolkit.Core/blob/master/src/MvcControlsToolkit.Core/ModelBinding/DiffMetaData.cs
It extracts all property of a subclass that are not contained in its superclass. You may modify it to fulfill your needs.

@frankabbruzzese thank you, you are great. But I should say it is too much for me. To get this working  developer should become an ASP Model Binding guru (second after you, without a chance to be a first). I do not have such ambitions. Since  my goal is generate controllers from meta I  have a possibility to popup an entity from http request directly in method. It will be 100 times quicker (both developing and performance of the solution).

Thank you, @frankabbruzzese for your effort here.
@rpokrovskij, do you have any specific proposal here?

@mkArtakMSFT my proposals are 1) to provide a sample with @frankabbruzzese proposed solution. it is a real case, there is nothing very specific  "to create Binded properties list" run time. But it is too complex to try explain it in words "go and implement your own IMetadataProvider " (where there are no samples of it).
What about solution specific to me: since I understand that controller generation runtime do not need to use model binding at all and can parse form data directly I went this way; but still would be nice to have possibility 2) to get default primitive type parser (registered in model binding system). I didn't found the easy possibility to get e.g. default datetime binder parser method.

authors: frankabbruzzese mkArtakMSFT rpokrovskij


text:
Support for optional attribute in partial taghelper

It would be neat if we can have the ability to optionally render a partial (similar to sections) either optionally or with a fallback. This is useful for libraries packing UI to allow easier composition with applications.
For example, a library could do something like
<partial name="./_LoginPartial.cshtml" fallback="_LoginPartial /> to indicate:
Try and render that view from the main app or use the fallback if not found.
Similarly this allows UI in libraries to define "gaps" in pages/views that the consuming app can use.
/cc: @DamianEdwards

This is a valid ask and we should consider it for the future releases.

Fixed in https://github.com/aspnet/Mvc/commit/dc2ae93c3f37ff7f44c2d09f68065b19db6a3245

authors: javiercn mkArtakMSFT pranavkm


text:
Parse LanguageVersion correctly

Porting over https://github.com/aspnet/Mvc/commit/eb5c23ea8e3542fe537ffef8ca419a315b60dbbb

Can you retarget this to the rel/2.0.1 branch before merging?

Done. @Eilon would you like to take a look at this before this goes in?

authors: natemcmaster pranavkm