text:
Update quickgrid.md

Update the QuickGrid implementation directions that the generic type parameter must be a class and not a record type.
I found that implementing a QuickGrid with a record type rather than a class caused some broken behaviors.

Internal previews

📄 File
🔗 Preview link

aspnetcore/blazor/components/quickgrid.md
ASP.NET Core Blazor QuickGrid component

Thanks @dsschnau!
I'll ask Mackinnon on the product unit to take a quick look.

A record type is really just a class that desugars

Records are just syntax sugar for classes that encapsulate some data and emulate value equality (among some other things that I doubt have any impact on QuickGrid functionality). I don't think QuickGrid relies on any specific kind of equality semantics for the TGridItem, so I'm not sure why using a record would make any difference.
@dsschnau, could you please clarify what broken behavior you're seeing when using records? Thanks!

Will do, thank you!
On Fri, Jun 7, 2024 at 7:10 AM Luke Latham @.***> wrote:

@dsschnau https://github.com/dsschnau ... Let's move this to a PU issue
so that it can be discussed with the engineers to see how record use is a
problem. If it's a problem, it could be scheduled for a fix, which would
mean perhaps versioned doc changes. If there's something that permanently
makes records a poor choice, then we'd go a bit further than this perhaps
and say what the problem is.
Open an issue for the PU here ...
https://github.com/dotnet/aspnetcore/issues
Please add ...
cc: @guardrex https://github.com/dotnet/AspNetCore.Docs/pull/32757
... to the bottom of your opening comment so that I can follow along. I'll
open an issue if it turns out that we need guidance, and you can submit the
PR later if you wish after the docs issue is opened.
—
Reply to this email directly, view it on GitHub
https://github.com/dotnet/AspNetCore.Docs/pull/32757#issuecomment-2154617699,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAKPJEP3CAEQAOV6LA3J5RLZGGIMFAVCNFSM6AAAAABI46XILWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJUGYYTONRZHE
.
You are receiving this because you were mentioned.Message ID:
@.***>

authors: MackinnonBuck dsschnau guardrex


text:
[Blazor] Performance - Event callbacks in RenderFragments

I'm not sure what was meant by "event callbacks aren't supported" in this context.
This code with event callback works as expected:
@page "/counter"
@using Microsoft.Extensions.Logging
@inject ILogger<Counter> Logger

@MyRenderFragment

@code {
	private RenderFragment? MyRenderFragment => @<button @onclick="HandleValidSubmit">Submit</button>;

	private void HandleValidSubmit()
	{
		Logger.LogInformation("HandleValidSubmit called");
	}
}

