Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Eugene
@JohnyL
@steveharter As for your answer. Yes, I have mentioned using JsonSerializeralready in my dotnet/runtime#54158. But what is CreateFromObject you have mentioned? Is it about to appear in API?
Paul M Cohen
@paul1956
Will the SourceGenerator for JSON be available for VB as well?
masonwheeler
@masonwheeler
Isn't VB.NET basically "in maintenance mode" now?
Paul M Cohen
@paul1956
@masonwheeler No, in fact is just got Source Generators and support for System.JSON.
CyrusNajmabadi
@CyrusNajmabadi
Yeah. Vb is not in maintenance mode.
It's currently in active development.
masonwheeler
@masonwheeler
OK, maybe not. Don't remember where, but I definitely heard someone say that a few months ago. I guess they were wrong.
Paul M Cohen
@paul1956
None of that answered the original question about VB source generator for JSON.
akima15
@akima15

We have detected that your app is incompatible with Windows 10 S. Please update your app to support Windows 10 S if possible. Otherwise include a prominent statement anywhere in the Metadata that the app does not support Windows 10 S. This issue may affect merchandisability.

This seems to be the reason after enabling "SiPolicy_Audit.p7b":

Code integrity determined that a process x attempted to load
dotnet\shared\Microsoft.NETCore.App\5.0.9\System.IO.FileSystem.dll
dotnet\shared\Microsoft.NETCore.App\5.0.9\System.Diagnostics.FileVersionInfo.dll
dotnet\shared\Microsoft.NETCore.App\5.0.9\System.Text.RegularExpressions.dll
dotnet\shared\Microsoft.NETCore.App\5.0.9\System.Text.Json.dll
that did meet the Custom 1 signing level requirements or violated code integrity policy (Policy ID:{A244370E-44C9-4C06-B551-F6016E563076}). However, due to code integrity auditing policy, the image was allowed to load.

So this means every app made with NET5 can't run in Windows 10 S Mode? Is this normal? o.o

Michael W Powell
@mwpowellhtx
Q: does anyone have any ideas what the migration path for netstandard target assemblies is in light of the coming .NET 6? I've asked in a couple of forums and gotten ambiguous responses leading me to believe that, "there is no migration path", but what does this mean in light of 6? what is the proposed solution to that issue? thanks...
Joe4evr
@Joe4evr
@mwpowellhtx the migration path is simply having your libraries target .NET 5/6 (where possible)
Michael W Powell
@mwpowellhtx
@Joe4evr thanks, after drudging up a couple of odd blogs about it, figured that might be the case. what I am more miffed at is the politicking dance. if this is known, then that is a fairly direct answer I think. i.e. multitarget your assemblies, possibly, i.e. netstandard2.x and /or net5.0 and/or net6.0, along these lines. Not counting target choices, which API surface areas are appropriate, etc.
CyrusNajmabadi
@CyrusNajmabadi
@mwpowellhtx this is what i mentioned to you when you asked :)
Ciaran ODonnell
@ciaranodonnell
Is this the right room for a Gitter noob to ask questions about source generators? And why my generator that generates a property ends up with an entry in the Error Window saying "The type 'TestEntity' already contains a definition for 'TestProperty'" but I can't access the generated property in code.
Michael W Powell
@mwpowellhtx
@CyrusNajmabadi sorry, must've gotten swamped amid other unrelated bits. never saw it, but I appreciate the response.
CyrusNajmabadi
@CyrusNajmabadi
no worries
Michael W Powell
@mwpowellhtx
I have been unable to download VS 2019 16.11.4build version 16.11.31727.386. The page 'loads' but nothing happens after that. I try click here to retry and nothing happens. Based on a gitter response, tried Firefox, also Chrome, same result. Anyone else experiencing the same? Is there a workaround? Thank you...
Mohammad Hamdy Ghanem
@VBAndCs
In StringBuilder methods Like Append, passing strings by value seems unnecessary overhead as it involves copying the string (it will not always a string literal). In fact all string params sent to SB methods should be byRef. This will not break VB code but will brake C# code, which lead us to a question: Why must C# compiler be such a stupid to require the ref keyword? why can't it be optional and the compilers add it when necessary, esp that we can't send a ref to a value param, and can't send a value to a ref param?
Why must we use a less optimum methods just because C# compiler has no brain?
Stephen A. Imhoff
@Clockwork-Muse

