Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 03:49
    msftbot[bot] milestoned #66699
  • 03:49
    msftbot[bot] milestoned #66699
  • 03:49

    CyrusNajmabadi on main

    Do not suggest replacing lambda… Merge pull request #66699 from … (compare)

  • 03:49
    CyrusNajmabadi closed #63464
  • 03:49
    CyrusNajmabadi closed #66699
  • 03:11
    DoctorKrolic commented #66699
  • 02:41
    CyrusNajmabadi synchronize #66706
  • 02:40
    CyrusNajmabadi review_requested #66706
  • 02:18
    msftbot[bot] milestoned #66708
  • 02:18
    msftbot[bot] milestoned #66708
  • 02:17

    jaredpar on main

    Enable MSBuild COMM log (#66708… (compare)

  • 02:17
    jaredpar closed #66708
  • 02:12
    marknuzz commented #26934
  • 01:52
    CyrusNajmabadi synchronize #66706
  • 00:52
    paul1956 closed #7698
  • 00:52
    paul1956 commented #7698
  • 00:49
    CyrusNajmabadi synchronize #66706
  • 00:48
    paul1956 closed #4067
  • 00:48
    paul1956 commented #4067
  • 00:44
    jasonmalinowski synchronize #66709
timiil
@timiil
oh, sounds bad. sounds that related by IDE, but not dotnet CLR
Bernd Baumanns
@bernd5
you could write a simple console app which loads the original source and produces "obfuscated" source which is than compiled to IL via the normal build pipeline
Yes, CodeFixes are IDE related - but what you want is not IDE related
timiil
@timiil
thanks for your kindly reply, a lot of knowlege knowed toninght and i should keep learning more
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"