Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Project-level conditional compilation constant

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.

What does this mean? I am clueless...

Here is my project file:

<Project DefaultTargets="Build" ToolsVersion="3.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <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>
like image 834
user158888 Avatar asked Feb 28 '23 10:02

user158888


2 Answers

I had the same problem. But after I used "," as the separating character between constants instead of ";", it worked.

So have a try with "," (comma) only.

like image 149
xin Avatar answered Mar 11 '23 13:03

xin


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!

like image 37
user158888 Avatar answered Mar 11 '23 11:03

user158888