Click here to Skip to main content
15,896,606 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

I ve got the following problem:

Within my csproj I use a variable, I ve declared in an external properties file. To reference it, I ve imported this properties file.

properties file:
XML
<?xml version="1.0" encoding="utf-8" ?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
	<PropertyGroup>
		<!-- Reference Paths -->
		<REFERENCE_PATH_bla Condition="'$(REFERENCE_PATH_bla)' == ''">$(bla_HOME)</REFERENCE_PATH_bla>
		<TC_REFERENCE_PATH_bla>$(REFERENCE_PATH_bla)\bla</TC_REFERENCE_PATH_bla>
		<DLL_INTEROPS_REFERENCE_PATH_bla>$(REFERENCE_PATH_bla)\dll\Interops</DLL_INTEROPS_REFERENCE_PATH_bla>
		<COMMONLIBS_REFERENCE_PATH_bla>$(REFERENCE_PATH_bla)\libs</COMMONLIBS_REFERENCE_PATH_bla>
	</PropertyGroup>

	<PropertyGroup>
		<!-- Build Ouput Paths -->
		<BUILD_OUTPUTPATH_bla Condition="'$(BUILD_OUTPUTPATH_bla)' == ''">$(SolutionDir)..\..\Build\AutomationBuild</BUILD_OUTPUTPATH_bla>
		<BUILD_OUTPUTPATH_bla>$(BUILD_OUTPUTPATH_bla)\Automation</BUILD_OUTPUTPATH_bla>
		<BUILD_OUTPUTPATH_bla_ADDINS>$(BUILD_OUTPUTPATH_bla)\bla\AddIns</BUILD_OUTPUTPATH_bla_ADDINS>
	</PropertyGroup>
</Project>


csproj:
XML
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="$(SolutionDir)..\..\Build\Properties\bla.Build.Output.Properties" />
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProductVersion>8.0.30703</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{bla}</ProjectGuid>
    <OutputType>Library</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>bla.Automation</RootNamespace>
    <AssemblyName>bla.Automation.Creation</AssemblyName>
    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
    <FileAlignment>512</FileAlignment>
    <TargetFrameworkProfile />
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>$(BUILD_OUTPUTPATH_bla)\Framework\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
(...)



Now, on Solution-startup I get a bunch of warnings that tell me:

Load of property 'OutputPath' failed. The entered path is not a valid output path.

Additionally when I try to build my solution I get:

The task cmd.exe could not be run. The entered path is not a valid output path.

I am quite sure, that this is all related to the fact, that the variable I use can not be solved. (Resharper tells me, that it is not defined.

Any idea?
Posted

1 solution

In the meantime I ve solved the issue.

The problem was, that my current user has full Admin-rights but msbuild was executed in a lower role => environment variables setup by Admin could not be solved by the normal user.

Fazit: strange behaviour and almost impossible to get on the ground of the problem.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900