(Don't worry, this is my last PR for today. 😇)

Internal previews

📄 File
🔗 Preview link

aspnetcore/blazor/performance.md
ASP.NET Core Blazor performance best practices

I don't think that's what this means. Doesn't it mean that you can't pass the event callback to the render fragment?

The code is a little bit obscure, but still works:
@page "/counter"
@using Microsoft.AspNetCore.Components.Forms
@using Microsoft.Extensions.Logging
@inject ILogger<Counter> Logger

@MyRenderFragment(EventCallback.Factory.Create(this, HandleValidSubmit))

@code {
	private RenderFragment<EventCallback>? MyRenderFragment => callback => @<button @onclick="callback">Submit</button>;

	private void HandleValidSubmit()
	{
		Logger.LogInformation("HandleValidSubmit called");
	}
}

Yes, that was more along the lines of what I was thinking.
What about this being a point-in-time remark? Can you check that in a 3.1 app and see if it works that far back?

🤯🙄🤣
Unfortunately, I don't have that old runtime/SDK installed on my machine, and I’d rather not clutter my system with it right now :-D.
I tested it on .NET 6, and it works fine there.
Are there any online Blazor fiddles that support 3.1?
Hope you drop those ancient unsupported versions soon. 🙏

Me neither! I think I can go back to 5.0 ... that's it. 😄
If I have 5.0, I'll try it tomorrow on 5.0 and report back.

Hope you drop those ancient unsupported versions soon.

No 🎲🎲 ... By Microsoft decree, we're required to keep ALL prior versions of docs forever. What we might end up implementing later is Version-by-file versioning, where each version of an article is in a separate file. That would cut out all of this moniker-range flipping insanity.

By Microsoft decree, we're required to keep ALL prior versions of docs forever.

You can keep it, but don’t let it interfere with updates to the supported version docs. My suggestion is to keep a separate snapshot of documentation for those old versions (separate from the "live" doc sources) and focus on maintaining, updating, and improving only the supported versions.

It's already interfering IMO 😄. Management has decided that they want all of the old content live. They have no capacity with the current system to separate the content, and they won't allow snapshots (e.g., PDFs) to be the docs for prior releases, supported or out-of-support. Our hands are tied on it at this level. The only thing we have is moniker-range, and that breaks cross-links to headings in prior release content. I've been screaming for five years to give us Version-by-file. There's interest in it, but I still don't see the wheels of progress turning.

focus on maintaining, updating, and improving only the supported versions.

That's kind'a the way that the main doc set is maintained ... not Blazor tho ... not yet and not while I'm here. I maintain all versions of Blazor as best I can. It's tough 😩, but I'm hanging in there.

I'm surprised to see that I have 3.1 on this machine.
Yes, both of the examples run fine under 3.1. Let's proceed with this update! 🎉

source: gharchive/pull-request

authors: guardrex hakenr

license_type: permissive

license_source: github-api


text:
Updated ELMAH links to the new website

ELMAH hasn't been on Google Code since that was shut down. Maybe link to the new website instead since not all deep links for the old website works.

@ThomasArdal  we have you at the top of the list at https://docs.microsoft.com/en-us/aspnet/core/fundamentals/logging/?view=aspnetcore-6.0#third-party-logging-providers
I should add some in our products to:

authors: Rick-Anderson ThomasArdal

repo: dotnet/AspNetDocs


text:
Update relationships.md

Hi 👋
I noticed this word was missing when reading the docs, so I thought I'd add it.

@NielsPilgaard can you please accept the CLA by commenting "@dotnet-policy-service agree"?

@dotnet-policy-service agree

Thanks!

Sure thing!

authors: NielsPilgaard ajcvickers roji


text:
Implement SqlGeography and SqlGeometry for Spatial Types support for .Net Core

Cannot run Microsoft.SqlServer.Types because \Microsoft.SqlServer.Server\IBinarySerialize.cs is missing in System.Data.
Since no source code is available, and contact owners on nuget yields a HTTP-500, I'm opening an issue here.  I'd like to compute a polygon union...
#if false
namespace AnySqlWebAdmin
{
    public class GeoPoint
    {
        public decimal Lat;
        public decimal Long;
        public GeoPoint(decimal latitude, decimal longitude)
        {
            this.Lat = latitude;
            this.Long = longitude;
        }
        public GeoPoint() : this(0,0) { }
        public override string ToString()
        {
            return this.Lat.ToString(System.Globalization.CultureInfo.InvariantCulture)
                + " "
                + this.Long.ToString(System.Globalization.CultureInfo.InvariantCulture);
        }
    }
    public class GeographicOperations
    {
        public static string ObjJoin(string separator, params object[] objs)
        {
            string result = null;
            System.Text.StringBuilder sb = new System.Text.StringBuilder();

            bool isNotFirst = false;

            for (int i = 0; i < objs.Length; ++i)
            {
                if (objs[i] == null)
                    continue;
                if (separator != null && isNotFirst)
                {
                    sb.Append(separator);
                }
                else
                    isNotFirst = true;

                if(objs[i] != null)
                    sb.Append(objs[i].ToString());
            }

            result = sb.ToString();
            sb.Clear();
            sb = null;

            return result;
        }
        // geography::STPolyFromText('POLYGON((9.3763619 47.4330074,9.3764389 47.4329684,9.3764072 47.4329405,9.3763969 47.4329322,9.3759864 47.4326004,9.376056 47.4325644,9.3761349 47.4325167,9.37619 47.4325653,9.376312 47.4326732,9.3765907 47.4328683,9.3766389 47.4328521,9.3767794 47.4329452,9.3764748 47.4331106,9.3763619 47.4330074))', 4326)
        // geography::STPolyFromText('POLYGON((9.3766833 47.4319973,9.3772045 47.4324131,9.3771257 47.432459,9.3769959 47.4323535,9.3767225 47.4325076,9.3768938 47.432637,9.3769843 47.4325975,9.3772713 47.432826,9.3771862 47.4328789,9.376941 47.4326789,9.3767283 47.4327757,9.3765053 47.4325749,9.376312 47.4326732,9.37619 47.4325653,9.3761349 47.4325167,9.376056 47.4325644,9.3757946 47.43237,9.3760399 47.4322419,9.376144 47.4323272,9.3761809 47.4323125,9.3762975 47.432428,9.3762371 47.4324602,9.3763095 47.4325246,9.3764699 47.4324328,9.3763633 47.4323437,9.3763976 47.4323193,9.3763247 47.4322628,9.3763972 47.4322251,9.3764363 47.4322061,9.3766528 47.4323718,9.3768611 47.4322514,9.3765976 47.4320409,9.3766833 47.4319973))', 4326)

        public static Microsoft.SqlServer.Types.SqlGeography ToPolygon(string text)
        {
            // text = @"POLYGON((-122.358 47.653, -122.348 47.649, -122.348 47.658, -122.358 47.658, -122.358 47.653))";
            System.Data.SqlTypes.SqlChars polygon = new System.Data.SqlTypes.SqlChars(new System.Data.SqlTypes.SqlString(text));
            Microsoft.SqlServer.Types.SqlGeography poly = Microsoft.SqlServer.Types.SqlGeography.STMPolyFromText(polygon, 4326);
            return poly;
        }

        public static Microsoft.SqlServer.Types.SqlGeography ToPolygon(GeoPoint[] points)
        {
            string pointText = ObjJoin(", ", points);
            string text = "POLYGON((" + pointText + "))";

            Microsoft.SqlServer.Types.SqlGeography poly = ToPolygon(text);
            return poly;
        }

        public static void Test()
        {
            // DECLARE @Geom TABLE ( shape geometry );
            // SELECT geometry::UnionAggregate(shape).ToString() FROM @Geom;
            // geometry ST_Union(geometry[] g1_array);
            // https://docs.microsoft.com/en-us/sql/t-sql/spatial-geometry/unionaggregate-geometry-data-type?view=sql-server-2017
            // https://gis.stackexchange.com/questions/237644/what-does-the-st-union-of-the-geometry-column-of-two-tables-produce

            GeoPoint[] points = new GeoPoint[]
            {
                  new GeoPoint(0,0)
                , new GeoPoint(0,0)
                , new GeoPoint(0,0)
                , new GeoPoint(0,0)
                , new GeoPoint(0,0)
            };

            string s1 = "POLYGON((9.3763619 47.4330074,9.3764389 47.4329684,9.3764072 47.4329405,9.3763969 47.4329322,9.3759864 47.4326004,9.376056 47.4325644,9.3761349 47.4325167,9.37619 47.4325653,9.376312 47.4326732,9.3765907 47.4328683,9.3766389 47.4328521,9.3767794 47.4329452,9.3764748 47.4331106,9.3763619 47.4330074))";
            string s2 = "POLYGON((9.3766833 47.4319973,9.3772045 47.4324131,9.3771257 47.432459,9.3769959 47.4323535,9.3767225 47.4325076,9.3768938 47.432637,9.3769843 47.4325975,9.3772713 47.432826,9.3771862 47.4328789,9.376941 47.4326789,9.3767283 47.4327757,9.3765053 47.4325749,9.376312 47.4326732,9.37619 47.4325653,9.3761349 47.4325167,9.376056 47.4325644,9.3757946 47.43237,9.3760399 47.4322419,9.376144 47.4323272,9.3761809 47.4323125,9.3762975 47.432428,9.3762371 47.4324602,9.3763095 47.4325246,9.3764699 47.4324328,9.3763633 47.4323437,9.3763976 47.4323193,9.3763247 47.4322628,9.3763972 47.4322251,9.3764363 47.4322061,9.3766528 47.4323718,9.3768611 47.4322514,9.3765976 47.4320409,9.3766833 47.4319973))'";

            // ST_GeomFromText(text WKT, integer srid);
            // ST_Union, ST_AsText
            // ST_GeomFromText('POINT(-2 3)') ) )
            // ST_Intersects( geography geogA , geography geogB )

            // Could not load Microsoft.SqlServer.Server

            Microsoft.SqlServer.Types.SqlGeography poly1 = ToPolygon(s1); // points);
            Microsoft.SqlServer.Types.SqlGeography poly2 = ToPolygon(s2); // points);

            Microsoft.SqlServer.Types.SqlGeography poly3 = poly1.STUnion(poly2);
            System.Data.SqlTypes.SqlChars chars = poly3.STAsText();
            string value = new string(chars.Value);
            System.Console.WriteLine(value);
        }
    }
}
#endif

And while you are at it, the version for the full .NET framwork (core also) should also work if SQL-Server is not installed on the machine that Microsoft.SqlServer.Types is executed on...

@David-Engel just wanted to give you the heads up on why I moved this issue here. I understand that technically Microsoft.SqlServer.Types isn't a component of SqlClient, and that the SqlClient team doesn't own it, but from the customer perspective, these types are part of the functionality offered by SqlClient.
I will continue to talk to the owners on SQL Server about the priority of enabling this. But we need an issue to track it somewhere and I believe it belongs here more than on CoreFx.

I just want to add that we also have an API that is heavily using the GetSchemaTable reader function, to retrieve the metadata from the reader and process it after.
It is crashing as well because it is not able to locate the Microsoft.SqlServer.Types DLL, when a reader has a column of the type geometry, geography or hierarchy. It will be nice if it gets supported.
It will be nice to have this fixed so we can move to .NET Core.

Would this issue also cover implementing the SqlHierarchyId type for .NET Core, or should I enter a separate issue for that?

@Ansssss: I'm no expert on the subject, but the thing is SqlGeography & SqlGeometry use a native library, which is closed-source and windows-only.
HierarchyId is just a CLR-type, and it probaby does not use native libraries, or at least I couldn't fathom why it possibly would. So I would create a separate issue for that.

When trying to use SqlGeometry (SqlGeograpy or HiearchyId) with the new Microsoft.Data.SqlClient i get the following error:
Unhandled Exception: System.ArgumentException: Specified type is not registered on the target server.Microsoft.SqlServer.Types.SqlGeography, Microsoft.SqlServer.Types, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91.
even if I can see that I have that library in my SQL Server assemblies (select * from sys.assemblies)

Those types will not work with new client without rebuild against new provider as they use types from old one.
If  dotMorten.Microsoft.SqlServer.Types implementation will be enough for your cases, you can rebuild it against new provider or  give your vote here to release it for new provider.

Hello.
Almost a year later, any news about spatial data types for .net core ?
We are rebuilding a existing project (in .net core) from scratch because the architecture was crap and the question remain.  What about spatial data.  In the previous version, they used Entity Framework Core but that tool does not support them either... So we had (we maintained that previous version for a while) to use Net Topology Suite.
In the new version, we won't use Entity Framework but we still need spatial data types though...

You can use: https://github.com/dotMorten/Microsoft.SqlServer.Types

@ErikEJ : I've seen that library but it does not include any spatial operation.  Currently, it might be enough but for the future, I can't be sure that we won't need to perform spatial operation in memory.  But I just read about .Net 5 coming soon.  As it merge .Net Core and .Net Framework, will it solve this problem ?

No, those types are not a part of .net 5

Ok will the librairy Microsoft.SqlServer.Types be usable ?  If yes, then it's ok...

Of course it will, it is a netstandrad 2 library

Oh !?  I thought I read in this thread that this precise library was not compatible with .Net Standard.

https://www.nuget.org/packages/dotMorten.Microsoft.SqlServer.Types/ is a netstandard2.0 project
https://www.nuget.org/packages/Microsoft.SqlServer.Types/14.0.1016.290 is a net40 project and might be usable under several constraint:

only windows
for .net core you should use at least 3.1.8 due to a memory leak in previous versions https://github.com/dotnet/coreclr/pull/28074
I had to explicitly reference System.Data.SqlClient exactly version 4.8.2

Otherwise I got Could not load file or assembly 'System.Data.SqlClient, Version=0.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.

When trying to use SqlGeometry (SqlGeograpy or HiearchyId) with the new Microsoft.Data.SqlClient i get the following error:
Unhandled Exception: System.ArgumentException: Specified type is not registered on the target server.Microsoft.SqlServer.Types.SqlGeography, Microsoft.SqlServer.Types, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91.

even if I can see that I have that library in my SQL Server assemblies (select * from sys.assemblies)

Have you or anyonr found the solution of this issue ? I am facing the same error while adding SQLGeography type as command.parameter
 command.Parameters.Add(new SqlParameter("@deviceGeolocation", SqlDbType.Udt)                     {                         UdtTypeName = "Geography",                         Value = geo,                     });

Another issue with dotMorten/Microsoft.SqlServer.Types (aside from the missing implementations of certain spatial operations) is that it is based on System.Data.SqlClient and does not support Microsoft.Data.SqlClient.
This has cost us a huge amount of developer time and we still don't have a good solution. We really need a .Net Standard cross-platform implementation compatible with Microsoft.Data.SqlClient.

@Ozzah: What spatial operations do you need ?
I needed area, distance, polygon-union and multipolygon-union.
I was able to do distance & area with DotSpatial.Projections, and Unions with NetTopologySuite.
Multipolygons required implementing a Concave-Hull-Algorithm in NetTopologySuite myselfs.
https://github.com/ststeiger/OsmPolygon/blob/master/OsmPolygon/Concave/ConcaveHull.cs

I am using EF 6.3 with .NET Core and want to use spatial types on a Linux machine with SQL Server. Is https://github.com/dotMorten/Microsoft.SqlServer.Types my only option right now? I am a little confused about what NetTopologySuite.IO.SqlServerBytes is. Can I use it in my case? I would prefer an official solution.

It's very frustrating that multiple versions of the Framework have been released and there has been no movement on this issue in nearly 3 years; I just need to call FillSchema on a SqlDataAdapter for a table that has a Geography column...

@failwyn
This issue is also out of bounds for us, as commented here:
https://github.com/dotnet/SqlClient/issues/322#issuecomment-810516964 | https://github.com/dotnet/SqlClient/issues/322#issuecomment-810577349
All I can say is efforts are in progress  to resolve these gaps, but timelines are currently not known.

Thanks @cheenamalhotra, is there a more appropriate place to have this bug logged so that the community can communicate with the proper team? I just find it amazing that such a simple, yet integral piece of functionality, has been left out for so long...

A workaround I am using at the moment is to modify my SQL query and cast it as binary (varchar) like so:
SELECT
    geometryColumn.STAsBinary() AS [geometryColumn],
    geographyColumn.STAsBinary() AS [geographyColumn]

I then use GeoJSON.Net to parse it from binary representation into usable data structures. For INSERT/UPDATE, I do much the same thing except serialise the GeoJSON object as binary and cast it in back to the spatial type in the query.
Honestly, getting the Microsoft version to work across .Net Framework and Core versions, and getting the dotMorten package to work across both System.Data.SqlClient and Microsoft.Client.SqlClient was such a headache. This workaround works well for me for the time being.

We are also facing similar issue with .Net Core and .Net Standard projects that we have at our end. Can anyone please let me know when the proper package or solution will be provided regarding this?

Just use NetTopologySuite.
Package for reading/writing geometry: https://github.com/NetTopologySuite/NetTopologySuite.IO.SqlServerBytes
Works with System.Data.SqlClient and Microsoft.Data.SqlClient.
The suite includes all necessary spatial operations and data conversion packages.
For example, if you want to convert geometry to GeoJSON, read it with SqlServerBytesReader, get the Geometry object and write it with GeoJSON serializer: https://github.com/NetTopologySuite/NetTopologySuite.IO.GeoJSON.
Be careful. Some SqlClient methods can produce exceptions with Microsoft.SqlServer.Types.dll if you are trying to access the geometry column. For example, GetSqlValue will throw: Could not load file or assembly Microsoft.SqlServer.Types.

I was using dotMorten/Microsoft.SqlServer.Types for a time, but ran into the issue with it using System.Data.SqlClient. In the pull requests I saw this one Use Microsoft.Data.SqlClient 2.1.0 #58. I was able to pull that down and build it, then statically link the dll. It seems to be working enough that I can pump sqlGeography types into dapper.
https://github.com/ErikEJ/Microsoft.SqlServer.Types/tree/mds-package

@cl0ckt0wer @dotMorten FYI!

@cl0ckt0wer Reach out to @dotMorten via the related GitHub issues the PR fixes

I have seen that the SQL Server team now have a preview of a newer version of Microsoft.SqlServer.Types that is now compatible with .NET Standard 2.1 ( https://www.nuget.org/packages/Microsoft.SqlServer.Types/160.900.6-rc0)).
Are there plans to update System.Data.SqlClient or will this only be supported in Microsoft.Data.SqlClient?

@stevetalkscode Not really that great. There's a runtimes folder in there indicating it still only supports Windows x86 and x64. No ARM64 support, nor ios, android, macos or linux support.

I did a quick proof of concept using @ErikEJ's latest RC package (see https://github.com/ErikEJ/EntityFramework6PowerTools/issues/103)  and using the SqlTypes 16 RC in a .NET 6 console app running on WSL and got a DbGeography written to a SQL database which would normally fail (with the could not load DLL error)

@stevetalkscode I decompiled the library and I still see a large amount of calls into native code for lots of spatial operations. The serialize/deserialize is all in managed code, so that should just work as you found.  Try for instance calling BufferWithCurves on WSL and I'll bet it'll fail.

@dotMorten But an Improvement on Windows where you got the error in the OP until now.

@stevetalkscode I decompiled the library and I still see a large amount of calls into native code for lots of spatial operations. The serialize/deserialize is all in managed code, so that should just work as you found. Try for instance calling BufferWithCurves on WSL and I'll bet it'll fail.
It they were to target .NET6 instead of netstandard2.1, they could use the SupportedOSPlatformAttribute to flag those set of methods as Windows-only.

Fair point. I hadn't got as far as testing those bits yet.

Are there plans to update System.Data.SqlClient or will this only be supported in Microsoft.Data.SqlClient?

System.Data.SqlClient is in strict maintenance mode. It's not receiving any feature updates.

Is this actually complete? Last I checked this only works on x86 and x64 Windows

Supporting only Windows is yet another example of why .NET fails to get some love on UNIXy platforms, marketing message is everything is cross platform in modern .NET, yet when we dive into the details there are hurdles like in this case.

@Wraith2 @cheenamalhotra Guys, is there any plans to support SqlGeometry/SqlGeography on Linux? I think lot of folks would like to know if its even planned..

I have no plans to contribute in this area. The sort of response above from @ststeiger illustrates why.
If someone else wanted to work on integrating @dotMorten 's open source geopgraphy stuff instead of relying on the closed source windows-only implementation that the sql server team (note: not the team that works on sql client and you see posting in this repo) maintains, then I'd be happy to help. I just have no need for the api personally and no need to expose myself to harmful toxicity.

@dmytro-gokun Have you tested on Linux and what is not working for you?

@ErikEJ Methods like STContains(), STArea() etc

@Wraith2 I understand.
I would be happy to help. The problem is that we would need access to that closed source in order to implement it in 100% compatible way. I guess, no one want STContains() which work differently on Windows & Linux. Do you think there is any chance we can get hold of that source code?

Do you think there is any chance we can get hold of that source code?

No

@ErikEJ I see. Then i do not think i will be able to help. Reverse engineering C code or trying to guess what exact algorithms were used is not my favorite passtime :)
Does MS at least plan to have this ported to Linux at some point? I guess it would be fair to let community know what to (not) expect.

Does MS at least plan to have this ported to Linux at some point?

That was my impression it was in their plans.

@dotMorten Would be really nice if someone from MS has actually confirmed or denied this :)
@Kaur-Parminder Probably you could help here?

