Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Nov 29 18:58
    vseanreesermsft closed #28281
  • Nov 29 18:43
    vseanreesermsft opened #28281
  • Nov 21 22:13
    agocke closed #28246
  • Nov 21 22:13
    agocke commented #28246
  • Nov 18 08:48
    davmason closed #28229
  • Nov 18 08:48
    davmason commented #28229
  • Nov 18 01:38
    carlossanlop commented #28246
  • Nov 18 01:38
    carlossanlop commented #28229
  • Nov 18 01:37

    carlossanlop on 3.1-96a2b988-b92e-4b95-8b07-a005dbe526ba

    (compare)

  • Nov 18 01:37
    carlossanlop closed #28241
  • Nov 18 01:37
    carlossanlop commented #28241
  • Nov 14 19:36
    carlossanlop commented #28246
  • Nov 09 18:50

    carlossanlop on 3.1

    Merge in 'release/3.1' changes Merge in 'release/3.1' changes Merged PR 26445: Restrict named… and 3 more (compare)

  • Nov 09 18:50
    carlossanlop closed #28279
  • Nov 09 18:29
    dotnet-maestro[bot] synchronize #28241
  • Nov 09 18:29

    dotnet-maestro[bot] on 3.1-96a2b988-b92e-4b95-8b07-a005dbe526ba

    Update dependencies from https:… (compare)

  • Nov 09 18:29
    dotnet-maestro[bot] edited #28241
  • Nov 08 19:53

    hoyosjs on 3.1-crossdac

    [release/3.1] Add signing infra… Update branding to 3.1.31 (#282… Merge in 'release/3.1' changes and 8 more (compare)

  • Nov 08 19:53
    hoyosjs closed #28280
  • Nov 08 19:07
    hoyosjs review_requested #28280
Joe4evr
@Joe4evr
@timiil if you use the property-target specifier, you should be able to find it on PropertyInfo:
Product([property: Category("UI")] string ID, [property: Description("it is a name")] string Name);
you can play around with the code to see where the attributes are applied here
timiil
@timiil

you can play around with the code to see where the attributes are applied here

thanks you , it is work :)

timiil
@timiil
(netavataaar:4086): Gtk-CRITICAL **: 16:31:44.511: gtk_application_new: assertion 'application_id == NULL || g_application_id_is_valid (application_id)' failed Unhandled Exception: System.ArgumentException: Parameter is not valid. at System.Drawing.Text.FontCollection.get_Families() + 0x1b4
Mikkel Kruse Johnsen
@mikkeljohnsen
Is it possible to set a path to look for "DLL" assemblies when starting an exe file (.NET6) ?
In .NET48 it seems that I could set AppDomain.CurrentDomain.AssemblyResolve and that would handle it for me. But with .NET6 it is not run
AssemblyLoadContext.Default.Resolving is not run either
Markus Schaber
@markusschaber

About the .NET interfaces for the "observer pattern":

There are some use cases where the observer needs to both get the current state, as well as subscribe to changes. As this are two independent calls to the provider, there's a race condition where, depending on the order of the calls, the observer may either miss notifications, or get notifications which are already outdated regarding the "current state" he fetched.

The observer interface, as defined by System.IObservable<T>, does not provide a solution for this problem.

