Blake
Blake

Reputation: 2397

Can you use VS Macros in .config Files?

Is it possible to use a visual studio macro within a .config file? For example, can create a appSetting like this, where $(ProjectDir) maps to the directory where my .csproj file is located?

<appSettings>
  <add key="myDirectory" value="$(ProjectDir)\App_Data\myDirectory"/>
</appSettings>

Upvotes: 1

Views: 374

Answers (1)

Blake
Blake

Reputation: 2397

After searching around, the short answer to this question is 'no'.

Having macros within a .config file would mean that the web.config file would not be able to be properly interpreted when deployed somewhere other than the debug environment.

Upvotes: 1

Related Questions