WPF中Xaml编译正常而Designer Time时出错的解决办法
原因是:xaml的在Debug版本下必须为anyCPU。
解决办法:
1.打开工程文件xxx.csproj,
2.找到含有 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>的PropertyGroup节点
3.将此PropertyGroup节点中的<Platform Condition=" '$(Platform)' == '' ">改为anyCPU。
示例:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">anyCPU</Platform>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">anyCPU</Platform>
https://muzizongheng.blog.csdn.net/