1

This is my first time when i came across something like this. For the longest time whenever I want to precisely know the type of the project I use the guidance provided in the link below:

How do you tell the Visual Studio project type from an existing Visual Studio project

And it has been working great for me so far. However, I came across a project where there is no mention of the ProjectType. Below is the XML of .csProj file for the reference.

<PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProjectGuid>{87F6C2DE-6074-4E6D-9854-51EC812F7548}</ProjectGuid>
    <OutputType>Library</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>PL.HR.Services.Employee.DAL</RootNamespace>
    <AssemblyName>PL.HR.Services.Employee.DAL</AssemblyName>
    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
    <FileAlignment>512</FileAlignment>
    <SccProjectName>SAK</SccProjectName>
    <SccLocalPath>SAK</SccLocalPath>
    <SccAuxPath>SAK</SccAuxPath>
    <SccProvider>SAK</SccProvider>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>

I am not sure how can this happen

  • Is it possible without anyone manually removing the type information from .csproj file?
  • If not, then under what circumstances does it happen in VS?
  • Is there anything that we can do to prevent this kind of occurances from happening in the future?
Community
  • 1
  • 1
Lost
  • 12,007
  • 32
  • 121
  • 193

1 Answers1

2

Are you just looking at the xml or are you actually using VS provided services to get this information?

is it really a valid .csproj? or is it just something named .csproj so VS opens it? does VS actually open it without errors?

Some types of projects do not use project type guids as xml elements in a project file, like C++ projects, but then those generally don't end with .csproj. Those types of projects may be implemented in other ways, which implement things in IVsHierarchy and IVsAggregatableProject so you need do to it from code, like one of the pages from your linked answer explains.

John Gardner
  • 24,225
  • 5
  • 58
  • 76
  • I have added the XMl in my original question for the reference. However, to answer your question. It is a WCF Service where Contracts and implementations are saperated. I can clearly see that the contract project has TypeGUID to be WCF project but the implementations do not have a ProjectTypeGuid. My best bet it that it can be a C# library but a visual confirmation would be better than assumption. – Lost May 04 '15 at 16:55
  • I don't see a type guid at all, I see a project guid, which is just the unique identifier of the project itself. do you mean there's *another* project in the solution (the contract project?) that has type guids set? I've tried making a whole bunch of WCF related projects, and so far they've all included project type guids (at *least* containing the guid indicating it is c#, which is fae04ec0-301f-11d3-bf4b-00c04f79efbc. all of the "service" ones also include the guid that indicate they are a web project, which is 349c5851-65df-11da-9384-00065b846f21) what exact type of project is this? – John Gardner May 04 '15 at 17:03
  • yes, there is another project in the solution which is the Contract project and that one does have the Project Type Guid. This one though does not have it. The XML that I included does not have Project type Guid. – Lost May 04 '15 at 18:13
  • where did it come from? what type of project is it? that's where i'm confused. if the project doesn't have project type guids to indicate it is c#, i'm not sure how it works in VS at all. – John Gardner May 04 '15 at 19:14