Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 17:15
    runfoapp[bot] edited #64672
  • 17:15
    runfoapp[bot] edited #64672
  • 17:09
    dotnet-issue-labeler[bot] labeled #66643
  • 17:09
    jjonescz opened #66643
  • 17:07
    mirekkukla commented #41286
  • 17:02
    tmat synchronize #66599
  • 17:02
    tmat synchronize #66599
  • 17:01
    runfoapp[bot] edited #64672
  • 17:01
    runfoapp[bot] edited #64672
  • 16:57

    jjonescz on jjonescz

    Add `ExternalAccess.RazorCompilā€¦ Add a test Update host output node and 1 more (compare)

  • 16:56
    CyrusNajmabadi closed #46214
  • 16:56
    CyrusNajmabadi commented #46214
  • 16:53
    dotnet-issue-labeler[bot] labeled #66642
  • 16:53
    CyrusNajmabadi review_requested #66642
  • 16:53
    CyrusNajmabadi opened #66642
  • 16:45
    runfoapp[bot] edited #64672
  • 16:45
    runfoapp[bot] edited #64672
  • 16:32
    jjonescz synchronize #66570
  • 16:31
    jjonescz synchronize #66636
  • 16:31
    dotnet-issue-labeler[bot] labeled #66641
Bernd Baumanns
@bernd5
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
CyrusNajmabadi
@CyrusNajmabadi
:D