We have this in the runtime so we should just copy what we have there.
In UnitTests.csproj for the designer we have the following lines:
<Reference Include="VSLangProj, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<EmbedInteropTypes>True</EmbedInteropTypes>
</Reference>
<Reference Include="VSLangProj80, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<EmbedInteropTypes>True</EmbedInteropTypes>
</Reference>
These give rise to the following warnings in the build which it would be good to remove:
CSC : warning CS1762: A reference was created to embedded interop assembly 'c:\Program Files\Common Files\microsoft shared\MSEnv\PublicAssemblies\VSLangProj80.dll' because of an indirect reference to that assembly created by assembly 'c:\git\ef\EFDesigner\bin\Debug\Microsoft.Data.Entity.Design.dll'. Consider changing the 'Embed Interop Types' property on either assembly. [c:\git\ef\EFDesigner\test\UnitTests\UnitTests.csproj]
CSC : warning CS1762: A reference was created to embedded interop assembly 'c:\Program Files\Common Files\microsoft shared\MSEnv\PublicAssemblies\VSLangProj.dll' because of an indirect reference to that assembly created by assembly 'c:\git\ef\EFDesigner\bin\Debug\Microsoft.Data.Entity.Design.dll'. Consider changing the 'Embed Interop Types' property on either assembly. [c:\git\ef\EFDesigner\test\UnitTests\UnitTests.csproj]
However if you do remove the <EmbedInteropTypes> from the project file then some tests fail with errors like the following:
Test Name: GetInstalledEntityFrameworkVersion_returns_EF_version_when_EF_and_SDE
Test FullName: Microsoft.Data.Entity.Design.VisualStudio.VsUtilsTests.GetInstalledEntityFrameworkVersion_returns_EF_version_when_EF_and_SDE
Test Source: c:\git\ef\EFDesigner\test\UnitTests\EntityDesign\VisualStudio\VsUtilsTests.cs : line 115
Test Outcome: Failed
Test Duration: 0:00:01.073
Result Message: System.IO.FileNotFoundException : Could not load file or assembly 'EnvDTE, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
Result StackTrace:
at System.Signature.GetSignature(Void* pCorSig, Int32 cCorSig, RuntimeFieldHandleInternal fieldHandle, IRuntimeMethodInfo methodHandle, RuntimeType declaringType)
at System.Reflection.RuntimeMethodInfo.FetchNonReturnParameters()
at System.Reflection.RuntimeMethodInfo.GetParametersNoCopy()
at System.Reflection.RuntimePropertyInfo.GetIndexParametersNoCopy()
at System.Reflection.RuntimePropertyInfo.GetIndexParameters()
at Castle.DynamicProxy.Contributors.MembersCollector.AddProperty(PropertyInfo property, IProxyGenerationHook hook)
at Castle.DynamicProxy.Contributors.MembersCollector.CollectProperties(IProxyGenerationHook hook)
at Castle.DynamicProxy.Contributors.MembersCollector.CollectMembersToProxy(IProxyGenerationHook hook)
at Castle.DynamicProxy.Contributors.InterfaceProxyWithoutTargetContributor.<CollectElementsToProxyInternal>d__0.MoveNext()
at Castle.DynamicProxy.Contributors.CompositeTypeContributor.CollectElementsToProxy(IProxyGenerationHook hook, MetaType model)
at Castle.DynamicProxy.Generators.InterfaceProxyWithoutTargetGenerator.GenerateType(String typeName, Type proxyTargetType, Type[] interfaces, INamingScope namingScope)
at Castle.DynamicProxy.Generators.InterfaceProxyWithTargetGenerator.GenerateCode(Type proxyTargetType, Type[] interfaces, ProxyGenerationOptions options)
at Castle.DynamicProxy.DefaultProxyBuilder.CreateInterfaceProxyTypeWithoutTarget(Type interfaceToProxy, Type[] additionalInterfacesToProxy, ProxyGenerationOptions options)
at Castle.DynamicProxy.ProxyGenerator.CreateInterfaceProxyWithoutTarget(Type interfaceToProxy, Type[] additionalInterfacesToProxy, ProxyGenerationOptions options, IInterceptor[] interceptors)
at Moq.Proxy.CastleProxyFactory.CreateProxy[T](ICallInterceptor interceptor, Type[] interfaces, Object[] arguments)
at Moq.Mock`1.<InitializeInstance>b__0()
at Moq.PexProtector.Invoke(Action action)
at Moq.Mock`1.InitializeInstance()
at Moq.Mock`1.OnGetObject()
at Moq.Mock`1.get_Object()
at Microsoft.Data.Entity.Design.VisualStudio.VsUtilsTests.CreateProject(IEnumerable`1 references) in c:\git\ef\EFDesigner\test\UnitTests\EntityDesign\VisualStudio\VsUtilsTests.cs:line 147
at Microsoft.Data.Entity.Design.VisualStudio.VsUtilsTests.GetInstalledEntityFrameworkVersion_returns_EF_version_when_EF_and_SDE() in c:\git\ef\EFDesigner\test\UnitTests\EntityDesign\VisualStudio\VsUtilsTests.cs:line 116
We need to investigate why this is and try to remove these entries (but after Beta is released).
Comments: This is part of [Work Item 1509](https://entityframework.codeplex.com/workitem/1509).
In UnitTests.csproj for the designer we have the following lines:
<Reference Include="VSLangProj, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<EmbedInteropTypes>True</EmbedInteropTypes>
</Reference>
<Reference Include="VSLangProj80, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<EmbedInteropTypes>True</EmbedInteropTypes>
</Reference>
These give rise to the following warnings in the build which it would be good to remove:
CSC : warning CS1762: A reference was created to embedded interop assembly 'c:\Program Files\Common Files\microsoft shared\MSEnv\PublicAssemblies\VSLangProj80.dll' because of an indirect reference to that assembly created by assembly 'c:\git\ef\EFDesigner\bin\Debug\Microsoft.Data.Entity.Design.dll'. Consider changing the 'Embed Interop Types' property on either assembly. [c:\git\ef\EFDesigner\test\UnitTests\UnitTests.csproj]
CSC : warning CS1762: A reference was created to embedded interop assembly 'c:\Program Files\Common Files\microsoft shared\MSEnv\PublicAssemblies\VSLangProj.dll' because of an indirect reference to that assembly created by assembly 'c:\git\ef\EFDesigner\bin\Debug\Microsoft.Data.Entity.Design.dll'. Consider changing the 'Embed Interop Types' property on either assembly. [c:\git\ef\EFDesigner\test\UnitTests\UnitTests.csproj]
However if you do remove the <EmbedInteropTypes> from the project file then some tests fail with errors like the following:
Test Name: GetInstalledEntityFrameworkVersion_returns_EF_version_when_EF_and_SDE
Test FullName: Microsoft.Data.Entity.Design.VisualStudio.VsUtilsTests.GetInstalledEntityFrameworkVersion_returns_EF_version_when_EF_and_SDE
Test Source: c:\git\ef\EFDesigner\test\UnitTests\EntityDesign\VisualStudio\VsUtilsTests.cs : line 115
Test Outcome: Failed
Test Duration: 0:00:01.073
Result Message: System.IO.FileNotFoundException : Could not load file or assembly 'EnvDTE, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
Result StackTrace:
at System.Signature.GetSignature(Void* pCorSig, Int32 cCorSig, RuntimeFieldHandleInternal fieldHandle, IRuntimeMethodInfo methodHandle, RuntimeType declaringType)
at System.Reflection.RuntimeMethodInfo.FetchNonReturnParameters()
at System.Reflection.RuntimeMethodInfo.GetParametersNoCopy()
at System.Reflection.RuntimePropertyInfo.GetIndexParametersNoCopy()
at System.Reflection.RuntimePropertyInfo.GetIndexParameters()
at Castle.DynamicProxy.Contributors.MembersCollector.AddProperty(PropertyInfo property, IProxyGenerationHook hook)
at Castle.DynamicProxy.Contributors.MembersCollector.CollectProperties(IProxyGenerationHook hook)
at Castle.DynamicProxy.Contributors.MembersCollector.CollectMembersToProxy(IProxyGenerationHook hook)
at Castle.DynamicProxy.Contributors.InterfaceProxyWithoutTargetContributor.<CollectElementsToProxyInternal>d__0.MoveNext()
at Castle.DynamicProxy.Contributors.CompositeTypeContributor.CollectElementsToProxy(IProxyGenerationHook hook, MetaType model)
at Castle.DynamicProxy.Generators.InterfaceProxyWithoutTargetGenerator.GenerateType(String typeName, Type proxyTargetType, Type[] interfaces, INamingScope namingScope)
at Castle.DynamicProxy.Generators.InterfaceProxyWithTargetGenerator.GenerateCode(Type proxyTargetType, Type[] interfaces, ProxyGenerationOptions options)
at Castle.DynamicProxy.DefaultProxyBuilder.CreateInterfaceProxyTypeWithoutTarget(Type interfaceToProxy, Type[] additionalInterfacesToProxy, ProxyGenerationOptions options)
at Castle.DynamicProxy.ProxyGenerator.CreateInterfaceProxyWithoutTarget(Type interfaceToProxy, Type[] additionalInterfacesToProxy, ProxyGenerationOptions options, IInterceptor[] interceptors)
at Moq.Proxy.CastleProxyFactory.CreateProxy[T](ICallInterceptor interceptor, Type[] interfaces, Object[] arguments)
at Moq.Mock`1.<InitializeInstance>b__0()
at Moq.PexProtector.Invoke(Action action)
at Moq.Mock`1.InitializeInstance()
at Moq.Mock`1.OnGetObject()
at Moq.Mock`1.get_Object()
at Microsoft.Data.Entity.Design.VisualStudio.VsUtilsTests.CreateProject(IEnumerable`1 references) in c:\git\ef\EFDesigner\test\UnitTests\EntityDesign\VisualStudio\VsUtilsTests.cs:line 147
at Microsoft.Data.Entity.Design.VisualStudio.VsUtilsTests.GetInstalledEntityFrameworkVersion_returns_EF_version_when_EF_and_SDE() in c:\git\ef\EFDesigner\test\UnitTests\EntityDesign\VisualStudio\VsUtilsTests.cs:line 116
We need to investigate why this is and try to remove these entries (but after Beta is released).
Comments: This is part of [Work Item 1509](https://entityframework.codeplex.com/workitem/1509).