locked
"Overriding" a built-in project type RRS feed

  • Question

  • Hi,
    I would like to "override" the default CSharp project type (handling the csproj project extension).
    The only way I've found so far to do this is by directly changing the value of the "Package" string value in the registry under the default CSharp project type registration.
    Of course I'm doing it for the experimental hive and actually it works but is there some other "offical" way for doing such things?

    If I just create a new project type, again for the csproj extension, it doesn't override the default one and VS continues using the default project type when opening C# projects. 

    Thanks in advance.
    Friday, August 29, 2008 7:29 AM

Answers

  • I'm not sure about what exactly you want to achieve this. Could you please elaborate?

    The only way for customizing the existing C# project type is Project Subtypes. For more information, please visit the following references:
    Project Subtypes Design
    VS 2005 Project Subtypes

    Hope this helps.

    Thanks.

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    • Proposed as answer by Feng Chen Saturday, August 30, 2008 3:31 AM
    • Marked as answer by Feng Chen Monday, September 1, 2008 2:16 PM
    • Unmarked as answer by Feng Chen Monday, September 1, 2008 2:16 PM
    • Marked as answer by Jeff_G Monday, September 1, 2008 2:28 PM
    Friday, August 29, 2008 9:18 AM
  • Now I'm trying to create my own project factory to handle the csproj files
    .csproj file are already associated with the existing C# project system.

    the only workaround I've found so far is the one I've described in my previos post which unfortunately looks like a hack to me.
    This is not documented and supported.

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    • Marked as answer by Feng Chen Monday, September 1, 2008 2:16 PM
    Friday, August 29, 2008 3:23 PM
  • Hi Jeff,

    This isn't a supported scenario. Unlike editor factories, where you can have more than one editor factory associated with a particular file extension, there are currently no provisions for supporting different project factories for a specific project extension. Unfortunately, I only found this out after one of our partners found they had used a project file extension identical to one that MS had already shipped.

    We do have this logged into our bug database, but it's not something that we can readily address without some major design changes, and some big risks of breaking a lot of project types already out in the wild.

    Your best bet in the scenario would be to use an extension different from the .csproj file extension.

    Sincerely,
    Ed Dore
    Saturday, August 30, 2008 3:06 AM

All replies

  • I'm not sure about what exactly you want to achieve this. Could you please elaborate?

    The only way for customizing the existing C# project type is Project Subtypes. For more information, please visit the following references:
    Project Subtypes Design
    VS 2005 Project Subtypes

    Hope this helps.

    Thanks.

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    • Proposed as answer by Feng Chen Saturday, August 30, 2008 3:31 AM
    • Marked as answer by Feng Chen Monday, September 1, 2008 2:16 PM
    • Unmarked as answer by Feng Chen Monday, September 1, 2008 2:16 PM
    • Marked as answer by Jeff_G Monday, September 1, 2008 2:28 PM
    Friday, August 29, 2008 9:18 AM
  • I want to replace the default C# language service with my own custom C# language service. The problem is that the default C# project type is tightly coupled with the default C# lang. service and that's why I can't replace just one part. Or at least I still haven't found a way to do this.

    Now I'm trying to create my own project factory to handle the csproj files, just like the one coming with the IronPython sample project. I had a problem trying to make Visual Studio use my project factory for the csproj files instead of the default C# project factory and the only workaround I've found so far is the one I've described in my previos post which unfortunately looks like a hack to me.

    I don't think project subtypes could help me with this as in my scenario I wouldn't like to extend a project type but rather replace an already existing project type.

    Friday, August 29, 2008 10:17 AM
  • Now I'm trying to create my own project factory to handle the csproj files
    .csproj file are already associated with the existing C# project system.

    the only workaround I've found so far is the one I've described in my previos post which unfortunately looks like a hack to me.
    This is not documented and supported.

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    • Marked as answer by Feng Chen Monday, September 1, 2008 2:16 PM
    Friday, August 29, 2008 3:23 PM
  • Hi Jeff,

    This isn't a supported scenario. Unlike editor factories, where you can have more than one editor factory associated with a particular file extension, there are currently no provisions for supporting different project factories for a specific project extension. Unfortunately, I only found this out after one of our partners found they had used a project file extension identical to one that MS had already shipped.

    We do have this logged into our bug database, but it's not something that we can readily address without some major design changes, and some big risks of breaking a lot of project types already out in the wild.

    Your best bet in the scenario would be to use an extension different from the .csproj file extension.

    Sincerely,
    Ed Dore
    Saturday, August 30, 2008 3:06 AM
  • Hi Ed,
    Thanks for elaborating on this.
    Monday, September 1, 2008 6:36 AM