Reputation: 43
Trying to convert my existing project to MVVM, I created a new solution with 3 projects : M, VM and V.
When adding my user controls to the new project I added the .cs files only and not the xaml. Compiled the solution and realized my problem so i removed the files and the xaml individual so I got both.
Now however when I build, I get. "Data at the root level is invalid. Line 1, position 1. XML is not valid." and it lists the associated .cs file as the file it tried to parse. This happens for ALL of my XAML files.
I'm looking for a solution that does not have me recreate everything. Is there a config file that specifies what should be parsed?
Upvotes: 2
Views: 2239
Reputation: 789
You might be missing or the format is not valid in the first line
<?xml version="1.0" encoding="UTF-8" ?>
Upvotes: 0
Reputation:
Sounds like your build actions are not configured correctly. .XAML files should have a build action of Page, and .cs files should have a build action of Compile.
You can configure the build action by opening the Properties tool window and selecting the file in Solution Explorer. Build Action is typically the first option on the Properties page.
Upvotes: 3