tags:

views:

362

answers:

1

I get the following error message when trying to run a build file:

error MSB4025: The project file could not be loaded. '?' is an u nexpected token. The expected token is ''>''.

Here is the build script:

<?xml version="1.0" encoding="utf-8" ?/>

<Project ToolsVersion="3.5" DefaultTarget="Compile"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003"&gt;

<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == " ">Debug</Configuration>
</PropertyGroup>

<ItemGroup>
<SolutionRoot Include=".."/>
<BuildArtifacts Include=".\buildartifacts\"/>
<SolutionFile Include="..\ScrewTurnWiki.sln"/>
</ItemGroup>

<Target Name="Clean">
<RemoveDir Directories="@(BuildArtifacts)"/>
</Target>

<Target Name="Init" DependsOnTargets="Clean">
<MakeDir Directories="@(BuildArtifacts)"/>
</Target>

<Target Name="Compile" DependsOnTargets="Init">
<MSBuild Projects="@(SolutionFile)"Properties="OutDir=%(BuildArtifacts.FullPath);   
    Configuration=$(Configuration)"/>
</Target>

</Project>

Line 1, Position 38 is where it says the error is.

Another error just popped up after fixing the first one:

Line 1, Postion 53 says Name cannot begin with the '"' character....

+2  A: 

I think the xml header must be <?xml version="1.0" encoding="utf-8" ?> instead of <?xml version="1.0" encoding="utf-8" ?/>

coelhudo
That fixed that issue, but now I get another error on line 7, postion 53. It says, Name cannot begin with the '"' character, hexidecimal value 0x22. I got this script from this msdn article, so apparently some mistakes were made: http://msdn.microsoft.com/en-us/magazine/dd758790.aspx
Xaisoft
There is 3 " characters, you are missing one, I think it's:<Configuration Condition=" '$(Configuration)' == " " ">Debug</Configuration>
coelhudo
I suggest you to use a xml editor. It's what I did. :)
coelhudo
Thanks, I did that, I just had to put '' instead of "". Thanks for help.
Xaisoft
You should use Visual Studio to edit those files. If it is a project itself then right-click on the project and then pick unload, and then right-click again and pick edit. If it is not an actual VS project then just open the file itself.
Sayed Ibrahim Hashimi