passing strings by value seems unnecessary overhead as it involves copying the string (it will not always a string literal)

Strings (and everything else descended from object) are reference types. When you pass one of them, you're passing a pointer in memory to the data of the object, not the data itself; you're already passing a reference.

You maybe save the cost of copying the value of the reference (I don't know how compilers actually handle this).
Stephen A. Imhoff
@Clockwork-Muse

Why must C# compiler be such a stupid to require the ref keyword?

It's a deliberate choice that most languages with similar features have also made. It's a form of explicitness about possible behavior.

Mohammad Hamdy Ghanem
@VBAndCs
What I know is that string is copied by value. It is an object but has some special rules to make using it easier.
Stephen A. Imhoff
@Clockwork-Muse
Why do you think it's copied by value?
(Note that even if the string object itself was copied by value, that doesn't mean that its contents were, since it uses an array/pointer-to to store the actual data, which means there's at least one other reference involved anyways)
Stephen A. Imhoff
@Clockwork-Muse
If by "copied by value", you mean "the contents of the string are copied into the string builder" - it has to: the string builder can remove characters from the middle of its buffer, which you couldn't do if you only maintained a reference to a string.
Michał Zegan
@webczat
@Clockwork-Muse actually string is really special I think. it does not reference an array of chars but somehow seems to embed the contents inside of it. but the rest of it is correct from what I can tell
masonwheeler
@masonwheeler
The string object reference is copied by value. Strings passed to methods do not have their contents copied. The contents of the string are copied when you insert a string into a StringBuilder because that's inherent to the nature of StringBuilder functionality, but this is not how string passing works in the general case.
CyrusNajmabadi
@CyrusNajmabadi
In StringBuilder methods Like Append, passing strings by value seems unnecessary overhead as it involves copying the string (it will not always a string literal)
this is not true.
What I know is that string is copied by value. It is an object but has some special rules to make using it easier.
there is no copying going on here.
when you pass a string around, you are effectively passing a pointer around to the single place in memory where the data is stored.
why can't it be optional and the compilers add it when necessary
because it's very valuable (in our opinion) that people be able to know when variables are passed by ref or not.
It's extremely different to me if i call:
DoFrob(myStr) vs DoFrob(ref myStr)
with teh latter i will assume that DoFrob will actually change my variable. Where with the former i know it cannot.
This will not break VB code
This would break existing VB programs as well. The ABI would change, which would render all existing programs out there non-functional. It would require recompiles of all programs to deal with this.
Stephen A. Imhoff
@Clockwork-Muse
That's beside any silent breaks due to somebody recompiling with unchanged source, but it turns out the reassign the parameter inside the method and now weird things happen. Good luck tracking down errors from that...
Joe4evr
@Joe4evr

You maybe save the cost of copying the value of the reference (I don't know how compilers actually handle this).

of note, this may even cause more overhead in certain scenarios, altho most-if-not-all of those are when it involves pointer-sized structs

John Moreno
@jrmoreno1
“In StringBuilder methods Like Append, passing strings by value seems unnecessary “ String is a class and as with all classes, passing “by value” passes a reference/pointer. For classes there is effectively no performance difference between by ref and by value, all that changes is what the pointer points to.
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
John Moreno
@jrmoreno1
@VBAndCs : I know it’s been a few months, but your comment on ByRef vs ByVal shows a fundamental misunderstanding of how those work. For classes there is effective no performance difference, for large structs (which string is not) there can be a huge performance difference, which is why ref structs were added to C#. Lots of VB code gets ByRef wrong because VB6’s default was ByRef in an attempt to shield the developer from needing to know when and how to use ByRef, although that lead to its own problems.
Michael W Powell
@mwpowellhtx
Q: re: Entity , is there a way to interface with stored procedures (i.e. MSSQL stored procedures) in order to feed an ObjectResult<?> (is that a thing in the latest versions?), I'm not sure I saw how to do that in the EF core packages. Thank you...
Michael W Powell
@mwpowellhtx
Following up, for the time being, I am targeting netcore 3.1, which apparently makes a difference, there is no EF6 migration path there, with the examples I am seeing, i.e.
SqlParameter parameter1 = new SqlParameter("@Parameter1", "Value");
context.Database.SqlQuery<YourType>("exec usp_StoredProcedure @Parameter1", parameter1).ToList()
but how do I do that circa EF 5.0.13? is it possible?
Michael W Powell
@mwpowellhtx
figured it out in the currently used versions.