views:

541

answers:

1

I am getting a project-level conditional compilation constant error while trying to build my vb.net project. It reads:

project-level conditional compilation constant 'VB_VER=9.0,TARGET="exe",CONFIG="Debug",_MyType="Console",PLATFORM="AnyCPU",DEBUG;^^ ^^ TRACE' not valid: Character is not valid.

I recently upgraded it to the latest version (from 2.0), and I have a feeling that this has something to do with it.

Any ideas on what this means? I am clueless...

Here is my project file (by request):

<Project DefaultTargets="Build" ToolsVersion="3.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"&gt;
  <PropertyGroup>
    <ProjectType>local</ProjectType>
    <ProjectVersion>7.10.3077</ProjectVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{5810CBEF-671E-4845-BBE3-BC3470C3EE18}</ProjectGuid>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <AssemblyName>svchost</AssemblyName>
    <DefaultClientScript>JScript</DefaultClientScript>
    <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
    <DefaultTargetSchema>IE50</DefaultTargetSchema>
    <DelaySign>false</DelaySign>
    <OutputType>Exe</OutputType>
    <FileUpgradeFlags>
    </FileUpgradeFlags>
    <MyType>Console</MyType>
    <UpgradeBackupLocation>
    </UpgradeBackupLocation>
    <OldToolsVersion>0.0</OldToolsVersion>
    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
    <IsWebBootstrapper>false</IsWebBootstrapper>
    <PublishUrl>publish\</PublishUrl>
    <Install>true</Install>
    <InstallFrom>Disk</InstallFrom>
    <UpdateEnabled>false</UpdateEnabled>
    <UpdateMode>Foreground</UpdateMode>
    <UpdateInterval>7</UpdateInterval>
    <UpdateIntervalUnits>Days</UpdateIntervalUnits>
    <UpdatePeriodically>false</UpdatePeriodically>
    <UpdateRequired>false</UpdateRequired>
    <MapFileExtensions>true</MapFileExtensions>
    <ApplicationRevision>0</ApplicationRevision>
    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
    <UseApplicationTrust>false</UseApplicationTrust>
    <BootstrapperEnabled>true</BootstrapperEnabled>
    <StartupObject>Sub Main</StartupObject>
    <ApplicationManifest>My Project\app.manifest</ApplicationManifest>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <OutputPath>bin\Debug\</OutputPath>
    <DocumentationFile>svchost.xml</DocumentationFile>
    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <DebugSymbols>true</DebugSymbols>
    <NoStdLib>false</NoStdLib>
    <Optimize>false</Optimize>
    <WarningLevel>4</WarningLevel>
    <NoWarn>42016,42017,42018,42019,42032</NoWarn>
    <DebugType>full</DebugType>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <OutputPath>bin\Release\</OutputPath>
    <DocumentationFile>svchost.xml</DocumentationFile>
    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
    <DefineConstants>TRACE</DefineConstants>
    <DebugSymbols>false</DebugSymbols>
    <NoStdLib>false</NoStdLib>
    <Optimize>true</Optimize>
    <WarningLevel>4</WarningLevel>
    <NoWarn>42016,42017,42018,42019,42032</NoWarn>
    <DebugType>none</DebugType>
  </PropertyGroup>
  <ItemGroup>
     <!-- Removed Files Here -->
  </ItemGroup>
  <ItemGroup>
     <!-- Removed Files Here -->
  </ItemGroup>
  <ItemGroup>
         <!-- Removed Files Here -->
  </ItemGroup>
  <ItemGroup>
         <!-- Removed Files Here -->
  </ItemGroup>
  <ItemGroup>
         <!-- Removed Files Here -->
  </ItemGroup>
  <Import Project="$(MSBuildBinPath)\Microsoft.VisualBasic.targets" />
  <PropertyGroup>
    <PreBuildEvent>
    </PreBuildEvent>
    <PostBuildEvent>
    </PostBuildEvent>
  </PropertyGroup>
</Project>
+2  A: 

I changed the DefineConstants tag in this block:

 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <OutputPath>bin\Debug\</OutputPath>
    <DocumentationFile>svchost.xml</DocumentationFile>
    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <DebugSymbols>true</DebugSymbols>
    <NoStdLib>false</NoStdLib>
    <Optimize>false</Optimize>
    <WarningLevel>4</WarningLevel>
    <NoWarn>42016,42017,42018,42019,42032</NoWarn>
    <DebugType>full</DebugType>
  </PropertyGroup>

to

<DefineConstants>DEBUG</DefineConstants>

It worked like a charm!