Is this actually complete? Last I checked this only works on x86 and x64 Windows, which isn't in the spirit of claiming .net core support. With .NET 6 running on mac, linux, ios and android, there's not really much benefit to this work until we have a proper crossplatform solution.
The nuget package explorer confirms it too with only runtimes supplied for 2 of the 3 Windows architectures and none for anything else:
It is in fact rather weird that the library claims to be netstandard2.1 instead of net5.0-windows which is what it really is.

The previous versions of sqlserver.types also had an "msvcr.dll" c++ runtime in these folders. Can anyone confirm if that is no longer needed? Thanks

source: gharchive/issue

authors: Ansssss David-Engel ErikEJ MaceWindu Ozzah Ramana2596 Wraith2 arnaudHerontrack cheenamalhotra cl0ckt0wer divega dmytro-gokun dotMorten failwyn jnyrup john-larson kolyanch maxmann74 pjmlp shailendrarampal stevetalkscode ststeiger tanbchr yorek

repo: dotnet/SqlClient

license: MIT


text:
426 Upgrade Required

Is there an existing issue for this?

[X] I have searched the existing issues

Describe the bug
When I try to reach my aspire dashboard on Azure I get 426 Upgrade Required. Previously (after some bugfixes on the side of the Aspire development team) it was working ok. Now "426 Upgrade Required" all the time. And I don't understand what kind of upgrade is required.
Expected Behavior
Dashboard opens
Steps To Reproduce

Have your code deployed to azure
Enable aspire dashboard
Try to reach it

Exceptions (if any)
426 Upgrade Required in the response of the dashboard request
.NET Version info
8.0
Anything else?
Aspire hosting libs version is 8.1.0

cc @snehapar9

now it works, thank you

authors: davidfowl relounge

repo: dotnet/aspire


text:
Make VolumeNameGenerator public

Is there an existing issue for this?

[x] I have searched the existing issues

Is your feature request related to a problem? Please describe the problem.
No response
Describe the solution you'd like
Please make the VolumeNameGenerator class public so that other 3rd party packages can use it. There is a lot of logic in there to generate a proper volume name. Why make 3rd party packages recreate that same logic?
Additional context
No response

Yes, this should be public.

Yes, this should be public.

I took a swag at this one.

done

authors: danmoseley davidfowl ejsmith los93sol


text:
Remove Azure SDK feed from nuget.config

Follow up from https://github.com/dotnet/aspire/pull/3271 which removed the alpha versions of these packages.
Microsoft Reviewers: Open in CodeFlow

/backport to release/8.0

/backport to release/8.0

This doesn't need to be backported to release/8.0 because it made it into release/8.0-preview5 in https://github.com/dotnet/aspire/pull/3325. And then release/8.0-preview5 was merged into release/8.0 with https://github.com/dotnet/aspire/pull/3312.

authors: eerhardt mitchdenny


text:
Capture CoreCLR ServiceHub dependencies in VSIX

Draft PR because the bits aren't there yet in VS from Roslyn or from ServiceHub

In preparation for running our Razor bits OOP in a CoreCLR hosted environment we need to separately capture our entire dependency graph and shove that graph into a specific location so that the CoreCLR servicehub host knows where to load various assemblies. This changeset effectively generates a ServiceHubCore folder in our VSIX that has everything needed to boot our ServiceHub bits in a CoreCLR based host.
Added a new ServiceHubCore64 json file to represent our hook into the servicehub world and utilize friend services to allow Roslyn to host us. Friend services also require cross-component sharing where we specific an AssemblySearchPathsConfig.json to indicate where ServiceHub can find our "friend" who has many of our dependencies (aka the ones removed).
Removed several common dependencies in our ServiceHub bits that will be guaranteed to be provided by the Roslyn host.
Created a new Microsoft.CodeAnalysis.Remote.Razor.CoreComponents project as a mechanism to capture all of our ServiceHub dependencies. This is effectively a hack to easily grab the dependency graph and to make it possible we make the project target netcoreapp3.1 and add a Program.Main to allow it to compile.
Found a typo where we weren't suffixing our ServiceHub json files in the vsixmanifest with .json.

Part of dotnet/aspnetcore#24476

@ryanbrandenburg You can find more info from ServiceHub wiki
https://devdiv.visualstudio.com/DevDiv/_wiki/wikis/DevDiv.wiki/1865/ServiceHub-(DevCore)

I have tested the change in this PR with latest dev17 int.preview, and it worked as expected.

To validate this change you will need to

build and deploy to roslyndev hive
run  <VSInstallPath>\Common7\IDE\VsRegEdit.exe set <VSInstallPath> RoslynDev HKCU "Roslyn\Internal\OnOff\Features" OOPCoreClr dword 1, and then start VS in roslyndev hive
replace the relative path in %localappdata%\Microsoft\VisualStudio\[roslyndev hive folder]\Extensions\Microsoft\Razor Language Services\42.42.42.4242424\ServiceHubCore\Microsoft.VisualStudio.Razor.TagHelperProvider.AssemblySearchPathsConfig.json, with a absolute path that points to Roslyn's servicehub core bits in your VS installation. (for example, it's E:\vs2022\Preview\Common7\IDE\CommonExtensions\Microsoft\ManagedLanguages\VBCSharp\LanguageServices\Core for me)

You should see

No servicehub error related to Razor's TagHelperProviderCore64
this result is non-null (i.e. we are getting result from OOP): https://github.com/dotnet/aspnetcore-tooling/blob/382e109a4c43f07d59a12f2da7d662e1643d732a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/OOPTagHelperResolver.cs#L75
check task mamanger to make sure Servicehub core host ([VS]\Common7\ServiceHub\Hosts\ServiceHub.Host.CoreCLR\ServiceHub.RoslynCodeAnalysisService.exe) is up and running.

authors: NTaylorMullen genlu

repo: dotnet/aspnetcore-tooling


text:
Broken Checksums Link on 2.0.7 Download Page

Checksums Link for 2.0.7 is broken
The checksums link on https://github.com/dotnet/core/blob/master/release-notes/download-archives/2.0.7-download.md displayed as Checksums_SDK that points to https://dotnetcli.blob.core.windows.net/dotnet/checksums/2.1.105-SDK-sha.txt is broken.

the SDK needed to be lower case:
https://dotnetcli.blob.core.windows.net/dotnet/checksums/2.1.105-sdk-sha.txt

repo: dotnet/core


text:
why certificates are null using .NET Core 2 but it works just fine with .NET Framework 4.6.2?

Issue Title
certificates are null using .NET Core 2
General
I have been doing some test migrating .NET Framework 4.6.2 apps to .NET Core 2. I noticed that this particular app, a monitoring http is not working fine with Net Core 2. Can you please help me to verify what is happening?
static void Main(string[] args)
{
            try
            {
                HttpWebRequest myhttpWebReqest = (HttpWebRequest)WebRequest.Create("https://www.google.com.mx/");
            System.Diagnostics.Stopwatch timer = new System.Diagnostics.Stopwatch();
            timer.Start();
            HttpWebResponse myHttpWebResponse = (HttpWebResponse)myhttpWebReqest.GetResponse();             timer.Stop();
            TimeSpan timeSpan = timer.Elapsed;
            Console.WriteLine(timeSpan.ToString());
            Console.WriteLine();
            Console.WriteLine(myHttpWebResponse.StatusCode);
            Console.WriteLine((int)myHttpWebResponse.StatusCode);
            Console.WriteLine();
            Console.WriteLine(myhttpWebReqest.ServicePoint.Certificate.GetEffectiveDateString());
            Console.WriteLine();
            Console.WriteLine(myhttpWebReqest.ServicePoint.Certificate.GetExpirationDateString());
            Console.WriteLine();
            Console.WriteLine(myhttpWebReqest.ServicePoint.Certificate.Issuer);
            Console.WriteLine();
            Console.WriteLine(myhttpWebReqest.ServicePoint.Certificate.Subject);
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex.Message);
            if(ex.InnerException !=null)
            {
                Console.WriteLine(ex.InnerException);
            }
        }
        Console.ReadLine();
    }
}
in the .NET Framework 4.6.2 i see the certificate data, in the .NET Core 2 i see myhttpWebReqest.ServicePoint.Certificate null ... do you know why?
you can see the same question in stack overflow here

@nguerrera @dougbu @anurse

@leecow This doesn't look ASP.NET related to me, it's referencing WebRequest. It looks like a corefx issue.

@karelz

Who may we contact?

authors: anurse leecow upixsoul


text:
Using 'app' as a sub domain breaks authentication cookie persistence

Using 'app' as a sub domain breaks authentication  cookie persistence
We found in both our production and test environments that using 'app.yourdomain.com' breaks authentication cookie persistence (especially when the application pool resets). When testing with other sub domain names like 'test.youdomain.com' authentication cookie persistence worked even after application pool reset.
General
DotNetCore Version:  2.2.5
Operating System: Windows Server 2019 (Version 1809)
Web Hosting: IIS v10.0.17763.1
Application Pool Settings:

.NET CLR Version: No Managed Code
Managed Pipeline Mode: Integrated

Steps to reproduce:
Scenario 1

Create dotnetcore web api application. In startup configuration specify that authentication expires some distance in the future measured in days.

services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)
    .AddCookie(options => {
        options.Events.OnRedirectToAccessDenied = ReplaceRedirector(HttpStatusCode.Forbidden, options.Events.OnRedirectToAccessDenied);
        options.Events.OnRedirectToLogin = ReplaceRedirector(HttpStatusCode.Unauthorized, options.Events.OnRedirectToLogin);
        options.Cookie.HttpOnly = true;
        options.Cookie.Expiration = TimeSpan.FromDays(150);
        options.Cookie.SameSite = SameSiteMode.None;
        // If the LoginPath isn't set, ASP.NET Core defaults
        // the path to /Account/Login.
        options.LoginPath = PathString.Empty;//"/account/login";
        // If the AccessDeniedPath isn't set, ASP.NET Core defaults
        // the path to /Account/AccessDenied.
        options.AccessDeniedPath = PathString.Empty;
        options.SlidingExpiration = true;
    });

