How do I stop Visual Studio from inserting “object” when I type “new {”

前端 未结 5 1866
轻奢々
轻奢々 2020-12-15 23:53

When editing a C# source file, I type

new {

Visual Studio auto-corrects it to

new object{

Is there a way

5条回答
  •  Happy的楠姐
    2020-12-16 00:06

    What are you typing before the new {?

    I've just tried it and it auto-completes with the object type, so if I type:

    Button test = new { 
    

    it becomes:

    Button test = new Button{
    

    But if I type:

    var test = new {
    

    it leaves it alone.

    I haven't configured my VS2008 install in any way.

提交回复
热议问题