Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where do I set ImplicitlyExpandDesignTimeFacades to false?

I have the issue mentioned here.

I get the error:

An assembly with the same identity 'System.Runtime.Serialization.Primitives, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' has already been imported. Try removing one of the duplicate references.

The problem seems to be an incompatibility between Visual Studio 2013, Newtonsoft.Json and System.Runtime.Serialization.Primitives.

The suggested work around is to add

<ImplicitlyExpandDesignTimeFacades>false</ImplicitlyExpandDesignTimeFacades>

From looking around the web, it seems that this needs to go into the .csproj file, but I don't know exactly where to put it. If I put it under the root node, I get an error. Any ideas?

like image 716
Stephen Oberauer Avatar asked Aug 31 '16 14:08

Stephen Oberauer


1 Answers

You can put the <ImplicitlyExpandDesignTimeFacades> tag at the top of the project file, in the first <PropertyGroup>.

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProjectGuid>{75678902-8224-4222-BB33-756784B2FA29}</ProjectGuid>
    <OutputType>Library</OutputType>
    <RootNamespace>FooBar</RootNamespace>
    <AssemblyName>FooBar</AssemblyName>
    <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
    ...
    <ImplicitlyExpandDesignTimeFacades>false</ImplicitlyExpandDesignTimeFacades>
  </PropertyGroup>

-- Edit : --

<ImplicitlyExpandDesignTimeFacades> will save your day with Visual Studio 2013 or 2015, but it is not needed with 2017 : the projects will probably fail to compile. Don't forget to remove that item after upgrading to 2017.

like image 142
JB. Avatar answered Sep 26 '22 15:09

JB.