Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 03:45
    mavasani synchronize #58835
  • 03:28
    mavasani commented #66527
  • 03:02
    dotnet-bot auto_merge_enabled #66617
  • 03:02
    dotnet-bot commented #66617
  • 03:02
    dotnet-bot assigned #66617
  • 03:02
    dotnet-bot labeled #66617
  • 03:02
    dotnet-bot labeled #66617
  • 03:02
    dotnet-bot labeled #66617
  • 03:02

    dotnet-bot on release

    (compare)

  • 03:02
    dotnet-bot review_requested #66617
  • 03:02
    dotnet-bot opened #66617
  • 02:15
    jmarolf synchronize #65641
  • 02:05

    dotnet-bot on 9a55112c-1272-408e-ba20-b8dd094750d3

    (compare)

  • 01:48

    dotnet-bot on 9a55112c-1272-408e-ba20-b8dd094750d3

    (compare)

  • 01:47
    Cosifne auto_merge_disabled #66613
  • 01:47
    Cosifne auto_merge_enabled #66613
  • 01:23

    dotnet-bot on dev17.5-vs-deps

    Fix serialization of CSharpIdeC… Merge pull request #66611 from … (compare)

  • 01:23
    dotnet-bot closed #66611
  • 01:04

    Cosifne on main

    Add serializer for bool?, enum,… (compare)

  • 01:04
    msftbot[bot] milestoned #66526
Bernd Baumanns
@bernd5
CodeFix is more than you need - a CodeFix adds some VS integration code
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