Author Topic: MSBuild: Why I get the project name with the file extension?  (Read 1636 times)

0 Members and 1 Guest are viewing this topic.

Andrey Bushman

  • Swamp Rat
  • Posts: 860
MSBuild: Why I get the project name with the file extension?
« on: March 04, 2015, 02:43:26 PM »
MSVS 2013 Update 4.

From MSDN:

Quote
MSBuildProjectName - the file name of the project file without the file name extension; for example, MyApp.

My code:
Code: [Select]
<RootNamespace>MyCompany.CAD.Extensions.$(MSBuildProjectName)</RootNamespace>
But I see the project name with the file extension (in the project settings, the "Application" tab -> "Default namespace" field) :
Quote
MyCompany.CAD.Extensions.AutoCAD_some_extension.csproj

Why does it happen? How can I fix it?

CADbloke

  • Bull Frog
  • Posts: 337
  • Crash Test Dummy
Re: MSBuild: Why I get the project name with the file extension?
« Reply #1 on: March 04, 2015, 05:37:27 PM »
In a Visual Studio Template I just use $safeprojectname$ in a CSPROJ file. Sometimes there are subtly different behaviours between CSPROJ and MSBUILD but there are also a different set of rules for Visual Studio templates. See https://msdn.microsoft.com/en-us/library/eehb4faa.aspx

Another handy thing is <CustomParameters> https://msdn.microsoft.com/en-us/library/8wba5h42.aspx