none
Blend - watch out - it uses the PLATFORM enviornment variable

    General discussion

  • Everyone,

     

    I just purchased a brand new HP Quad Processor system, 64 bit, 4GB memory, NVidia 8800, Vista Ultimate, 24" monitor, the works.

     

    Well, I loaded up a project I've been working on for 3 weeks and Expression Blend displayed weird errors.

     

    Telling me that my solution file had platform type of HPD.  It's looking for Any CPU, x86 or x64.

     

    Turns out, HP loaded my system with an environment variable PLATFORM=HPD.

     

    What's really unusual is that VS 2005 had no problems.  Compiled and ran.

     

    Maybe someone from Microsoft can comment on why Blend was being sensitive to the environment variable but VS 2005 was not.

     

    At any rate, hope this helps someone and saves them from...

     

    Karl

    Saturday, June 02, 2007 9:38 PM

All replies

  • Hi Karl,

     

    Thanks for the heads-up.

     

    You will also notice that the build will fail at the command prompt using MSBuild (which is what Expression Blend and VS use underneath the covers to build the project). In VS, when you build, it sets the build configuration type (Debug, Release, etc.) and the Platform build variable and hence you don't see this issue. Expression Blend (and the command line MSBuild don't). The workaround would be to force MSBuild to use the right value.

     

    If you post your project file's contents here (the .csproj file), I will try to modify it such that it builds correctly. Alternatively, send to me at unnir at microsoft dot com.

     

    Thanks,

    -Unni

    Sunday, June 10, 2007 12:21 AM
  • Unni,

     

    Thank you.  That is what I figured out.  I just removed teh enviornment variable and everything works no problem.

     

    Have a great day!

     

    Karl

    Monday, June 11, 2007 1:32 PM
  • Unni;

     

        Your anwser is not true. My project file clearly show Plaform is AnyCPU as the following piece of project file. A full project file is just a waste of space.

       I had the same error with Visual Studio 2008 Professional trial version and .Net 3.5. The problem is that msbuild overrides the value of PLATFORM from the project file with the HP defined environment variable value of HPD. So the workaround is either unset PLATFORM value from the cmd console before run the msbuild or remove that environment variable from the system.

     

    Changde

     

    --------------------------------------------------------   here the partial project file -------------------

     

    <?xml version="1.0" encoding="utf-8"?>
    <Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
      <PropertyGroup>
        <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
        <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
        <UICulture>en-US</UICulture>
        <ProductVersion>9.0.21022</ProductVersion>
        <SchemaVersion>2.0</SchemaVersion>
        <ProjectGuid>{ED3C43FD-417D-40DA-BF3B-51E216F6AB1E}</ProjectGuid>
        <OutputType>WinExe</OutputType>
        <AppDesignerFolder>Properties</AppDesignerFolder>
        <RootNamespace>WpLocalization</RootNamespace>
        <AssemblyName>WpLocalization</AssemblyName>
        <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
        <FileAlignment>512</FileAlignment>
        <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
        <WarningLevel>4</WarningLevel>
      </PropertyGroup>
      <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
        <DebugSymbols>true</DebugSymbols>
        <DebugType>full</DebugType>
        <Optimize>false</Optimize>
        <OutputPath>bin\Debug\</OutputPath>
        <DefineConstants>DEBUG;TRACE</DefineConstants>
        <ErrorReport>prompt</ErrorReport>
        <WarningLevel>4</WarningLevel>
      </PropertyGroup>
      <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
        <DebugType>pdbonly</DebugType>
        <Optimize>true</Optimize>
        <OutputPath>bin\Release\</OutputPath>
        <DefineConstants>TRACE</DefineConstants>
        <ErrorReport>prompt</ErrorReport>
        <WarningLevel>4</WarningLevel>
      </PropertyGroup>

    Monday, January 28, 2008 1:27 AM
  • Yes, that is one way to solve this issue.

     

    Please note that we have fixed this issue in Blend 2 (not sure if the fix is in the December Preview or not - I think it is) such that Blend will be able to build the solution with the environment variable set. However, MSBuild won't be able to build the solution at the command prompt (we now mimic the VS 2008 behavior, which is different from the MSBuild behavior).

     

    Thanks,

    Unni

    Monday, January 28, 2008 2:46 AM