Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6124531
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:08:36+00:00 2026-05-23T16:08:36+00:00

Im trying to use the msbuild extensions pack to fix up the configuration of

  • 0

Im trying to use the msbuild extensions pack to fix up the configuration of our app on deploy,
i want to be able to pass a property (ENV) which will load my environment specific config file to use with the detokeniser, and fix up my application configs.
Like this:

    <UsingTask TaskName="MSBuild.ExtensionPack.FileSystem.Detokenise"
           AssemblyFile=".\Tools\MSBuild Extension Pack 4.0.3.0\MSBuild.ExtensionPack.dll"/>
<Import Project=".\Environments\$(Env).properties"/>
<Target Name="Build" >
    <ItemGroup>
        <SourceTemplates Include=".\Templates\**\*.*"/>
    </ItemGroup>

    <RemoveDir Directories=".\Temp"/>
    <MakeDir Directories=".\Temp"/>

    <Message Text="@(SourceTemplates)"/>

    <Copy SourceFiles="@(SourceTemplates)"
          DestinationFolder=".\Temp\%(RecursiveDir)" />

    <ItemGroup>
        <TargetTemplates Include=".\Temp\**\*.*"/>
    </ItemGroup>

    <MSBuild.ExtensionPack.FileSystem.Detokenise
         TaskAction="Detokenise"
         TargetFiles="@(TargetTemplates)"/>
</Target>

So i call this using

msbuild Detokenise.msbuild /p:Env=Prod

Msbuild knows about my file and i have access to its properties, but when the detokeniser runs i get the error:

Detokenise Task Execution Completed [15:07:50]
C:\Source\1.2\Build\Detokenise.msbuild(27,3):
error : InvalidProjectFileException: The imported project "C:\Source\1.2\Build\Environments\.properties" was not found.
Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
C:\Source\1.2\Build\Detokenise.msbuild\r
C:\Source\1.2\Build\Detokenise.msbuild(27,3): error :

All works fine if i hard code it-
Any ideas how to solve this. I thought of doing some text replacement on the msbuild before i execute…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T16:08:37+00:00Added an answer on May 23, 2026 at 4:08 pm

    You could try to assign this parameter to a local property:

    <PropertyGroup Condition="'$(Env)'=='Prod'">
        <TargetEnv>Prod</TargetEnv>
    </PropertyGroup>
    
    <!-- add other environments as needed -->
    <PropertyGroup Condition="'$(Env)'=='Test'">
        <TargetEnv>Test</TargetEnv>
    </PropertyGroup>
    
    <Import Project=".\Environments\$(TargetEnv).properties"/>
    

    You could also try to enclose your parameter value in quotes:

    msbuild Detokenise.msbuild /p:"Env=Prod"
    

    As is your problem can’t be reproduced, so it may be a side effect of other parameters not shown in your sample code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to get our build scripts (which use MSBuild) working correctly on Vista
I am trying to use MSBuild release mode, but it always defaults to debug.
I'm trying to use the MSBuild NUnit community task to force tests to run
I am trying to learn how to use MSBuild so we can use it
I'm having trouble trying to find the right way to use MSBuild to build
I'm trying to use the VssGet task of the MSBuild Community Tasks, and the
I'm trying use self-signed certificate (c#): X509Certificate2 cert = new X509Certificate2( Server.MapPath(~/App_Data/myhost.pfx), pass); on
I'm trying to use MSBuild to read in a list of files from a
I am trying to use MSBuild to build a solution with a specified target
I am trying to use the BuildInParallel option on MsBuild. I have an NAnt

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.