One solution is to provide an alternative Subscribe()-Method which returns a tuple containing both the current state and the IDisposable used to unsubscribe. (There are also other use cases where one wants to pass additional parameters to Subscribe(), although those cases can be workarounded: parametrize a factory method for an explicitly created IObservable<T>, at the cost of an extra method call and allocation.

This, I filed an issue (dotnet/docs#28299). But the question arised whether that really is a documentation issue, or more an API change / extension to be filed in the runtime repo.

My thought is that it should suffice to document the possibilities to extend the pattern by extending the Subscribe() method (additional parameters for subscription, tuple as result). I don't see the need for additional interface definitions like IObservableWithExtraParameters<T, TParams>, IObservableWithExtraResult<T, TResult> and IObservableWithExtraParametersAndResult<T, TParams, TResult> in the runtime library.

Or is there a better way to fulfill the requirements (atomically subscribe and get the current state) which I just didn't see?

What do you think?

HaloFour
@HaloFour
I think that race condition exists either way as you could call subscribe after the state has changed and would only observe the current value, not the previous value. My experience with observables is that the majority of the time they have no current state, they represent a cold reactive flow that isn't materialized until subscribed.
6 replies
Stephen A. Imhoff
@Clockwork-Muse
... whenever one of the CVEs gets posted to the repository, I always want to see what they changed to fix it...
Romber
@Rombersoft
Hi guys. Does know anybody how to work with url as parametr of GET HTTP request?
I use NET Core 6 method MapGet("/index/{url}", (string url)=>{...}
But when I pass localhost:8080/index/https://gitter.im/dotnet that does not work (JS fetch gets 404 error)
And when I pass localhost:8080/index/dotnet that works
I've already use google help but found nothing
Steve
@hez2010
Use /index/{**url} instead.
Also note that the parameter url is nullable-aware: string? url and string url will yield different behavior.
Romber
@Rombersoft
Great! Why do not I came up with myself? Thank you very much!
Hugh Gleaves
@Korporal
is there anything akin to a conventional Windows OS Service, in .Net Core?
For example a process that can be started when the OS boots and stays up indefinitely and so on.
Erbynn (Erb) John Kwesi
@pkErbynn

I am run a CLI self-contained, single file published programmatically in dotnet core 3.1 with the appHost service to generate the bundler, and and the generated .exe bundler runs perfectly fine in the 3.1.

public class AppHostService : IAppHostService
    {
        public async Task ConvertLauncherToBundle(string bundleName, string bundleDirectory, string appHostDirectory, string resourceassemblyPathResult)
         {
            var appHostDestinationFilePath = Path.Combine(appHostDirectory, bundleName);
            await Task.Run(() => HostWriter.CreateAppHost(appHostSourceFilePath, appHostDestinationFilePath, appBinaryFilePath, assemblyToCopyResorcesFrom: resourceassemblyPathResult));

            var bundler = new Bundler(bundleName, bundleDirectory);
            await Task.Run(() => bundler.GenerateBundle(appHostDirectory));
        }

        // path to bin/win-64
        private string appHostSourceFilePath => Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "AppHost", "apphost.exe");
        private string appBinaryFilePath => "MyApp.dll";

I upgraded to .NET 6.0 with the same appHost service and now when I run the published app it silently fails with a generic error message without pointing out where it fails. Below is the error message:

Failure processing application bundle.
Bundle header version compatibility check failed. Header version: 1.0
A fatal error occured while processing application bundle

I there anything I am missing here?

Hugh Gleaves
@Korporal
I have a question, I don't think I ever found a definitive clear answer, perhaps someone here can, its connected with .Net F not .Net C
I have an app that includes and uses a package RestSharp 106, the app also includes and uses another package that package also uses RestSharp but v 104.
When we build the app it pulls both packages RestSharp 106 and the other package that itself uses RestSharp 104
In the bin folder of course, we see only RestSharp 106 DLL
At runtime, when the app invokes a method in the other package, that causes an attempt to load RestSharp 104, which is not present in the bin folder and so we get an exception
What is/was the MS way to handle this?
Harald Kjær Nielsen
@hknielsen
Can I somehow create a string, based on data thats already prepared? We have a bunch of strings in native. Instead of the String to do a new alloc, it would be super nice if it could just be created based on that data. Even using new string(char*), it will do copy of the whole thing. String.Create also do a FastAllocateString. Or could one do it somehow when marshalling
Markus Schaber
@markusschaber
As far as I can see, the internal structure of strings in .NET requires the data to be "inline" in the string object, it cannot reference external data.
Harald Kjær Nielsen
@hknielsen
Yeah that was also my conclusion :/. One thing that would be really nice is if we could use ref structs for String.Create. But since its takes an Action it cant today
Markus Schaber
@markusschaber
Hmm. As far as I can pass arbitrary parameters as TState. So you can do whatever you need within your Action?
https://docs.microsoft.com/de-de/dotnet/api/system.string.create?view=net-6.0#system-string-create-1(system-int32-0-system-buffers-spanaction((system-char-0)))
(If you need to pass several parameters, you could pass them as tuple (a,b,c)
PavelKochkin2
@PavelKochkin2
Hi guys, is it possible to get versions of packages, referenced in my .net core solution? Trying to use Assembly class, but no luck so far
Isobel Cullen
@isobel-cullen
if I have a method with a param of type Enum is there a simple way to get the value of the underlying integer ?
CyrusNajmabadi
@CyrusNajmabadi
@isobel-cullen cast it to the underlying type
(int, long, byte, etc.)
REAL LIFE
@sonavaneashish33_gitlab
1net
Isobel Cullen
@isobel-cullen
@CyrusNajmabadi can't cast System.Enum to those types
CyrusNajmabadi
@CyrusNajmabadi
@isobel-cullen Convert.ToInt32
Isobel Cullen
@isobel-cullen
Oh, duh. Thanks!
pn04
@pn04
Hello Guys, I have a long running workload that downloads a file from a REST endpoint. Host closes the connection after 5 min of inactivity as http client is not sending any tcp keep-alive packets. I found out that it is possible to configure this when using HTTP/2 : dotnet/runtime#31198 , but is there any way to achieve it when using HTTP/1.1?
Garo Keshishian
@Keshish

Hey guys,
I have the following Model,
and trying to get the Content Part from it,

public class ChallengeApplication : ContentPart
{
public UserPickerField Challenge { get; set; }
public BooleanField IsTeamFinalized { get; set; }
public BooleanField HasStudentAppliedWithTeam { get; set; }
public TextField StudentTeammates { get; set; }
public ContentPickerField TeamMembers { get; set; }
}

var challenges = (await _session.QueryContentItem(PublicationStatus.Published, ContentTypes.Challenge) .ListAsync()).ToList(); var challengesPart = challenges.As<Challenge>();

    var challengeIds = challenges.Select(item => item.ContentItemId);
    var applications = await _session.QueryContentItem(PublicationStatus.Published, ContentTypes.ChallengeApplication)
        .With<ContentPickerFieldIndex>(index =>
            index.ContentField == nameof(ChallengeApplication.Challenge) &&
            index.ContentPart == nameof(ChallengeApplication) &&
            index.SelectedContentItemId.IsIn(challengeIds))
        .ListAsync();`

now if I try var appliactionParts = applications.As<ChallengeApplication>();
can't access to the challenges, even
var isTeam = applicationPart.IsTeamFinalized; I get null

ehsan
@ehsandavari
Piotr Osłowski
@piotrek77
hi
deveshbahuguna
@deveshbahuguna
Hi Folks, does anyone know what is the priority of GC and finalizier thread if realtime scheduling is applied in Linux?
Olly Atkins
@oatkins
Quick question about the new Regex source generator... I have a .yaml file containing a lot of regexes. Is there any way to generate code from this? If generators could be chained, I would write a generator to emit methods that would, in turn, be processed by RegexGenerator. I suspect the easiest thing would be to write my code gen using the old .tt file technology. Then the .NET generator would see it as regular code. But it's not beautiful. Am I missing something better?
Stephen A. Imhoff
@Clockwork-Muse
Given that file is in an archived repository, maybe just gen it once? Don't live gen the use of RegexGenerator.
Or wait, could you just manually call/set up the regex generation yourself? That is, don't write out RegexGenerator, run it, and store the results of what it generates instead.