views:

40

answers:

1

I've set an environment variable named %SDK% in windows. Can I use it somehow in .csproj file?

Something like:

<ItemGroup>
  <Reference Include="SomeDll">
    <HintPath>%SDK%\SomeDll.dll</HintPath>
  </Reference>
</ItemGroup>

I've tried %SDK% and $(SDK) and it does not work. Any ideas?

A: 

OMG, I had wrong path set in that variable. It works with:

<ItemGroup>
  <Reference Include="SomeDll">
    <HintPath>$(SDK)\SomeDll.dll</HintPath>
  </Reference>
</ItemGroup>
ppiotrowicz
Well, illustrative perhaps only to show what a bad idea it is to use environment variables.
Hans Passant
Yes you're right. I left that idea, in favor of relative path.
ppiotrowicz