Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 20:55
    CodeSetting commented #66713
  • 20:13
    CyrusNajmabadi commented #66713
  • 19:39
    CodeSetting commented #66713
  • 19:39
    CodeSetting closed #66713
  • 19:39
    CodeSetting commented #66713
  • 19:31
    dotnet-issue-labeler[bot] labeled #66713
  • 19:31
    dotnet-issue-labeler[bot] labeled #66713
  • 19:31
    CodeSetting opened #66713
  • 16:34
    TomatorCZ commented #66309
  • 16:33
    TomatorCZ synchronize #66309
  • 16:29
    TomatorCZ edited #66309
  • 16:29
    TomatorCZ edited #66309
  • 16:25
    TomatorCZ synchronize #66309
  • 14:05
    TomatorCZ synchronize #66309
  • 14:04
    TomatorCZ synchronize #66309
  • 13:48
    dotnet-maestro[bot] synchronize #66342
  • 13:48
    dotnet-maestro[bot] edited #66342
  • 13:48

    dotnet-maestro[bot] on darc-main-01aa6f43-60c3-41ad-b4bb-10decf78d278

    Update dependencies from https:… (compare)

  • 13:45
    yufeih synchronize #66712
  • 13:24
    dotnet-maestro[bot] edited #65141
Bernd Baumanns
@bernd5
When you write your obfuscator you have to care about e.g. nameof() and reflection
because those names would change, too.
If you need further help - please ask.
timiil
@timiil
sure , very thanks :)
Yair Halberstadt
@YairHalberstadt
@timiil most obfuscators work with raw IL. They already exist so not sure why you would roll your own
timiil
@timiil
one reason is , IL changing this very hacking, and the opensource solution is so few amount.
Yair Halberstadt
@YairHalberstadt
Modifying IL is much safer, since it's easier to know what's safe to change and what's not.
Bernd Baumanns
@bernd5
yes - on IL level getting all semantics is quite complicated
but renaming locals would be very simple for example
Yair Halberstadt
@YairHalberstadt
For example you might rename an internal method named GetEnumerator and break a foreach.
timiil
@timiil
the second reason is , i think we have the source code, so if we use some skillful rewrite rule onto the sourcecode, and then build from roslyn, that sounds is very ...Nature
Bernd Baumanns
@bernd5
@timiil should the produced assembly be usable by other assemblies?
timiil
@timiil
who is behind 'dotnet build' ?? is 'MSBuild' or 'roslyn'
Bernd Baumanns
@bernd5
both 😃
MSBuild calls roslyn
timiil
@timiil

@timiil should the produced assembly be usable by other assemblies?

yes, that is exectly what i thinking on.

Bernd Baumanns
@bernd5
Than GetEnumerator would break not only on source level - but on IL level, too.
timiil
@timiil
and as we know, we even have opensource dotnet decomplier
Bernd Baumanns
@bernd5
You mean ILSpy?
timiil
@timiil
so , the pluzzle may be , decomplie -> rewrite source text -> complie on the air -> use it ?
Bernd Baumanns
@bernd5
not really
decompiling is quite hard
yes , sir
Bernd Baumanns
@bernd5
Some symbols can't be represented as regular csharp code
timiil
@timiil
yes , your are right. that maybe not 100% perfect
Bernd Baumanns
@bernd5
you loose (some) data after compilation
timiil
@timiil
@bernd5 i found https://github.com/JosefPihrt/Roslynator may be fun for CodeFix testing in command line
Chandraprakash
@frozenprakash
does anyone know where is the proposal for Property extension in C#?
Presently we only have function extension
Like string.CountNew rather than string.CountNew()
CyrusNajmabadi
@CyrusNajmabadi
Currently, it's rolled into:
Chandraprakash
@frozenprakash
Wow, Thanks for the link man
CyrusNajmabadi
@CyrusNajmabadi
sure :)
timiil
@timiil
how about the 'left assigment expression attribute' ?? any one have the same idea ?
var btnYes = ControlFactory.Create<Button>();          //the method has know that the assigment expr is 'btnYes' so give it to  the Name porperty
CyrusNajmabadi
@CyrusNajmabadi
?
timiil
@timiil
the 'Caller Expression Attribute' give us the expr in the argument; i am looking for a way to know what is the 'Left Assigment Variable Name'
CyrusNajmabadi
@CyrusNajmabadi
yeah, there's nothing for that
also, it doesn't really feel like a well-formed operation
consider something as basic as: Foo(ControlFactory.Create<Button>())
there's no 'left assignment variable name'
timiil
@timiil
can we just 'home made' an attribute for this ? any idea or suggestion ?
CyrusNajmabadi
@CyrusNajmabadi
using source generators, you could potentially look for this pattern, then emit a special string constant somewhere.
so you could use CAlledFilePath and CallerLineNumber to pass in the line/file of where that call was
then, your SG also generates a static dictionary that taht method can then look up into with that File/Line to get the name "btnYes"
in other words, you'd have a Dictionary<(string filePath, int lineNumber), string>
this would only work if you had at most one of these on a line.
Yair Halberstadt
@YairHalberstadt
@CyrusNajmabadi I have a proposal for CallerColumnNumber for exactly this use case