Remove project reference programmatically using C# RRS feed

  • Question

  • Hi

    I want to remove "Microsoft.VisualBasic" and "Microsoft.VisualBasic.Compatibility" reference from a VB.Net project programmatically using C#. In C# application I will just provide the VB.Net project path and both the references should be removed. Any link or code will be highly appreciated.


    • Changed type Mike Feng Monday, May 20, 2013 2:59 PM
    Friday, May 17, 2013 6:09 AM


  • Easiest approach is to just open the file as XML and remove the references.

    Alternatively there is the Microsoft.Build.Construction namespace but from my understanding the types that are needed are internal so I don't know how you'd get started with it.  Some folks have wrapped the internal types but this could be dangerous.

    Michael Taylor

    • Proposed as answer by Mike Feng Monday, May 20, 2013 3:00 PM
    • Marked as answer by Mike Feng Wednesday, May 22, 2013 4:13 PM
    Friday, May 17, 2013 2:21 PM