In IIS create a website with "app" as it's sub-domain. (eg. app.contoso.com)
Execute a login on your web api with postman.
Confirm that the user is authenticated by accessing a protected api end-point.
Go to IIS stop and restart the site.
Try accessing the protected api end-point,
You should experience a not authenticated error and the authentication cookie will no longer work.

Scenario 2

Create a new website in IIS with a random sub-domain name (eg. test1.constoso.com) and copy the contents of the original site to the new location.
Repeat the steps 3 through 6 in scenario 1.
You should still be able to access the protected web api end-point and the authentication cookie will still work.

I am closing this issue here because it is more appropriate in the aspnetcore project.
For future lurkers see:
See: https://github.com/aspnet/AspNetCore/issues/11857


text:
Add BigInteger(string value) in System.Numerics

Hello,
I would like to initialize BigInteger instances with string values, like I'm used to from java.

Would you accept such an addition to the Framework?
In case you would, which project should I fork in order to create the patch?

Thank you in advance,
:panos

Like this?
https://msdn.microsoft.com/en-us/library/dd268231(v=vs.110).aspx

Yes! :+1:
I found it a few moments ago and I was about to close my issue :smile:

authors: PanosSakkos stephentoub


text:
Hash mismatch for debian-strech file dotnet-sdk-5.0.202-x64.deb on packages.microsoft.com

Our mirror-in of the microsoft-debian-stretch-prod repo on packages.microsoft.com fails with a hash mismatch of the pool/main/d/dotnet-sdk-5.0/dotnet-sdk-5.0.202-x64.deb file. This issue started some time between 2021-11-09 00:02:30 UTC and 2021-11-10 06:16:10 UTC.
I'm opening a bug here as I have no clue where else to report this issue. It would be great if packages.microsoft.com would contain a file with contact information.
Reproduction instructions:
Let's check what SHA-256 hash the file should have according to the package index:
$ curl -s https://packages.microsoft.com/repos/microsoft-debian-stretch-prod/dists/stretch/main/binary-amd64/Packages.gz | zgrep -C9 'Filename: .*/dotnet-sdk-5.0.202-x64.deb'

