Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 16:36
    @CyrusNajmabadi banned @juliusfriedman
  • 08:23
    openpublishbuild removed as member
  • Feb 26 16:57

    Anipik on 3.1

    update branding to 3.1.14 (#281… (compare)

  • Feb 26 16:57
    Anipik closed #28151
  • Feb 26 16:57

    Anipik on 2.1

    update branding to 2.1.27 (#281… (compare)

  • Feb 26 16:56
    Anipik closed #28152
  • Feb 26 03:54
    Anipik review_requested #28152
  • Feb 26 00:17
    Anipik review_requested #28152
  • Feb 26 00:17
    Anipik review_requested #28152
  • Feb 26 00:17
    Anipik review_requested #28152
  • Feb 26 00:17
    Anipik opened #28152
  • Feb 26 00:16
    Anipik opened #28151
  • Feb 26 00:16
    Anipik review_requested #28151
  • Feb 26 00:16
    Anipik review_requested #28151
  • Feb 26 00:16
    Anipik review_requested #28151
  • Feb 24 15:52
    omajid synchronize #28130
  • Feb 22 22:30
    jeffschwMSFT milestoned #28149
  • Feb 22 22:30
    jeffschwMSFT labeled #28149
  • Feb 22 22:30
    jeffschwMSFT commented #28149
  • Feb 22 22:06
    mmitche commented #28149
Joseph Musser
@jnm2
@anthalon So to maybe to contribute the missing piece of the puzzle, you would use a container where you could register TestClass itself rather than resolving services from the container to call new TestClass.
Or, keep the code that calls new TestClass but keep IMyService as a field in that class that is required by the constructor.
Joe4evr
@Joe4evr
@anthalon the most straightforward way is one of the overloads of ActivatorExtensions.CreateInstance
Jose
@pepone
Action<ILogger, Dictionary<string, string>, Exception> _contextAction = LoggerMessage.Define<Dictionary<string, string>>(
            LogLevel.Information,
            new EventId(),
            "context = {Context}");

var logger = loggerFactory.CreateLogger("Default");
logger.LogInformation("context = {Context}", context);
_contextAction(logger, context, null!);

I was expecting this to be equivalent but seems the state is not serialized in the same way.

{
  "EventId": 0,
  "LogLevel": "Information",
  "Category": "Default",
  "Message": "context = [User, Jose]",
  "State": {
    "Message": "context = [User, Jose]",
    "Context": "[User, Jose]",
    "{OriginalFormat}": "context = {Context}"
  },
  "Scopes": []
}
{
  "EventId": 0,
  "LogLevel": "Information",
  "Category": "Default",
  "Message": "context = [User, Jose]",
  "State": {
    "Message": "context = [User, Jose]",
    "Context": "System.Collections.Generic.Dictionary\u00602[System.String,System.String]",
    "{OriginalFormat}": "context = {Context}"
  },
  "Scopes": []
}

Any idea why the first version State contains the serialized dictionary, and the second just the dictionary class name?

Jose
@pepone
Willow
@DarkAngel766
I'm trying to install svcutil for core 3.1. dotnet tool install --global dotnet-svcutil isn't working and I don't understand why. I get that nag telling me it can't find/install it. I've also tried dotnet tool install --global svcutil AND dotnet tool install --global Microsoft.dotnet-svcutil AND dotnet tool install --global Microsoft.svcutil. Am I doing something wrong or should I be debugging our firewalls?
Willow
@DarkAngel766
disregard. definitely a proxy issue
and a versioning issue
it doesn't support 3
Willow
@DarkAngel766
so, how do you add a SOAP service reference to .Net Core 3.x?
Willow
@DarkAngel766
by the time you get to 6, I suspect we will have mostly abandoned MS for open platform, since we have deadlines that cannot be met ("we" referring to a lot of folks/companies, not just me). Guys you need to do something about that
Stephen A. Imhoff
@Clockwork-Muse
.... since most people are abandoning SOAP in favor of REST, I doubt that.
Willow
@DarkAngel766
unless you're talking to IBM
or any subsidiary
know your market :p
Stephen A. Imhoff
@Clockwork-Muse
... and at least this SO question implies that it's possible.
Well yeah, IBM built up a huge business around Java SOAP web services (WAS)
If you're doing brand new work, though, go REST. If you have to interface with old stuff, you can write interceptors that modify the message.
Willow
@DarkAngel766
yup :( and they have the best number crunching machines in the business, so when you're processing in the billions of $, we don't really have a choice until quantum becomes common
this is an IBM service I'm connecting to
I figured it out. infosec nazis were making life miserable, so I turned it all off lol
Stephen A. Imhoff
@Clockwork-Muse
.... choice of API style has nothing to do with machine power.
Willow
@DarkAngel766
but it does have to do with who I have to talk to :\
I can't change IBM, only KeyCorp
Willow
@DarkAngel766
btw, in .Net Core 3.1, I had to install the svutil 2.0.3 preview for it to discover properly
just fyi
Ayandam2021
@Ayandam2021
.NET 6 coming soon
Jose
@pepone
Is there anyway to write JSON logs to a file using the built-in providers?
Willow
@DarkAngel766
you mean aside from File.AppendAllText(... ?
create an ILogger instance
Jose
@pepone
I don't see how to configure ILogger to write to a file instead of the console
Willow
@DarkAngel766
please give more details. what .net ver, app type
You implement a new logger using ILogger
that writes to a file
I do something similar for my global application log
Jose
@pepone
my question is about ILogger using the built-in providers, I don't want to implement a new ILogger does seems like too much work
Willow
@DarkAngel766
I don't know if ITraceListener is even still around, but that one was useful also
so, making a class and implementing an interface to write to a file is a lot of work?
I think you're making much ado about nothing
BK
@Bilal-io
Hello, general question if anyone can help
How to Dependency inject and resolve providers of the same type using Unity, and be able to choose to use any of the providers in a project.
Jose
@pepone
@DarkAngel766 it is not as simple as you make it sound, JsonConsoleFormatter provides functionality that I don't want to reimplement myself, then writing a separate ILogger implementation that supports structured logging and multithreading is more work, and not something that each application should do, better use a framework implemented type that is well supported.
maybe EventSourceLoggerProvider can do what I need but not sure
Willow
@DarkAngel766
well, good luck then :)
HaloFour
@HaloFour
I would imagine that there are a number of off-the-shelf JSON logging formatters, e.g. ECS or the like.
Jose
@pepone
@HaloFour what is ECS?
Willow
@DarkAngel766
as of yesterday, we've dropped MS due to an inability to maintain a common codebase. Specifically, calling convention changes and sunsetting after only one year makes it impossible for any company with real security to approach this tech stack until net6. It's foundation classes all over again... I hope, as a company, you take this into consideration for future planning. We are a multi-billion dollar conglomerate working in conjunction with our peers in the fintech industry to evaluate and determine the efficacy of your platform. Your pace, while "cool" is not supportable in our world. When 3.1 came out, dev began for the first POC. It will go to production in a month lol! We'll be replacing the entire site after that with existing supported open platform tech (back to java) as the required changes for migration in dotnet are already too voluminous.
HaloFour
@HaloFour
Sounds about right, especially if you need to rely on older techs that aren't getting priority as the Core framework continues to roll forward. You'll find the same issues in the Java world. Can't mix SOAP and Reactor either, at least using any built-in tools. Nobody is bothering to update "dead" technologies to newer frameworks. You might even find it problematic to use them with JMS if nobody bothered to try to get them over the modularization hump, which is why the vast majority of Java code is still stuck in Java 8 despite Java 16 coming out in less than a month. There are two sides to the bleeding edge, too new and too old.
Muhammad Kamran Asim
@mKamiAsim
Hello Guys. I am working on .Net 5 wpf. I have ViewModel resolved via Transient Service. Viewmodel contains Html content which occupy memory. I noticed that when I close UserControl. Viewmodel is not disposed. Application still occupy memory. and reopening same screen, Memory is consumed more