Package: dotnet-sdk-5.0
Priority: standard
Section: devel
Installed-Size: 222041
Maintainer: Microsoft <dotnetcore@microsoft.com>
Architecture: amd64
Version: 5.0.202-1
Depends: libc6 (>= 2.14), libgcc1 (>= 1:3.0), libstdc++6 (>= 4.4.0), dotnet-runtime-5.0 (>= 5.0.5), netstandard-targeting-pack-2.1 (>= 2.1.0), aspnetcore-runtime-5.0 (>= 5.0.5), dotnet-targeting-pack-5.0 (>= 5.0.0), aspnetcore-targeting-pack-5.0 (>= 5.0.0), dotnet-apphost-pack-5.0 (>= 5.0.5)
Filename: pool/main/d/dotnet-sdk-5.0/dotnet-sdk-5.0.202-x64.deb
Size: 57105162
MD5sum: 8c762eace12a55940a48779b274aa724
SHA1: 424e8a01467993046a4c3e9c24ef1ec93d6ffaf8
SHA256: d335eb918ad93d8d42090955e7859710a56279e3bbe3261ae387a40cb39d33c9
SHA512: 0a9ede2ed4f25f2d79700a2930553db22f891186f75969ad37ed55ea42c9bd2cf266959f600e0cc0288685e4b3a65a2b72905e75e770089f2dc76e238ecf3f14
Description: Microsoft .NET SDK 5.0.202
 .NET is a development platform that you can use to build command-line applications, microservices and modern websites. It is open source, cross-platform and is supported by Microsoft. We hope you enjoy using it! If you do, please consider joining the active community of developers that are contributing to the project on GitHub (https://github.com/dotnet/core). We happily accept issues and PRs.
Homepage: https://dotnet.github.io/core

So the expected SHA-256 hash of the file pool/main/d/dotnet-sdk-5.0/dotnet-sdk-5.0.202-x64.deb is d335eb918ad93d8d42090955e7859710a56279e3bbe3261ae387a40cb39d33c9 according to the Package index.
However the file in question has the SHA-256 hash 7612ea0058043ef44665071f0360de87856353141e427390ee7181e219062ae5:
$ curl -s https://packages.microsoft.com/repos/microsoft-debian-stretch-prod/pool/main/d/dotnet-sdk-5.0/dotnet-sdk-5.0.202-x64.deb | sha256sum
7612ea0058043ef44665071f0360de87856353141e427390ee7181e219062ae5  -

https://packages.microsoft.com/repos/microsoft-debian-stretch-prod/pool/main/d/dotnet-sdk-5.0/ indicates that the file dotnet-sdk-5.0.202-x64.deb was last changed on 06-May-2021 17:01. So maybe the package index is faulty.

@leecow @vseanreesermsft

Behavior confirmed and yes, I would also suspect an index issue. I suspect it will be easier to republish the affected version which should force an update to the index.

Looks like that took care of it:
root@005c180724ab:/SOURCE# curl -s https://packages.microsoft.com/debian/9/prod/pool/main/d/dotnet-sdk-5.0/dotnet-sdk-5.0.202-x64.deb | sha256sum
7612ea0058043ef44665071f0360de87856353141e427390ee7181e219062ae5  -
root@005c180724ab:/SOURCE# curl -s https://packages.microsoft.com/repos/microsoft-debian-stretch-prod/dists/stretch/main/binary-amd64/Packages.gz | zgrep -C9 'Filename: .*/dotnet-sdk-5.0.202-x64.deb'

Package: dotnet-sdk-5.0
Priority: standard
Section: devel
Installed-Size: 222041
Maintainer: Microsoft <dotnetcore@microsoft.com>
Architecture: amd64
Version: 5.0.202-1
Depends: libc6 (>= 2.14), libgcc1 (>= 1:3.0), libstdc++6 (>= 4.4.0), dotnet-runtime-5.0 (>= 5.0.5), netstandard-targeting-pack-2.1 (>= 2.1.0), aspnetcore-runtime-5.0 (>= 5.0.5), dotnet-targeting-pack-5.0 (>= 5.0.0), aspnetcore-targeting-pack-5.0 (>= 5.0.0), dotnet-apphost-pack-5.0 (>= 5.0.5)
Filename: pool/main/d/dotnet-sdk-5.0/dotnet-sdk-5.0.202-x64.deb
Size: 57105162
MD5sum: 15f9aae6f0633d7608ca85969b9c6d05
SHA1: cdb68858bcdcfe5bf7bcc0f732d445b236df2a07
SHA256: 7612ea0058043ef44665071f0360de87856353141e427390ee7181e219062ae5
SHA512: 4df75daabd44772ffe099ffe2d96b482f90b1895641f0a85c172e9238d2024dd577b8873c40578e30f066b1a768b5c6eb7b43c81767114f9e5c6ce9646af38de
Description: Microsoft .NET SDK 5.0.202
 .NET is a development platform that you can use to build command-line applications, microservices and modern websites. It is open source, cross-platform and is supported by Microsoft. We hope you enjoy using it! If you do, please consider joining the active community of developers that are contributing to the project on GitHub (https://github.com/dotnet/core). We happily accept issues and PRs.
Homepage: https://dotnet.github.io/core

Thanks for the quick fix, Lee.
What about my other request?
Quote: It would be great if packages.microsoft.com would contain a file with contact information.
IMHO it would be really helpful if there would be a http://packages.microsoft.com/contact.txt (or similar) that explains how to report issues. I just happened to find a similar older bug and also filed a bug here...

:(  2021-12-12 14:23:58.799686:
"gpgv: Signature made Fri Dec 10 19:49:09 2021 CET using RSA key ID BE1229CF",
"gpgv: Good signature from "Microsoft (Release signing) gpgsecurity@microsoft.com"",
"ERROR: unable to update: download errors:",
"  https://packages.microsoft.com/ubuntu/20.04/prod/pool/main/d/dotnet-sdk-5.0/dotnet-sdk-5.0.202-x64.deb: md5 hash mismatch "15f9aae6f0633d7608ca85969b9c6d05" != "8c762eace12a55940a48779b274aa724"",
"  https://packages.microsoft.com/ubuntu/20.04/prod/pool/main/m/msft-identity-broker/msft-identity-broker_1.0.0~alpha01_all.deb: md5 hash mismatch "361f40f49e84ef3f677b9e3f0672b5e3" != "c8f3f9d52d97bfaf1e63ec8e0b8efec7""

authors: SusLes Vitexus leecow michael-schaller


text:
.net error

Problem encountered on https://dotnet.microsoft.com/en-us/learn/dotnet/hello-world-tutorial/install
Operating System: macos
Provide details about the problem you're experiencing. Include your operating system version, exact error message, code sample, and anything else that is relevant.

Hi @bfbrey! Can you share more information about the problem you're having?

authors: CarnaViire bfbrey


text:
Problem encountered on https://dotnet.microsoft.com/en-us/learn/aspnet/hello-world-tutorial/run
Operating System: linux
Provide details about the problem you're experiencing. Include your operating system version, exact error message, code sample, and anything else that is relevant.

Can you give more information about your issue @rammrtzz?

authors: mairaw rammrtzz


text:
Undo change of exception type thrown for invalid handles

Fixes ProjectN test failures.
Misc style fixes.

cc @kouvel

I probably should have tested this on ProjectN as well, sorry about that, and thanks for fixing!

authors: jkotas kouvel

repo: dotnet/corert


text:
Update the .NET Aspire API docs for preview 4.

Update the .NET Aspire API docs for preview 4.

Associated WorkItem - 227652

Done

repo: dotnet/docs-aspire


text:
API Gateway implementation?

Hi, is there an article of this series that covers the API Gateway implementation?
Thank you.

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

ID: 376577d9-c559-9d5d-e263-ff9f0fb6ac27
Version Independent ID: 29164c20-12a7-6bf2-a946-03ef2477d61b
Content: Creating a simple data-driven CRUD microservice
Content Source: docs/standard/microservices-architecture/multi-container-microservice-net-applications/data-driven-crud-microservice.md
Product: dotnet
GitHub Login: @CESARDELATORRE
Microsoft Alias: wiwagn

Here:
https://docs.microsoft.com/en-us/dotnet/standard/microservices-architecture/multi-container-microservice-net-applications/implement-api-gateways-with-ocelot
Also in the eBook .PDF (.NET Microservices), same chapter:
https://aka.ms/microservicesebook
And this related/original Blog Post in my blog:
https://blogs.msdn.microsoft.com/cesardelatorre/2018/05/15/designing-and-implementing-api-gateways-with-ocelot-in-a-microservices-and-container-based-architecture/
Hope it helps. 👍

authors: CESARDELATORRE ccalvarez

repo: dotnet/docs


text:
Test void methods and verify mock method calls

Hi,
I would like to ask you how would you assert on a void method?
Would you verify that the mock methods are called with some expected data?
Thank you!

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

ID: 51947dc8-9ae8-21fa-13db-a7ffb3f9bc0e
Version Independent ID: be661bf5-6f6e-cd18-344b-253edf5751ae
Content: Best practices for writing unit tests - .NET Core
Content Source: docs/core/testing/unit-testing-best-practices.md
Product: dotnet-core
GitHub Login: @jpreese
Microsoft Alias: wiwagn

There are two ways I see approaching testing void methods.

If your void method is doing more than one thing, you could split it up into more methods and have those methods actually return data and test that its coming back as expected. Maybe you have a void that takes in data, performs some transformation, and then adds to a database. Take the transformation out, test that result, then don't bother testing the void method because you've already tested the important bit.

If your void method can't be split up, and theres branching that determines which method to call and you feel it's important to get those calls right, then yes, spying on those methods to make sure that they are called is really all you can do.

Maybe based on some input ApiA should be called, but when given another set of input, ApiB should be called.

authors: jpreese nicoleta-scrimint


text:
Tutorial for "Introduction to classes", problem with this

I don't understand why in section Open a new account we use keyword this in constructor
public BankAccount(string name, decimal initialBalance)
{
     this.Owner = name;
     this.Balance = initialBalance;

     this.Number = accountNumberSeed.ToString();
     accountNumberSeed++;
}

but in the section Open a new account this vanish from constructor.
public BankAccount(string name, decimal initialBalance)
{
    Number = accountNumberSeed.ToString();
    accountNumberSeed++;

    Owner = name;
    MakeDeposit(initialBalance, DateTime.Now, "Initial balance");
}

I also want to ask, what is recommended style: using this keyword before names of properties and methods or not?

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

ID: 24c8353f-69e7-9068-9b18-df0198a1b122
Version Independent ID: 823031fe-c8a4-69cd-2b1a-9faacd282aab
Content: Classes and objects  - C# Fundamentals tutorial
Content Source: docs/csharp/fundamentals/tutorials/classes.md
Product: dotnet-csharp
Technology: csharp-fundamentals
GitHub Login: @BillWagner
Microsoft Alias: wiwagn

Thanks for raising these questions @KZiemian This helps us improve.
I'll answer the questions here, and then add the "up for grabs" label in addition to adding this to our backlog.
To answer your first question:
The this modifier is usually optional when you're accessing a member of the current class. The only time it is necessary is to disambiguate between a local variable and a member, as shown in the following:
public class Point
{
    private int x;
    private int y;

    public Point(int x, int y)
    {
        // The left side is the member field, the right side is the parameter.
        this.x = x;
        this.y = y;
    }
}

To answer the second question:  Most coding styles recommend not including the this modifier except where it is required (as above).

@BillWagner, can I change the first example to remove the this  modifier since it isn't necessary there?

Thank you for the answer. I want to point two minor issues that I have with this page and they probably don't deserve separated GitHub issues, I will post them here.
In Create deposits and withdrawals in try-and-catch statement try is shown in blue and catch in black, this is true both on my Windows and on my GNU/Linux systems. I feel that this is not best syntax highlighting and both this words should be in the same color.
Second issue is in the same part of article Create deposits and withdrawals. Before code snippet of the second try-and-catch statement we can read "Add the following code at the end of your Main method:". If some beginner would do that code
try
{
    account.MakeWithdrawal(750, DateTime.Now, "Attempt to overdraw");
}
catch (InvalidOperationException e)
{
    Console.WriteLine("Exception caught trying to overdraw");
    Console.WriteLine(e.ToString());
}

would never run and he/she may be confused. This is because that is you write everything according to the page code before would be
try
{
    invalidAccount = new BankAccount("invalid", -55);
}
catch (ArgumentOutOfRangeException e)
{
    Console.WriteLine("Exception caught creating account with negative balance");
    Console.WriteLine(e.ToString());
    return;
}

and since exception is catched whole function is terminated by return;. At least I believe it being the reason, since in all similar languages that I know is how the return works.

Thanks for the additional information @KZiemian
I'll update per those comments this month.

authors: BillWagner KZiemian raphaelavelar


text:
The unobvious implicit cast in foreach statements

Today, I've run against a quiet unobvious behavior of the C# compiler that I believe deserves to be documented. I've submitted an issue to the roslyn team (dotnet/roslyn#25080), but it looks like this behavior is considered correct (although I can't even find proper words to express how I disagree).
There's a detailed description in the issue, in short: when the C# compiler has to process a statement like
foreach (T item in items)
{
}

where items is of type IEnumerable<TImpl> (or equivalent enumerable type as supported by foreach) and T is an interface that is not implemented by TImpl, it (compiler) adds a cast from object to T and allows the statement to compile. Thus, at some point at run time there might be an InvalidCastException upon an attempt to cast an item from items that does not implement T.
It think this needs to be documented somewhere and I haven't found any related docs. @mairaw what do you think about this?
edit by www: Add document details section so this displays in the issues control on the foreach reference page.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: d710feeb-8f03-b211-a070-155938929d6b
Version Independent ID: c980ea8e-ffb4-fbb1-1761-292858616cdd
Content: C# foreach statement
Content Source: docs/csharp/language-reference/keywords/foreach-in.md
Product: dotnet-csharp
GitHub Login: @BillWagner
Microsoft Alias: wiwagn

In which article would you expect to find this information?

This section on foreach tries to show how that statement is compiled.
A quote from there:

The above steps, if successful, unambiguously produce a collection type C, enumerator type E and element type T. A foreach statement of the form

foreach (V v in x) embedded_statement

is then expanded to:

{
    E e = ((C)(x)).GetEnumerator();
    try {
        while (e.MoveNext()) {
            V v = (V)(T)e.Current;
            embedded_statement
        }
    }
    finally {
        ... // Dispose e
    }
}

Can it be a good place to mention InvalidCastException?

@pkulikov That's the specification. If you can get though all of the preceding text, then I think it can be assumed that you don't need a reminder that a cast can throw.

@svick I think it would be nice to be able to find it somewhere. That's the key, Google does a good job of indexing the docs as well as the rest of the web, we just need to pick a good place. I am not familiar with the entire structure of the docs, so I'd like to hear suggestions from the team.
One place I could think of (definitely questionable) is the foreach, in keyword reference. Maybe not the best place, but this behavior is specific to way the compiler handles foreach statements. At least we could add some more "advanced" examples that demonstrate this sort of usage alongside with the trivial examples we have there already.
Some article about compiler logic itself could work too, but I'm not sure if there are any articles about compiler internals.

What about this page in language reference?

@pkulikov I would agree with @svick here. Specification is great to understand how things work, but I'd prefer it more adapted to an average developer. Many people I think won't read the specification even if they are able to find the right article.

@eduard-malakhov @svick you are right, I agree with suggestion of @eduard-malakhov to update keyword reference page with one or two more examples. So far it looks the best place.

@pkulikov ok, thank you for participating. I will then create some examples, submit a PR to update keyword reference, and we'll see where it goes.

The proposal looks good to me. But I'd prefer to have @BillWagner input on this one.

This is a good proposal.
I'll add some details to your example that should be part of the explanation. Let's start with your original example:
namespace ConsoleApp1
{
    class SomeType { }

    class DifferentType { }

    interface SomeRandomInterface { }

    class Program
    {
        static void Main(string[] args)
        {
            SomeType[] arrayOfSomeType = new SomeType[]
            {
                new SomeType(),
            };

            IEnumerable<SomeType> enumerableOfSomeType = arrayOfSomeType;

            //  This compiles, but throws InvalidCastException at run time (and puzzels me)
            foreach (SomeRandomInterface item in enumerableOfSomeType) { }

            //  This won't compile (thankfully)
            //foreach (DifferentType item in enumerableOfSomeType) { }
        }
    }
}

One of the commenters on your roslyn issue pointed out that it does not compile if SomeType is sealed. It only compiles when SomeType could have derived classes.
Aha!
In that case, the actual objects in the collection may not be SomeType but could be ATypeDerivedFromSomeType. That derived type could implement SomeRandomInterface.
As others have mentioned, this behavior dates from a time before generics, where SomeType would likely be object. This idiom would have been more common then.
Does that help explain why this is this?
pinging @madsTorgersen for any corrections.

Would be nice to have an example where the feature is useful, in addition perhaps to the example where it was not very useful. Like this:
ObservableCollection<Order> Orders = …

Orders_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
{
    if (e.NewItems != null) {
        foreach (Order order in e.NewItems) {
            ...
        }
    }
}

See also AB#1702034
Given the number of comments on this issue, I think fixing this issue will address the internal work item.

authors: BillWagner eduard-malakhov mairaw pkulikov sjb-sjb svick


text:
How about using newer language constructs?

How about using syntax like
protected virtual void OnShapeChanged(MyEventArgs e)
{
    ShapeChanged?.Invoke(this, e);
}

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

ID: 797ea358-4ed7-9152-dc7e-f4911ce58068
Version Independent ID: e43c69e0-e4f5-a171-72e8-1f1f2f6b71e9
Content: How to: Implement Interface Events (C# Programming Guide)
Content Source: docs/csharp/programming-guide/events/how-to-implement-interface-events.md
Product: dotnet-csharp
GitHub Login: @BillWagner
Microsoft Alias: wiwagn

I agree that using C# 6.0 features in that example makes sense. Do you want to make that change?

Thanks for pointing this out @tsahi
As @svick mentioned, we should be using the newer features. Several of our older examples predate those features. If you'd like to submit a PR to make the change, I'll watch for it and merge it.

Sure, I'll try to get to this in a day or two.

authors: BillWagner svick tsahi


text:
Converted project.json to MSBuild

Converted project.json to MSBuild projects
Summary
Converted the tour projects at ./samples/snippets/csharp/tour/
Fixes #1437
Suggested Reviewers
@BillWagner

@blackdwarf wanna take a look at this as well?

All those comments are basically wondering if we can just use the default csproj template:
<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp1.0</TargetFramework>
  </PropertyGroup>

</Project>

@mairaw @blackdwarf I've updated the project files.

authors: mairaw rpetrusha


text:
Update how-to-query-the-contents-of-files-in-a-folder-lin.md

Title
adding "Text" to the title makes what this does clearer, this method will not work on docx, pdf, etc...
Summary
Added clarity to what type of files you are searching.

This seems like a small (but important) contribution, so no Contribution License Agreement is required at this point. We will now review your pull request.
Thanks,
.NET Foundation Pull Request Bot

Line 25 updated, let me know if you need anything else.

authors: bruceburge dnfclas


text:
Update cs1029.md

Error message does not match the example.

We could go even further to match perfectly the example:
CS1029.cs(6,8): error CS1029: #error: 'Let's give an error here   // CS1029  '
The first line of the example indicates the name of the file: CS1029.cs.
The same applies to CS1030.


text:
Update index.md

Rephrasing confusing use of multiple "support" word usage
Summary
Describe your changes here.
Fixes #Issue_Number (if available)

@akshatha-harshitha that's a good catch. However, the updated page will be removed by #8164

@akshatha-harshitha We thank you for your contribution! But, as @pkulikov mentioned, this page will be removed in the future. I'm going to decline this PR. Thanks again.

authors: Thraka akshatha-harshitha pkulikov


text:
Add "Copy to clipboard" as a menu option for output cell

Describe the solution you'd like
Currently you can only "Change Presentation" and "Clear Cell Outputs" - it would be nice to have a button to "Copy to clipboard" as well (at least for text/* mimetypes if nothing else) - saves the whole select all, control-c keyboard shuffle.
Describe alternatives you've considered
The only one I know of is to manually select all and then control-c (output doesn't even have a right-click menu which is an issue on it's own if not irritating, definitely non-accessible)
(PS This is on MacOS)

Are you using the VS Code extension?

@jonsequitur Oh yes sorry - thought this was repo just for that - .net interactive notebook extension for vscode on macos monterrey

This would probably best be solved more generally within VS Code. Here are a couple of related issues:
https://github.com/microsoft/vscode/issues/129880
https://github.com/microsoft/vscode-jupyter/issues/8699

Good point. A more generalized feature for this would be helpful.
@rebornix Are you aware of any open issues focused on making it easier to copy text from cell outputs?

@jonsequitur we don't have one particular issue tracking it but I think it's worthwhile to have this in our near term iteration plans. Copying text output right now is not easy and we need to figure out what's the right UX to handle this, either a context menu or a command.

authors: jonsequitur mika76 rebornix

repo: dotnet/interactive


text:
Model Builder Error during the "Create New Workspace" wizard

System Information (please complete the following information):

Model Builder Version: 16.3.0.2056001
Visual Studio Version 16.10.0

Describe the bug
Right Click on the Project > Add > Machine Learning
Click Object Detection
Click Set Up Workspace
Fill in the form and click Create
It hangs a while, appearing to make a remote call or a long IO operation or something like that.
Then it displays this error message:
Long running operation failed with status 'Failed'. Additional Info:'At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/DeployOperations for usage details.'
at Microsoft.Rest.ClientRuntime.Azure.LRO.AzureLRO2.CheckForErrors()    at Microsoft.Rest.ClientRuntime.Azure.LRO.PutLRO2.CheckForErrors()
at Microsoft.Rest.ClientRuntime.Azure.LRO.AzureLRO2.<StartPollingAsync>d__20.MoveNext() --- End of stack trace from previous location where exception was thrown ---    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)    at Microsoft.Rest.ClientRuntime.Azure.LRO.AzureLRO2.d__15.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Rest.Azure.AzureClientExtensions.d__12.MoveNext() --- End of stack trace from previous location where exception was thrown ---    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)    at Microsoft.Rest.Azure.AzureClientExtensions.<GetLongRunningOperationResultAsync>d__01.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Rest.Azure.AzureClientExtensions.d__51.MoveNext() --- End of stack trace from previous location where exception was thrown ---    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)    at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult()
at Microsoft.Azure.Management.ResourceManager.Fluent.DeploymentsOperations.d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult()    at Microsoft.Azure.Management.ResourceManager.Fluent.DeploymentsOperationsExtensions.<CreateOrUpdateAsync>d__2.MoveNext() --- End of stack trace from previous location where exception was thrown ---    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)    at System.Runtime.CompilerServices.TaskAwaiter1.GetResult()
at Microsoft.Azure.Management.ResourceManager.Fluent.DeploymentImpl.d__60.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at Microsoft.Azure.Management.ResourceManager.Fluent.DeploymentImpl.d__59.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Azure.MachineLearning.Services.Workspaces.WorkspaceOperations.d__10.MoveNext() in //src/Microsoft.ML.AzureMLClient/Workspaces/WorkspaceOperations.cs:line 193
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Azure.MachineLearning.Services.AMLRest.AzureAttachManager.d__10.MoveNext() in //src/Microsoft.ML.ModelBuilder.AutoMLService/AMLRest/AzureAttachManager.cs:line 127
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.ML.ModelBuilder.AutoMLEngine.d__40.MoveNext() in /_/src/Microsoft.ML.ModelBuilder.AutoMLService/AutoMLEngineService/AutoMLEngine.cs:line 251
Expected behavior
I'm sorry, I've never done it before so I didn't know what to expect.
Screenshots

Additional context
None

Sorry you ran into this problem @BenjaminCharlton, and thanks for reporting!
We've had several customers report problems creating their first workspace for a subscription. I'm guessing your issue is the same. Can you go to the portal to check? You can find information in the activities log on portal.azure.com

Can you find the call to make the new workspace? I'm guessing it will say it failed "An invalid value was provided for access policies".

Hi @beccamc! Yes, it says that in the statusMessage of the JSON.

Thanks! I'm going to try to pull in the Azure team to help.

We have fixed this issue, and will ship it with our next release. Expect to see it in September. Thanks for your patience!

Well done! Thanks for the update

authors: BenjaminCharlton beccamc

repo: dotnet/machinelearning-modelbuilder


text:
Migrate System.Threading.Tasks.Extensions

The System.Threading.Tasks.Extensions nuget package  has this information:

A few public APIs implemented in .NET Standard 2.0. They look somewhat simple.
A .NET Framework 4.6.1 folder with public APIs implemented. No 4.6.2 folder, but I guess we need to continue supporting this package because of .NET Standard 2.0, and 4.6.1 is supposed to be compatible with it.
There is a lib/netcoreapp2.1 folder but it has a _._ placeholder.
No ref assemblies.
No PNSE.

When consuming this nuget package in a console app, then printing typeof(System.Threading.Tasks.Sources.IValueTaskSource).Assembly.CodeBase I confirmed that:

When targeting .NET Framework 4.6.2, the nuget package is used: bin/Debug/net462/System.Threading.Tasks.Extensions.DLL
When targeting .NET 6.0, the package is ignored and the inbox one is used instead: file:///C:/Program Files/dotnet/shared/Microsoft.NETCore.App/6.0.25/System.Private.CoreLib.dll

The source code of this assembly is being migrated from corefx 2.1.

@dotnet/area-system-threading-tasks this PR is ready to be reviewed. It's migrating a package from your area of ownership from corefx 2.1 to maintenance-packages. Do you mind taking a look?

The source code of this assembly is being migrated from corefx 2.1.

The source for this existed in runtime up through .NET 7:
https://github.com/dotnet/runtime/tree/release/7.0/src/libraries/System.Threading.Tasks.Extensions
Do we know there weren't any important changes until then?

Ah, I take that back, it looks like the src folder there is empty.

Ah, I take that back, it looks like the src folder there is empty.

Yep. 2.1 was the last branch from which this package was shipped. Starting with 3.0, the src folder is empty.

Do you mind taking a look?

What kind of feedback are you looking for?

What kind of feedback are you looking for?

Hopefully nothing too deep. The code is being migrated with minimal modifications: Mainly I'm removing the unnecessary pragma directives (and the code it guards), applying some new roslyn warning and error fixes that show up, and deleting unused test code. The big and complex changes are mostly infra-related. So if you have any comments (or even questions) about those changes, please let me know.

@ViktorHofer @ericstj I merged the latest changes in main. No errors after running dotnet pack. I think this PR is ready to merge.

Force-pushed to put all the changes introduced in this PR at the top in a single commit.

authors: carlossanlop stephentoub

repo: dotnet/maintenance-packages


text:
Remove leftover shims for Omnisharp

Summary of the changes

Now that we've migrated a lot of the our endpoints we can get rid of some of these shims.

Crazy how cool it is to see the old helpers / APIs go. DOPENESS!

authors: NTaylorMullen ryanbrandenburg

repo: dotnet/razor-tooling


text:
Synchronize MostRecent when appropriate

I added a check to MostRecent<>.Run which will return a different sink to synchronize reads & writes on _value when the size of TSource exceeds the native word size (checked using System.Runtime.CompilerServices.Unsafe.SizeOf<T>()) to prevent potentially reading an intermediate value in the middle of a write operation.

If this doesn't warrant adding Unsafe as a dependency, it could instead either use locking for reading and writing _value (less code) indiscriminately or permit reference types & safe primitives.

I'm certain we would like to keep Rx.NET a clean C# implementation without unsafe juggling.

repo: dotnet/reactive


text:
ASP.NET Core node error in CI on Ubuntu2204 legs

The following build error is occurring in the two Ubutntu2204 CI legs (x64/arm64)
    npm ERR! code 1
    npm ERR! path /vmr/src/aspnetcore/artifacts/sb/src/node_modules/puppeteer
    npm ERR! command failed
    npm ERR! command sh -c node install.mjs
    npm ERR! file:///vmr/src/aspnetcore/artifacts/sb/src/node_modules/puppeteer/install.mjs:20
    npm ERR!   const {downloadBrowser} = await (async () => {
    npm ERR!                             ^^^^^
    npm ERR!
    npm ERR! SyntaxError: Unexpected reserved word
    npm ERR!     at Loader.moduleStrategy (internal/modules/esm/translators.js:133:18)
    npm ERR!     at async link (internal/modules/esm/module_job.js:42:21)

    npm ERR! A complete log of this run can be found in:
    npm ERR!     /root/.npm/_logs/2024-01-11T08_48_17_144Z-debug-0.log
  /vmr/src/aspnetcore/eng/SourceBuild.props(99,5): error MSB3073: The command "npm ci" exited with code 1. [/vmr/artifacts/source-built-sdks/Microsoft.DotNet.Arcade.Sdk/tools/Build.proj]
##[error]/vmr/src/aspnetcore/eng/SourceBuild.props(99,5): error MSB3073: The command "npm ci" exited with code 1.

Failing Build (internal microsoft link)
This appears related to https://github.com/dotnet/aspnetcore/pull/53154.

@wtgodbe - can you take a look?

https://github.com/dotnet/source-build/issues/3924#issuecomment-1886811967 seems relevant

Fixed by https://github.com/dotnet/dotnet-buildtools-prereqs-docker/pull/964

authors: MichaelSimons mthalman

repo: dotnet/source-build


text:
Console Output shows many "Errors on load"

Investigate

Additional context: This shows up onload of the marketing page as well.

Investigating this issue....
@AbhitejJohn

Is this still happening? The repro steps are unclear.

I tried a couple of times last week and couldn't repro this issue anymore. I confirmed this with Dan

authors: AbhitejJohn jonsequitur ocallesp

repo: dotnet/try


text:
Automatic quotes for attributes in Razor files

When editing plain HTML files, VSCode insert quotes automatically after typing tag attribute, like <a class= double quotes are inserted.
Please add the same when editing .CSHTML (Razor) files

@davidwengier This looks like it is part of the language configuration already.
https://github.com/dotnet/vscode-csharp/blob/510d78ece2b1c6b1f37abeda6dcee84ca01fa77f/src/razor/language-configuration.json#L11-L18

@JoeRobich Nope, I'm not talking about auto-closing pairs. I'm talking about inserting quotes after typing = (equal sigh) in html attributes.

authors: JoeRobich alex-jitbit

repo: dotnet/vscode-csharp


text:
Feat split

--修复容器内元素的下拉或者弹出选项超出范围后被遮挡的问题

 Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.SamXMG seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.You have signed the CLA already but the status is still pending? Let us recheck it.

@SamXMG 帮忙项目右上角点一下 star 谢谢啦，还有这个能有一个复现小例子吗？

authors: ArgoZhang CLAassistant SamXMG

repo: dotnetcore/BootstrapBlazor


text:
⚠ Adacta-fintech.com has degraded performance

In e899884, Adacta-fintech.com (https://www.adacta-fintech.com) experienced degraded performance:

HTTP code: 200
Response time: 1608 ms

Resolved: Adacta-fintech.com performance has improved in 6000174 after 7 minutes.

repo: dotsi/aduptime


text:
🛑 Biseri-jadrana.si is down

In ed6bf5c, Biseri-jadrana.si (https://www.biseri-jadrana.si/) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Biseri-jadrana.si is back up in f952660.

repo: dotsi/bitamiuptime


text:
add travis ci

@mckelvin pls review

👏
@travis-ci : LGTM

repo: douban/Kenshin

license_source: bigquery


text:
Allow multiple element locators

As a user I should be able to define a number of element locators so that if a particular browser does not support a locator type, I can still find my element.
This should also allow  multiple locators of the same type, so that, for example, if a webpage is updated with new IDs, both IDs can be used and the tests will work on old and new versions of a site.

This was fixed in 1.0.4

repo: dougnoel/sentinel


text:
Fix VM memory overallocation

Reduce the amount of memory taken by Ruby processes in the 'ingestion' inventory for Ingestion 2 by reducing the number of processes.
Also give a little more memory to the 'dev2' VM in the Vagrantfile.
The worker processes could be dropped to just one, but I figure that it could be useful in development to make sure that the system works with concurrently-running processes.

:+1:

authors: anarchivist markbreedlove

repo: dpla/automation

license: mit


text:
🛑 Fastbin Service is down

In eab0c3e, Fastbin Service (https://paste.dpG06.top) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Fastbin Service is back up in 26c8ac6 after 4 hours, 25 minutes.

repo: dplayz/status


text:
🛑 Workstation Service is down

In c97e1c0, Workstation Service (https://workstation.dpG06.top) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Workstation Service is back up in bf2fbe0 after 1 hour, 55 minutes.


text:
fix: keep ignore text more as-is

Closes #83

Awesome - Thanks David!! :bow:

authors: NukeManDan dsherret

repo: dprint/dprint-plugin-markdown


text:
Issue with state=None in United Kingdom

This line would Error out when state is None.

Pull Request Test Coverage Report for Build 1657786808

1 of 1 (100.0%)  changed or added relevant line in 1 file are covered.
No unchanged relevant lines lost coverage.
Overall coverage remained the same at 97.945%

Totals

Change from base Build 1654527703:
0.0%

Covered Lines:
5781

Relevant Lines:
5846

💛  - Coveralls

Fixes #591

authors: coveralls mborsetti

repo: dr-prodigy/python-holidays


text:
⚠ gorzdrav.org has degraded performance

In 70d6b84, gorzdrav.org (https://gorzdrav.org) experienced degraded performance:

HTTP code: 200
Response time: 1655 ms

Resolved: gorzdrav.org performance has improved in 3bc8efe after 6 minutes.


text:
Added Jio to database & list

Hey @draco-malfoy , I have added Jio to database and list .Please accept my PR & do the needful .Thanks.

@all-contributors please add @NVSUCCESS for documentation

authors: NVSUCCESS draco-malfoy

repo: draco-malfoy/StartHub


text:
Vertical title bar is not visible on iOS

Hello,
I am trying to use this theme on iOS, but the vertical title is not visible (screenshot below). I installed the theme using the Obsidian settings UI. I see the same behavior on both my phone and my iPad.
Devices: iPhone 13 mini (iOS 15.1.1) and iPad Pro (iOS 15.1)
Obsidian version: 1.0.5

Vertical titlebar has since been completely removed and would need to be reimplemented after the upcoming 0.16 UI update. Original titlebar should now work as expected on iOS.

authors: Chrismettal spencewenski

repo: dracula/obsidian


text:
error: context deadline exceeded (Client.Timeout or context cancellation while reading body)

Bug report:
{"level":"error","ts":"2021-10-29 07:15:29.591","caller":"peer/piece_manager.go:154","msg":"put piece to storage failed, piece num: 40, wrote: 0, error: context deadline exceeded (Client.Timeout or context cancellation while reading body)","peer":"x.y.z.5-1-4ead15eb-1198-4ae7-bf93-7270a414724e","task":"0cde3188a70fe9fe2ed13572711f928bed5f0aada4ec07b176737259739ba147","component":"streamPeerTask","stacktrace":"d7y.io/dragonfly/v2/client/daemon/peer.(*pieceManager).DownloadPiece\n\t/go/src/d7y.io/dragonfly/v2/client/daemon/peer/piece_manager.go:154\nd7y.io/dragonfly/v2/client/daemon/peer.(*peerTask).downloadPieceWorker\n\t/go/src/d7y.io/dragonfly/v2/client/daemon/peer/peertask_base.go:664"}
Expected behavior:

How to reproduce it:

Environment:

Dragonfly version: alpha.7
OS:
Kernel (e.g. uname -a):
Others:

dfdaemon:
x.y.z.5-1-4ead15eb-1198-4ae7-bf93-7270a414724e.log
scheduler:
scheduler_1.log

Download piece timeout caused this error. The default download piece timeout time is 30s, you can refer to dfdaemon configuration to modify.

authors: gaius-qi mohafarooq


text:
feat: dfdaemon add Authorization and WWWAuthenticate headers

Signed-off-by: Gaius gaius.qi@gmail.com

Description

Dfdaemon add Authorization and WWWAuthenticate headers.

Related Issue

Motivation and Context

Screenshots (if appropriate)
Types of changes

[ ] Bug fix (non-breaking change which fixes an issue)
[x] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)
[ ] Documentation Update (if none of the other choices apply)

Checklist

[ ] My change requires a change to the documentation.
[ ] I have updated the documentation accordingly.
[x] I have read the CONTRIBUTING document.
[ ] I have added tests to cover my changes.

Codecov Report

Merging #1513 (24cd4af) into main (8de5c5b) will increase coverage by 0.12%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #1513      +/-   ##
==========================================
+ Coverage   43.44%   43.56%   +0.12%
==========================================
  Files         116      116
  Lines       10710    10710
==========================================
+ Hits         4653     4666      +13
+ Misses       5578     5558      -20
- Partials      479      486       +7

Flag
Coverage Δ

Object-compatibility-e2etests
?

e2etests
?

unittests
43.56% <ø> (+0.12%)
:arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files
Coverage Δ

pkg/source/clients/httpprotocol/header.go
0.00% <ø> (ø)

client/daemon/rpcserver/subscriber.go
47.76% <0.00%> (-2.24%)
:arrow_down:

...ent/daemon/peer/peertask_piecetask_synchronizer.go
45.45% <0.00%> (-2.17%)
:arrow_down:

client/daemon/peer/peertask_file.go
57.25% <0.00%> (-1.53%)
:arrow_down:

client/daemon/peer/peertask_piecetask_poller.go
47.10% <0.00%> (+16.66%)
:arrow_up:

authors: codecov-commenter gaius-qi


text:
Make non-complex requests quicker to add

Maybe something like BasicRequest(string url) that can then be plugged into the apiclient? if this were to happen it would only support GET

Closed by #24


text:
minimal GPG/SSH for OSX (fish)

brew install gpg pinentry-mac ykman
ykman mode "CCID"
gpg --card-edit
> admin

# change card pin
> passwd
> 1

# change admin password
> passwd
> 3

# generate keys
> generate

# exit
> quit

tee ~/.config/fish/conf.d/gnupg.fish <<EOF
# Start or re-use a gpg-agent.
gpgconf --launch gpg-agent

# Ensure that GPG Agent is used as the SSH agent
set -xg SSH_AUTH_SOCK ~/.gnupg/S.gpg-agent.ssh

EOF
tee ~/.gnupg/gpg-agent.conf <<EOF
pinentry-program /usr/local/bin/pinentry-mac
enable-ssh-support

EOF

command + t for new terminal

Thanks, but please propose these instructions in a pull request to the guide for visibility.

authors: drduh peterromfeldhk

repo: drduh/YubiKey-Guide


text:
fix(): fixes issue #73

Short description of what this resolves:
This fixes the roboto and noto-sans fonts not getting included. The copy task did not copy over the fonts before and instead just copied over ionicons. It now copies over fonts and ionicons. This also changes the sass config to make sure it looks in the right directory.
Changes proposed in this pull request:

Change copy.config to pull in all fonts instead of just ionicons
Change sass.config to look in the right directory

Fixes: #73

The only issue with this is it makes the ionicon version dependent on the ionic-angular version. I believe @adamdbradley wanted them separated so if we were to release a new version of ionicons we wouldn't have to release a new version of the framework to go with it.

@brandyscarney yep we are talking about that now. The issue here is that ionic-angular/fonts includes ionicons. So i removed the line that includes ionicons explicitly because they are already included in ionic-angular/fonts.

Dont merge yet, may have found an issue

Hey guys!  Any updates on when this bad boy can be merged in?  My CTO is really wanting our Roboto font back :)

@jgw96 Why was the ionicons copy from node_modules removed? Updating ionicons is still dependent on the framework's version of ionicons if we copy the fonts from the framework's font folder. I'm thinking we need to remove ionicons from dist/ in the framework altogether.

The above commit makes sure that the ionicons are copied from ionicons and not the framework. Since the ionicons are copied from ionicons first they will not be overwritten by the ones in ionic-angular/fonts. Ideally in the future we would remove ionicons from the framework to keep them totally seperate from the framework, but this would be a breaking change.

I'm good with this PR, let's get @adamdbradley or @danbucholtz to approve it.

authors: brandyscarney jgw96 joshgarwood

repo: driftyco/ionic-app-scripts


text:
SplashScreen low resolution on android tablet

The splashscreen image is fuzzy (look like low resolution) only on Android.
I used the Ionic splashscreen PSD template and then ionic resources.
I guess I'm not the first who came across that issue:
https://forum.ionicframework.com/t/splashscreen-low-resolution-on-android-tablet/20064

+1

+1

Thanks for opening the issue. It seems that issue has been resolved. I am going to close this issue but please feel free to reopen another issue if this occurs again.

repo: driftyco/ionic-cli


text:
Ionic doesn't indentify globally installed Gulp

From @MtDalPizzol on May 4, 2016 17:9
I have cordova@6.1.1 and gulp@3.9.1 installed globally, but running ionic serve throws this message to the terminal:
You have specified Gulp start up tasks in your ionic.project file.
However, you do not have Gulp installed globally. Please run `npm install -g gulp` (CLI v1.7.14)

Seems like Ionic isn't identifying Cordova and Gulp, but listing globally installed packages with npm ls -g --depth="0" outputs this:
/home/dalpizzol/.npm-global/lib
├── cordova@6.1.1
├── gulp@3.9.1
├── ionic@1.7.14
├── pm2@1.1.3
├── sails@0.12.3
└── webpack@1.13.0

Which Ionic Version? 1.7.14
Run ionic info from terminal/cmd prompt: (paste output below)
Cordova CLI: Not installed
Ionic Version: 1.2.4
Ionic CLI Version: 1.7.14
Ionic App Lib Version: 0.7.0
OS: Distributor ID:	LinuxMint Description:	Linux Mint 17.3 Rosa
Node Version: v4.4.3
Copied from original issue: driftyco/ionic#6435

Hello! Thanks for opening an issue with us! As this issue has to do with the ionic-cli and not the ionic framework i will be moving this issue to that repo. Thanks for using Ionic!

Hi guys... have someone out there any idea about this? Months have passed and I still can't get this working... =/
Could it be related to my node/npm installation?


text:
Rename Ionic Platform (the cordova plugins) to Ionic Native, Plugins, something...

With Ionic Platform being used for backend services. Should we call the integrated plugins something else?

I'm fine with Native for now.

So it written. Ok, time to update the docs so that "Ionic Platform" in reference to Cordova plugins and their TS wrappers are "Ionic Native"

Closing for now. Docs now reference Ionic Native. In progress, adding docs

authors: mhartington mlynch perrygovier

repo: driftyco/ionic-site


text:
Virtual scroll performance issue on nested object

Ionic version:  (check one with "x")
[ ] 1.x
[ x] 2.x
I'm submitting a ...  (check one with "x")
[x ] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/
Current behavior:
My list is a nested object.
First loop: group of groups
Second loop: users of group
I need virtualScroll because there may be many many users.
But it doesn't work properly. There are inconsistent white spaces between users as in this screenshot:

Expected behavior:
Could be nice to use virtualScroll inside another loop.
Steps to reproduce:
Here is a plunker where I recreated the situation (in the home-page component):
http://plnkr.co/edit/QDxECxMD2Kdk8jKdaiFe?p=preview
Scrolling up and down makes visible that performance issue
Ionic info:
Cordova CLI: 6.5.0
Ionic Framework Version: 2.0.0-rc.6
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 0.0.45
ios-deploy version: 1.9.0
ios-sim version: 5.0.11
OS: OS X El Capitan
Node Version: v4.6.0
Xcode version: Xcode 7.3.1 Build version 7D1014

At the moment there are a lot of problems with virtual scroll, maybe anyone can suggest alternative?

Guys do we have some news about this issue?

@FrancescoMussi  at the moment it's totally broken :) though I see some issues being resolved in the milestones

Ok thanks. Just wondering if it is on their tasks list or has been forgotten.

repo: driftyco/ionic


text:
ionic2 upgrade to version 2.0.1, the compilation speed is very slow!

Ionic version:
2.0.1/2.1.0
Upgrade to version 2, the compilation speed is very slow, especially the lint and NGC compilation process.
eg:
E:\Products\Source\MobileApp> ionic build android --release  --prod

ionic-hello-world@ ionic:build E:\Products\Source\MobileApp
ionic-app-scripts build "--release" "--prod"

[11:29:31]  ionic-app-scripts 1.1.3
[11:29:31]  build prod started ...
[11:29:31]  clean started ...
[11:29:31]  clean finished in 6 ms
[11:29:31]  copy started ...
[11:29:31]  ngc started ...
[11:30:56]  ngc finished in 84.65 s
[11:30:56]  preprocess started ...
[11:30:56]  optimization started ...
[11:30:56]  copy finished in 85.19 s
[11:31:50]  optimization finished in 54.53 s
[11:31:50]  preprocess finished in 54.53 s
[11:31:50]  webpack started ...
[11:33:54]  webpack finished in 123.64 s
[11:33:54]  sass started ...
[11:33:54]  transpile bundle started ...
[11:34:25]  transpile bundle finished in 31.23 s
[11:34:25]  uglifyjs started ...
[11:34:27]  sass finished in 33.43 s
[11:34:27]  cleancss started ...
[11:35:59]  uglifyjs finished in 93.90 s
[12:13:59]  cleancss finished in 2371.44 s
[12:13:59]  postprocess started ...
[12:13:59]  postprocess finished in 30 ms
[12:13:59]  lint started ...
[12:13:59]  build prod finished in 2667.82 s
[12:14:20]  lint finished in 21.23 s
ionic info:
Your system information:
ordova CLI: 6.5.0
Ionic Framework Version: 2.1.0
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.1.3
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 10
Node Version: v7.5.0
Xcode version: Not installed

Hello @iraychen, this was already discussed here:
https://github.com/driftyco/ionic-app-scripts/issues/735#issuecomment-279736296
There won't be any big changes, maybe it compiles slow or fast, but for this you will get a smaller main.js

This issue was moved to driftyco/ionic-app-scripts#781

authors: brandyscarney graphefruit iraychen


text:
Using Stripe API keys

Is there an efficient workflow method for switching between test and live API keys for Stripe? I've been using angular-payments for my app checkout but I need a more seamless way to be able to test transactions even after my Ionic app has been published to the App Store.
Any recommendations? Less of an issue and more of a general question...

Greetings @calebfaruki!
My sensors indicate that you have created an issue on our tracker requesting usage help, rather than an actual error with Ionic.
This GitHub issue tracker is used to track Ionic features, problems, and development.
If you wish to get help using Ionic, the recommended place is the forum or Ionic Worldwide on Slack. There are many humans there who would be happy to offer sage advice.
Thank you for allowing me to assist you.

authors: Ionitron calebfaruki


text:
Ionic2 disables vertical swiping/dragging

Short description of the problem:
Vertical 'pan' and 'swipe' events won't fire.
<ion-content (pan)="log($event)">         ...  </ion-content>
It fires for horizontal swipes and pans but not for vertical.
What behavior are you expecting?
When I touch the screen and do a swiping or dragging motion, I expect a 'pan' or 'swipe' event to be fired, if set.
Bug:
Also there is a bug in Hammer.js events in Angular2, so I had to fix that manually, based on this issue-comment: https://github.com/angular/angular/issues/6993#issuecomment-187115690
Ionic Version:  2.x
Run ionic info from terminal/cmd prompt:
Cordova CLI: 6.0.0
Ionic Version: 2.0.0-beta.2
Ionic CLI Version: 2.0.0-beta.19
Ionic App Lib Version: 2.0.0-beta.9
OS: Distributor ID: Ubuntu Description: Ubuntu 15.04
Node Version: v5.7.1

I believe <ion-content> reserves firing these events on the vertical axis for <ion-refresher> I tried to look up this in the source code, but found nothing. If anyone has a suggestion/hint on which module prevents firing pan/drag events on the vertical axis I would be glad to fix this bug.

I did further research on the case and found a problem might be that touch-action css properties are set to manipulate although I couldn't fix this so far. Another similar problem is that webkit-user-drag is set to none. I'm not sure on this, but I think these can cause the problem.

Im also experiencing the same issue.. Want to be able to catch the vertical swipe event. regardless if ion-refresher is present or not.

Hi @godzsa and @royipressburger,
The reason for this is Angular supports the default set of Hammerjs events.
"By default it adds a set of tap, doubletap, press, horizontal pan and swipe, and the multi-touch pinch and rotate recognizers"
We are considering adding first-class support for Hammer and user configurable gestures but have not made a decision one way or another yet.  I'm going to close this issue for now.
Thanks,
Dan

@danbucholtz Is there another place we can track this issue?  I think you'll find that even in the Ionic 2 Gesture Demo, vertical panning is only recognized after it detects a horizontal pan first.
In other words, if your first pan gesture is vertical (and straight enough), no pan events are recognized.  If your vertical pan strays even slightly to the left or right, it will then unlock the vertical pan events and they will be recognized.
Other oddities are the events (panLeft)=testPanEvent($event) and (panRight)=testPanEvent($event) are recognized while (panUp)=testPanEvent($event) and (panDown)=testPanEvent($event) are not recognized
This gesture is obviously crucial for mobile applications, so I'd love to be able to follow the progress. 😄
Thanks!

Hi @philmerrell,
Thanks for reminding me about this.  We did end up overriding this configuration in Ionic.  Right now, it is using the default hammer configuration, so only the following gestures are enabled:
From Hammer.js docs
By default it adds a set of tap, doubletap, press, horizontal pan and swipe, and the multi-touch pinch and rotate recognizers. The pinch and rotate recognizers are disabled by default.

Basically, pinch and rotate won't work in Ionic right now.  We also need to enable vertical panning and swiping.
We are going to need to spend some time on this, but it may be delayed a bit.  I will check with Adam, the team lead, and see what he thinks.
Thanks,
Dan

Hello all! I can confirm that in the latest release pinch, pan etc have been enabled. Thanks for using Ionic!

Reopening for now to investigate.

Hello,
i'm currently experiencing this issue.
The behaviour of this problem was very well explained by philmerrell.
Did you guys found a trick ?
Thanks

Ok so i found nothing about this problem, so instead of using (pan) in html, i used Hammer directly in my component code, using this example http://codepen.io/jtangelder/pen/ABFnd and it works much better now for vertical pan

Yes we are experiencing the same issues. When listening to any pan event and then panning up or down, the system will deliver a single event object with center X and Y set to zero and not relative to the components corner, hence its impossible to know where the user is pointing.
However, if you first pan left or right and then up or down the events fire fine with the center coordinate initialized in the event object ! Very odd. Something is gobbling up the events for pan up and pan down unless you startet your panning by first moving left or right.

I just realized it is not working on your demo page either.
http://ionicframework.com/docs/v2/components/#gestures
If you try to pan, or swipe vertically it won't work.

I haven't tried recently, but got it working some time ago by using Hammer directly.
import {Hammer, DIRECTION_VERTICAL} from "ionic-angular/gestures/hammer";

You can set listeners in your .ts file on an element by id:
let gesture = Hammer(document.getElementById("element-to-drag"), {direction: DIRECTION_VERTICAL});
gesture.get('pan').set({direction: DIRECTION_VERTICAL});
gesture.on('panstart', e => {
    ...
});
gesture.on('panmove', e => {
    ...
});
gesture.on('panend', e => {
     ...
});

@matijse Does this work on your code? I tried it but I get the error "ERROR TypeError: Cannot read property 'addEventListener' of null", even tough there is an element with the specified id. My code is in the ionViewDidLoad method.

@PavlosIsaris This code did work, but I used it some time ago (Ionic 2 RC3). It might not work in more recent versions of Ionic...
Also my code is in the ngAfterViewInit() method, not sure if this makes a difference.

import { Hammer } from "ionic-angular/gestures/hammer";
hammer: any = Hammer;
ionViewDidEnter() {
let gesture = Hammer(document.getElementById("element-to-drag"), { direction: this.hammer.DIRECTION_ALL });
gesture.get('pan').set({ direction: this.hammer.DIRECTION_ALL });
	gesture.on('panup', e => {
	});
	gesture.on('pandown', e => {
	});
	gesture.on('panleft', e => {
	});
	gesture.on('panright', e => {
	});
}

import { Hammer } from "ionic-angular/gestures/hammer";
hammer: any = Hammer;
ionViewDidEnter() {
	// gesture
	let gesture = this.hammer(document.getElementById("xxx"), { direction: this.hammer.DIRECTION_ALL });
	gesture.get('pan').set({ direction: this.hammer.DIRECTION_ALL });
	gesture.on('panleft panright panup pandown', e => {
		this.panEvent(e);
	});;
}

import { Hammer } from "ionic-angular/gestures/hammer";
hammer: any = Hammer;
ionViewDidEnter() {
// gesture
let gesture = this.hammer(document.getElementById("xxx"), { direction: this.hammer.DIRECTION_ALL });
gesture.get('pan').set({ direction: this.hammer.DIRECTION_ALL });
gesture.on('panleft panright panup pandown', e => {
});
}

pan etc have been enabled.？But how to use it?
http://ionicframework.com/docs/v2/components/#gestures，The document is too simple

@godzsa  because touch-action=:'pan-y’

@Palisanka  This may help you
https://stackoverflow.com/questions/29484146/simple-example-of-gesture-in-hammerjs

authors: 64jcl Despay PavlosIsaris danbucholtz godzsa jgw96 matijse mzl1988 philmerrell royipressburger zds-jack


text:
bug: [Bug] Run android err: request.getKeyTypes()

Type: bug
Ionic Version: 2.x
Platform: android 5.1 webview
This is the output of the ionic run android command with XWalk installed:

This issue was moved to driftyco/ionic-cli#1328

Hey! Since this issue is an ionic cli related issue and not an Ionic framework issue I have moved this issue to the appropriate repo. Thanks for using Ionic!

Ok thanks.


text:
bower unable to find  ionic nightly

Is this for v1 or v2? For v2 you need to use npm :)

for V1

Hello! Thanks for using Ionic! We moved ionic 1 to the 1.x branch a few months ago when Ionic 2 became the master branch. Thanks!