Quantcast
Channel: Entity Framework
Viewing all 10318 articles
Browse latest View live

Closed Unassigned: The given key was not present in the dictionary. EF 6.1.3 Bulk Insert [2868]

$
0
0

I am using EF 6.1.3 and still facing the above issue. "The given key was not present in the dictionary"
I downloaded the package from NuGet which I am using. I tried to replace the EntityFramework dll which was already 6.0.2 but still no luck.

Attached are 2 stack track in same exception.
Comments: **EF Team Triage:** EntityFramework.BulkInsert is a third party library that is not built or supported by the EF team. You would need to file this issue with that project.

Closed Unassigned: Use consistently the method CreateCommitFailureHandlerMock(). [2867]

$
0
0
On other commit (d83cdfa), I identified that you make the following change on class test/EntityFramework/UnitTests/Infrastructure/Transactions/CommitFailureHandlerTests.cs:

- using (var handler = new CommitFailureHandler())
+ using (var handler = CreateCommitFailureHandlerMock().Object)
and
- using (var handler = new CommitFailureHandler())
+ using (var handler = CreateCommitFailureHandlerMock().Object)
among other locations
There are other locations following the pattern on this class that was not changed. Maybe the other locations must also be changed.

Comments: **EF Team Triage:** If this was causing issues in the tests, we would consider changing it. But the tests are running fine, so we are not planning to spend time changing it.

Closed Unassigned: Use the method ExtendedSqlAzureExecutionStrategy.ExecuteNew consistently [2866]

$
0
0
On previous commit (1571862), I identified that you make the following change on class a/test/EntityFramework/FunctionalTests/Interception/CommitFailureTests.cs:
- c => Assert.Throws<DataException>(() => c()).InnerException.ValidateMessage("CommitFailed"),
+ c => Assert.Throws<DataException>(() => ExtendedSqlAzureExecutionStrategy.ExecuteNew(c)).InnerException.ValidateMessage("CommitFailed"),
and
- c => Assert.Throws<CommitFailedException>(() => c()).ValidateMessage("CommitFailed"),
+ c => Assert.Throws<CommitFailedException>(() => ExtendedSqlAzureExecutionStrategy.ExecuteNew(c)).ValidateMessage("CommitFailed"),

There are other locations following the pattern that was not changed. Maybe the other locations must also be changed.
Comments: **EF Team Triage:** If this was causing issues in the tests, we would consider changing it. But the tests are running fine, so we are not planning to spend time changing it.

Commented Unassigned: Issue with Transforming T4 template after upgrading from Visual Studio 2012 to 2015 [2865]

$
0
0
I am receiving an error when trying to transform my T4 templates after upgrading from Visual Studio 2012 to Visual Studio 2015. The error only occurs in 2015 and is the following:

Severity Code Description Project File Line
Error Running transformation: System.TypeInitializationException: The type initializer for 'System.Data.Entity.Internal.AppConfig' threw an exception. ---> System.InvalidCastException: [A]System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection cannot be cast to [B]System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection. Type A originates from 'EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' in the context 'Default' at location 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\EntityFramework.dll'. Type B originates from 'EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' in the context 'LoadFrom' at location 'C:\Users\Test\AppData\Local\assembly\test\XZMTJ8Y3.AQX\ae6c1d7c\1c6dded0_2329d101\EntityFramework.dll'.
at System.Data.Entity.Internal.AppConfig..ctor()
at System.Data.Entity.Internal.AppConfig..cctor()
--- End of inner exception stack trace ---
at System.Data.Entity.Internal.AppConfig.get_DefaultInstance()
at System.Data.Entity.Internal.LazyInternalConnection..ctor(DbContext context, String nameOrConnectionString)
at System.Data.Entity.DbContext..ctor(String nameOrConnectionString)
at Test.Data.ContextBase..ctor(String connectionString, IQueueManager queueManager)
at Test.Data.ContextBase`1..ctor(String connectionString, IQueueManager queueManager)
at Test.Data.ContextMto..ctor(String connectionString, IQueueManager queueManager)
at Microsoft.VisualStudio.TextTemplatingB4C6A10D5E27D5BF6972752E5B6D34223C87F4730BABFA9C092B8771FD2D15FC2EB19F98F101F45D4F150804395E45CE9894426D3242245FCA85F81B4F3FDE01.GeneratedTextTransformation.TransformText() in d:\Test\Test1\Test2\Test3\test.tt:line 81 Integral.Web.UI d:\Test\Test1\Test2\Test3\test.tt 81

The resulting file is blank from the T4 template transformation.

I'm able to reproduce the same in Visual studio 2013 Ultimate as well.

Current workaround is to delete the Entity Framework DLL's from the directory "'C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE"

Comments: This is probably an issue with another extension dropping EntityFramework.dll in `C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE`. As you already identified, you should just be able to delete this file. Did you recently install any extensions before the issue started occurring?

Closed Unassigned: Allow for the ability to use EF POCO Proxies on internal classes [2864]

$
0
0
This was opened on the ASP.NET UserVoice site. Please triage as appropiate.
https://aspnet.uservoice.com/forums/41199-general-asp-net/suggestions/488743-allow-for-the-ability-to-use-ef-poco-proxies-on-in
Comments: The request on the ASP.NET site is 6 years old, closing this one out since it's the only time we've heard the request and it only had a few votes on the ASP.NET UserVoice site. BTW you could probably get this to work with InternalsVisibleTo

Commented Issue: Update-Database and Add-Migration commands fail due to package ambiguity [2872]

$
0
0
---
UPDATE Feb-5-2016
---

We have determined that this is due to a breaking change outside of EF and are working with the Visual Studio and Windows teams to isolate the exact cause of the problem.

> We have been able to determine that executing [NuGet.VisualStudio.IVsPackageInstallerServices].AssemblyQualifiedName in the Package Management Console (which is PowerShell console hosted in VS) throws in recent preview builds but used to work in Windows 10 even if there is more than one assembly loaded in memory that implemented the type.


---

After updating to Windows 10 Enterprise Insider Preview build 11099, I'm now unable to run the 'Update-Database' and 'Add-Migration' commands. I'm using Visual Studio 2015 Update 1 and Entity Framework version 6.1.3.

I don't know how the update and the issue are related, but the commands output the following error:

Type name 'NuGet.VisualStudio.IVsPackageInstallerServices' is ambiguous, it could be 'NuGet.VisualStudio.IVsPackageInstallerServices,
Microsoft.VisualStudio.ApplicationInsights, Version=4.1.60107.3, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or
'NuGet.VisualStudio.IVsPackageInstallerServices, Microsoft.VisualStudio.Web.Application, Version=14.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a'.
At C:\Users\Mateus Rodrigues\OneDrive\Developer\Visual Studio\SiCond\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:1004 char:5
+ $packageInstallerServices = $componentModel.GetService([NuGet.Vis ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [], RuntimeException
+ FullyQualifiedErrorId : AmbiguousTypeReference

You cannot call a method on a null-valued expression.
At C:\Users\Mateus Rodrigues\OneDrive\Developer\Visual Studio\SiCond\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:1006 char:5
+ $vsPackage = $packageInstallerServices.GetInstalledPackages() | ? ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull

Join-Path : Cannot bind argument to parameter 'Path' because it is null.
At C:\Users\Mateus Rodrigues\OneDrive\Developer\Visual Studio\SiCond\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:713 char:28
+ $toolsPath = Join-Path $installPath tools
+ ~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Join-Path], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.JoinPathCommand

Join-Path : Cannot bind argument to parameter 'Path' because it is null.
At C:\Users\Mateus Rodrigues\OneDrive\Developer\Visual Studio\SiCond\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:780 char:74
+ ... [System.Reflection.Assembly]::LoadFrom((Join-Path $ToolsPath EntityF ...
+ ~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Join-Path], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.JoinPathCommand

You cannot call a method on a null-valued expression.
At C:\Users\Mateus Rodrigues\OneDrive\Developer\Visual Studio\SiCond\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:781 char:5
+ $dispatcher = $utilityAssembly.CreateInstance(
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull

Join-Path : Cannot bind argument to parameter 'Path' because it is null.
At C:\Users\Mateus Rodrigues\OneDrive\Developer\Visual Studio\SiCond\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:810 char:20
+ (Join-Path $runner.ToolsPath EntityFramework.PowerShell.dll),
+ ~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Join-Path], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.JoinPathCommand
Comments: I've just installed Visual Studio 2015 update 2 CTP, but the issue is still there.

Commented Issue: Update-Database and Add-Migration commands fail due to package ambiguity [2872]

$
0
0
---
UPDATE Feb-5-2016
---

We have determined that this is due to a breaking change outside of EF and are working with the Visual Studio and Windows teams to isolate the exact cause of the problem.

> We have been able to determine that executing [NuGet.VisualStudio.IVsPackageInstallerServices].AssemblyQualifiedName in the Package Management Console (which is PowerShell console hosted in VS) throws in recent preview builds but used to work in Windows 10 even if there is more than one assembly loaded in memory that implemented the type.


---

After updating to Windows 10 Enterprise Insider Preview build 11099, I'm now unable to run the 'Update-Database' and 'Add-Migration' commands. I'm using Visual Studio 2015 Update 1 and Entity Framework version 6.1.3.

I don't know how the update and the issue are related, but the commands output the following error:

Type name 'NuGet.VisualStudio.IVsPackageInstallerServices' is ambiguous, it could be 'NuGet.VisualStudio.IVsPackageInstallerServices,
Microsoft.VisualStudio.ApplicationInsights, Version=4.1.60107.3, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or
'NuGet.VisualStudio.IVsPackageInstallerServices, Microsoft.VisualStudio.Web.Application, Version=14.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a'.
At C:\Users\Mateus Rodrigues\OneDrive\Developer\Visual Studio\SiCond\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:1004 char:5
+ $packageInstallerServices = $componentModel.GetService([NuGet.Vis ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [], RuntimeException
+ FullyQualifiedErrorId : AmbiguousTypeReference

You cannot call a method on a null-valued expression.
At C:\Users\Mateus Rodrigues\OneDrive\Developer\Visual Studio\SiCond\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:1006 char:5
+ $vsPackage = $packageInstallerServices.GetInstalledPackages() | ? ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull

Join-Path : Cannot bind argument to parameter 'Path' because it is null.
At C:\Users\Mateus Rodrigues\OneDrive\Developer\Visual Studio\SiCond\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:713 char:28
+ $toolsPath = Join-Path $installPath tools
+ ~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Join-Path], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.JoinPathCommand

Join-Path : Cannot bind argument to parameter 'Path' because it is null.
At C:\Users\Mateus Rodrigues\OneDrive\Developer\Visual Studio\SiCond\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:780 char:74
+ ... [System.Reflection.Assembly]::LoadFrom((Join-Path $ToolsPath EntityF ...
+ ~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Join-Path], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.JoinPathCommand

You cannot call a method on a null-valued expression.
At C:\Users\Mateus Rodrigues\OneDrive\Developer\Visual Studio\SiCond\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:781 char:5
+ $dispatcher = $utilityAssembly.CreateInstance(
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull

Join-Path : Cannot bind argument to parameter 'Path' because it is null.
At C:\Users\Mateus Rodrigues\OneDrive\Developer\Visual Studio\SiCond\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:810 char:20
+ (Join-Path $runner.ToolsPath EntityFramework.PowerShell.dll),
+ ~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Join-Path], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.JoinPathCommand
Comments: It will be the end of the Entity Framework ? It is not possible that there are not enough people to solve such a serious mistake!

Commented Issue: Update-Database and Add-Migration commands fail due to package ambiguity [2872]

$
0
0
---
UPDATE Feb-5-2016
---

We have determined that this is due to a breaking change outside of EF and are working with the Visual Studio and Windows teams to isolate the exact cause of the problem.

> We have been able to determine that executing [NuGet.VisualStudio.IVsPackageInstallerServices].AssemblyQualifiedName in the Package Management Console (which is PowerShell console hosted in VS) throws in recent preview builds but used to work in Windows 10 even if there is more than one assembly loaded in memory that implemented the type.


---

After updating to Windows 10 Enterprise Insider Preview build 11099, I'm now unable to run the 'Update-Database' and 'Add-Migration' commands. I'm using Visual Studio 2015 Update 1 and Entity Framework version 6.1.3.

I don't know how the update and the issue are related, but the commands output the following error:

Type name 'NuGet.VisualStudio.IVsPackageInstallerServices' is ambiguous, it could be 'NuGet.VisualStudio.IVsPackageInstallerServices,
Microsoft.VisualStudio.ApplicationInsights, Version=4.1.60107.3, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or
'NuGet.VisualStudio.IVsPackageInstallerServices, Microsoft.VisualStudio.Web.Application, Version=14.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a'.
At C:\Users\Mateus Rodrigues\OneDrive\Developer\Visual Studio\SiCond\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:1004 char:5
+ $packageInstallerServices = $componentModel.GetService([NuGet.Vis ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [], RuntimeException
+ FullyQualifiedErrorId : AmbiguousTypeReference

You cannot call a method on a null-valued expression.
At C:\Users\Mateus Rodrigues\OneDrive\Developer\Visual Studio\SiCond\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:1006 char:5
+ $vsPackage = $packageInstallerServices.GetInstalledPackages() | ? ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull

Join-Path : Cannot bind argument to parameter 'Path' because it is null.
At C:\Users\Mateus Rodrigues\OneDrive\Developer\Visual Studio\SiCond\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:713 char:28
+ $toolsPath = Join-Path $installPath tools
+ ~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Join-Path], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.JoinPathCommand

Join-Path : Cannot bind argument to parameter 'Path' because it is null.
At C:\Users\Mateus Rodrigues\OneDrive\Developer\Visual Studio\SiCond\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:780 char:74
+ ... [System.Reflection.Assembly]::LoadFrom((Join-Path $ToolsPath EntityF ...
+ ~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Join-Path], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.JoinPathCommand

You cannot call a method on a null-valued expression.
At C:\Users\Mateus Rodrigues\OneDrive\Developer\Visual Studio\SiCond\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:781 char:5
+ $dispatcher = $utilityAssembly.CreateInstance(
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull

Join-Path : Cannot bind argument to parameter 'Path' because it is null.
At C:\Users\Mateus Rodrigues\OneDrive\Developer\Visual Studio\SiCond\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:810 char:20
+ (Join-Path $runner.ToolsPath EntityFramework.PowerShell.dll),
+ ~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Join-Path], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.JoinPathCommand
Comments: I have figured out a workaround for this issue using type aliases. Since it is a bit long, I wrote it in detail [in my blog here](http://edd.stefancamilleri.com/2016/02/14/update-database-fails-in-package-manager-console-on-windows-10-insider-preview-with-ambiguous-type-error/)

Commented Issue: Update-Database and Add-Migration commands fail due to package ambiguity [2872]

$
0
0
---
UPDATE Feb-5-2016
---

We have determined that this is due to a breaking change outside of EF and are working with the Visual Studio and Windows teams to isolate the exact cause of the problem.

> We have been able to determine that executing [NuGet.VisualStudio.IVsPackageInstallerServices].AssemblyQualifiedName in the Package Management Console (which is PowerShell console hosted in VS) throws in recent preview builds but used to work in Windows 10 even if there is more than one assembly loaded in memory that implemented the type.


---

After updating to Windows 10 Enterprise Insider Preview build 11099, I'm now unable to run the 'Update-Database' and 'Add-Migration' commands. I'm using Visual Studio 2015 Update 1 and Entity Framework version 6.1.3.

I don't know how the update and the issue are related, but the commands output the following error:

Type name 'NuGet.VisualStudio.IVsPackageInstallerServices' is ambiguous, it could be 'NuGet.VisualStudio.IVsPackageInstallerServices,
Microsoft.VisualStudio.ApplicationInsights, Version=4.1.60107.3, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or
'NuGet.VisualStudio.IVsPackageInstallerServices, Microsoft.VisualStudio.Web.Application, Version=14.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a'.
At C:\Users\Mateus Rodrigues\OneDrive\Developer\Visual Studio\SiCond\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:1004 char:5
+ $packageInstallerServices = $componentModel.GetService([NuGet.Vis ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [], RuntimeException
+ FullyQualifiedErrorId : AmbiguousTypeReference

You cannot call a method on a null-valued expression.
At C:\Users\Mateus Rodrigues\OneDrive\Developer\Visual Studio\SiCond\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:1006 char:5
+ $vsPackage = $packageInstallerServices.GetInstalledPackages() | ? ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull

Join-Path : Cannot bind argument to parameter 'Path' because it is null.
At C:\Users\Mateus Rodrigues\OneDrive\Developer\Visual Studio\SiCond\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:713 char:28
+ $toolsPath = Join-Path $installPath tools
+ ~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Join-Path], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.JoinPathCommand

Join-Path : Cannot bind argument to parameter 'Path' because it is null.
At C:\Users\Mateus Rodrigues\OneDrive\Developer\Visual Studio\SiCond\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:780 char:74
+ ... [System.Reflection.Assembly]::LoadFrom((Join-Path $ToolsPath EntityF ...
+ ~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Join-Path], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.JoinPathCommand

You cannot call a method on a null-valued expression.
At C:\Users\Mateus Rodrigues\OneDrive\Developer\Visual Studio\SiCond\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:781 char:5
+ $dispatcher = $utilityAssembly.CreateInstance(
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull

Join-Path : Cannot bind argument to parameter 'Path' because it is null.
At C:\Users\Mateus Rodrigues\OneDrive\Developer\Visual Studio\SiCond\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:810 char:20
+ (Join-Path $runner.ToolsPath EntityFramework.PowerShell.dll),
+ ~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Join-Path], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.JoinPathCommand
Comments: I can confirm that the workaround proposed by [StefanCamilleri ](https://www.codeplex.com/site/users/view/StefanCamilleri) is working for me. Many thanks Stefan, you saved my week!

Commented Issue: Update-Database and Add-Migration commands fail due to package ambiguity [2872]

$
0
0
---
UPDATE Feb-5-2016
---

We have determined that this is due to a breaking change outside of EF and are working with the Visual Studio and Windows teams to isolate the exact cause of the problem.

> We have been able to determine that executing [NuGet.VisualStudio.IVsPackageInstallerServices].AssemblyQualifiedName in the Package Management Console (which is PowerShell console hosted in VS) throws in recent preview builds but used to work in Windows 10 even if there is more than one assembly loaded in memory that implemented the type.


---

After updating to Windows 10 Enterprise Insider Preview build 11099, I'm now unable to run the 'Update-Database' and 'Add-Migration' commands. I'm using Visual Studio 2015 Update 1 and Entity Framework version 6.1.3.

I don't know how the update and the issue are related, but the commands output the following error:

Type name 'NuGet.VisualStudio.IVsPackageInstallerServices' is ambiguous, it could be 'NuGet.VisualStudio.IVsPackageInstallerServices,
Microsoft.VisualStudio.ApplicationInsights, Version=4.1.60107.3, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or
'NuGet.VisualStudio.IVsPackageInstallerServices, Microsoft.VisualStudio.Web.Application, Version=14.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a'.
At C:\Users\Mateus Rodrigues\OneDrive\Developer\Visual Studio\SiCond\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:1004 char:5
+ $packageInstallerServices = $componentModel.GetService([NuGet.Vis ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [], RuntimeException
+ FullyQualifiedErrorId : AmbiguousTypeReference

You cannot call a method on a null-valued expression.
At C:\Users\Mateus Rodrigues\OneDrive\Developer\Visual Studio\SiCond\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:1006 char:5
+ $vsPackage = $packageInstallerServices.GetInstalledPackages() | ? ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull

Join-Path : Cannot bind argument to parameter 'Path' because it is null.
At C:\Users\Mateus Rodrigues\OneDrive\Developer\Visual Studio\SiCond\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:713 char:28
+ $toolsPath = Join-Path $installPath tools
+ ~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Join-Path], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.JoinPathCommand

Join-Path : Cannot bind argument to parameter 'Path' because it is null.
At C:\Users\Mateus Rodrigues\OneDrive\Developer\Visual Studio\SiCond\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:780 char:74
+ ... [System.Reflection.Assembly]::LoadFrom((Join-Path $ToolsPath EntityF ...
+ ~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Join-Path], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.JoinPathCommand

You cannot call a method on a null-valued expression.
At C:\Users\Mateus Rodrigues\OneDrive\Developer\Visual Studio\SiCond\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:781 char:5
+ $dispatcher = $utilityAssembly.CreateInstance(
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull

Join-Path : Cannot bind argument to parameter 'Path' because it is null.
At C:\Users\Mateus Rodrigues\OneDrive\Developer\Visual Studio\SiCond\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:810 char:20
+ (Join-Path $runner.ToolsPath EntityFramework.PowerShell.dll),
+ ~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Join-Path], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.JoinPathCommand
Comments: You're welcome [RHAD](https://www.codeplex.com/site/users/view/RHAD) :)

Commented Issue: Update-Database and Add-Migration commands fail due to package ambiguity [2872]

$
0
0
---
UPDATE Feb-5-2016
---

We have determined that this is due to a breaking change outside of EF and are working with the Visual Studio and Windows teams to isolate the exact cause of the problem.

> We have been able to determine that executing [NuGet.VisualStudio.IVsPackageInstallerServices].AssemblyQualifiedName in the Package Management Console (which is PowerShell console hosted in VS) throws in recent preview builds but used to work in Windows 10 even if there is more than one assembly loaded in memory that implemented the type.


---

After updating to Windows 10 Enterprise Insider Preview build 11099, I'm now unable to run the 'Update-Database' and 'Add-Migration' commands. I'm using Visual Studio 2015 Update 1 and Entity Framework version 6.1.3.

I don't know how the update and the issue are related, but the commands output the following error:

Type name 'NuGet.VisualStudio.IVsPackageInstallerServices' is ambiguous, it could be 'NuGet.VisualStudio.IVsPackageInstallerServices,
Microsoft.VisualStudio.ApplicationInsights, Version=4.1.60107.3, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or
'NuGet.VisualStudio.IVsPackageInstallerServices, Microsoft.VisualStudio.Web.Application, Version=14.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a'.
At C:\Users\Mateus Rodrigues\OneDrive\Developer\Visual Studio\SiCond\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:1004 char:5
+ $packageInstallerServices = $componentModel.GetService([NuGet.Vis ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [], RuntimeException
+ FullyQualifiedErrorId : AmbiguousTypeReference

You cannot call a method on a null-valued expression.
At C:\Users\Mateus Rodrigues\OneDrive\Developer\Visual Studio\SiCond\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:1006 char:5
+ $vsPackage = $packageInstallerServices.GetInstalledPackages() | ? ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull

Join-Path : Cannot bind argument to parameter 'Path' because it is null.
At C:\Users\Mateus Rodrigues\OneDrive\Developer\Visual Studio\SiCond\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:713 char:28
+ $toolsPath = Join-Path $installPath tools
+ ~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Join-Path], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.JoinPathCommand

Join-Path : Cannot bind argument to parameter 'Path' because it is null.
At C:\Users\Mateus Rodrigues\OneDrive\Developer\Visual Studio\SiCond\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:780 char:74
+ ... [System.Reflection.Assembly]::LoadFrom((Join-Path $ToolsPath EntityF ...
+ ~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Join-Path], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.JoinPathCommand

You cannot call a method on a null-valued expression.
At C:\Users\Mateus Rodrigues\OneDrive\Developer\Visual Studio\SiCond\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:781 char:5
+ $dispatcher = $utilityAssembly.CreateInstance(
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull

Join-Path : Cannot bind argument to parameter 'Path' because it is null.
At C:\Users\Mateus Rodrigues\OneDrive\Developer\Visual Studio\SiCond\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:810 char:20
+ (Join-Path $runner.ToolsPath EntityFramework.PowerShell.dll),
+ ~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Join-Path], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.JoinPathCommand
Comments: Confirmed that the workaround proposed by StefanCamilleri is working. This seems to be a great temporary solution and perhaps will speed up the discovery of a permanent resolution by the team.

Commented Issue: Update-Database and Add-Migration commands fail due to package ambiguity [2872]

$
0
0
---
UPDATE Feb-5-2016
---

We have determined that this is due to a breaking change outside of EF and are working with the Visual Studio and Windows teams to isolate the exact cause of the problem.

> We have been able to determine that executing [NuGet.VisualStudio.IVsPackageInstallerServices].AssemblyQualifiedName in the Package Management Console (which is PowerShell console hosted in VS) throws in recent preview builds but used to work in Windows 10 even if there is more than one assembly loaded in memory that implemented the type.


---

After updating to Windows 10 Enterprise Insider Preview build 11099, I'm now unable to run the 'Update-Database' and 'Add-Migration' commands. I'm using Visual Studio 2015 Update 1 and Entity Framework version 6.1.3.

I don't know how the update and the issue are related, but the commands output the following error:

Type name 'NuGet.VisualStudio.IVsPackageInstallerServices' is ambiguous, it could be 'NuGet.VisualStudio.IVsPackageInstallerServices,
Microsoft.VisualStudio.ApplicationInsights, Version=4.1.60107.3, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or
'NuGet.VisualStudio.IVsPackageInstallerServices, Microsoft.VisualStudio.Web.Application, Version=14.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a'.
At C:\Users\Mateus Rodrigues\OneDrive\Developer\Visual Studio\SiCond\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:1004 char:5
+ $packageInstallerServices = $componentModel.GetService([NuGet.Vis ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [], RuntimeException
+ FullyQualifiedErrorId : AmbiguousTypeReference

You cannot call a method on a null-valued expression.
At C:\Users\Mateus Rodrigues\OneDrive\Developer\Visual Studio\SiCond\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:1006 char:5
+ $vsPackage = $packageInstallerServices.GetInstalledPackages() | ? ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull

Join-Path : Cannot bind argument to parameter 'Path' because it is null.
At C:\Users\Mateus Rodrigues\OneDrive\Developer\Visual Studio\SiCond\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:713 char:28
+ $toolsPath = Join-Path $installPath tools
+ ~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Join-Path], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.JoinPathCommand

Join-Path : Cannot bind argument to parameter 'Path' because it is null.
At C:\Users\Mateus Rodrigues\OneDrive\Developer\Visual Studio\SiCond\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:780 char:74
+ ... [System.Reflection.Assembly]::LoadFrom((Join-Path $ToolsPath EntityF ...
+ ~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Join-Path], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.JoinPathCommand

You cannot call a method on a null-valued expression.
At C:\Users\Mateus Rodrigues\OneDrive\Developer\Visual Studio\SiCond\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:781 char:5
+ $dispatcher = $utilityAssembly.CreateInstance(
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull

Join-Path : Cannot bind argument to parameter 'Path' because it is null.
At C:\Users\Mateus Rodrigues\OneDrive\Developer\Visual Studio\SiCond\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:810 char:20
+ (Join-Path $runner.ToolsPath EntityFramework.PowerShell.dll),
+ ~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Join-Path], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.JoinPathCommand
Comments: Works! Thank you @StefanCamilleri

Commented Issue: Update-Database and Add-Migration commands fail due to package ambiguity [2872]

$
0
0
---
UPDATE Feb-5-2016
---

We have determined that this is due to a breaking change outside of EF and are working with the Visual Studio and Windows teams to isolate the exact cause of the problem.

> We have been able to determine that executing [NuGet.VisualStudio.IVsPackageInstallerServices].AssemblyQualifiedName in the Package Management Console (which is PowerShell console hosted in VS) throws in recent preview builds but used to work in Windows 10 even if there is more than one assembly loaded in memory that implemented the type.


---

After updating to Windows 10 Enterprise Insider Preview build 11099, I'm now unable to run the 'Update-Database' and 'Add-Migration' commands. I'm using Visual Studio 2015 Update 1 and Entity Framework version 6.1.3.

I don't know how the update and the issue are related, but the commands output the following error:

Type name 'NuGet.VisualStudio.IVsPackageInstallerServices' is ambiguous, it could be 'NuGet.VisualStudio.IVsPackageInstallerServices,
Microsoft.VisualStudio.ApplicationInsights, Version=4.1.60107.3, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or
'NuGet.VisualStudio.IVsPackageInstallerServices, Microsoft.VisualStudio.Web.Application, Version=14.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a'.
At C:\Users\Mateus Rodrigues\OneDrive\Developer\Visual Studio\SiCond\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:1004 char:5
+ $packageInstallerServices = $componentModel.GetService([NuGet.Vis ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [], RuntimeException
+ FullyQualifiedErrorId : AmbiguousTypeReference

You cannot call a method on a null-valued expression.
At C:\Users\Mateus Rodrigues\OneDrive\Developer\Visual Studio\SiCond\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:1006 char:5
+ $vsPackage = $packageInstallerServices.GetInstalledPackages() | ? ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull

Join-Path : Cannot bind argument to parameter 'Path' because it is null.
At C:\Users\Mateus Rodrigues\OneDrive\Developer\Visual Studio\SiCond\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:713 char:28
+ $toolsPath = Join-Path $installPath tools
+ ~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Join-Path], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.JoinPathCommand

Join-Path : Cannot bind argument to parameter 'Path' because it is null.
At C:\Users\Mateus Rodrigues\OneDrive\Developer\Visual Studio\SiCond\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:780 char:74
+ ... [System.Reflection.Assembly]::LoadFrom((Join-Path $ToolsPath EntityF ...
+ ~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Join-Path], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.JoinPathCommand

You cannot call a method on a null-valued expression.
At C:\Users\Mateus Rodrigues\OneDrive\Developer\Visual Studio\SiCond\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:781 char:5
+ $dispatcher = $utilityAssembly.CreateInstance(
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull

Join-Path : Cannot bind argument to parameter 'Path' because it is null.
At C:\Users\Mateus Rodrigues\OneDrive\Developer\Visual Studio\SiCond\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:810 char:20
+ (Join-Path $runner.ToolsPath EntityFramework.PowerShell.dll),
+ ~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Join-Path], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.JoinPathCommand
Comments: @StefanCamilleri This is great - my only concern is that the MS teams de-prioritise this now there is a workaround available. Here's hoping they can either build on what you've done or come up with a 'real' solution to the underlying problem/change and that they do it soon. In the mean time - many thanks as I have been having to try and do EF work on a Hyper-V instance which has not, so far, been very successful. Cheers, Cynthia

Edited Task: Add VS2015 support to Power Tools VSIX [2881]

$
0
0
EF power tools are not listed as an extension for Visual Studio 2015. The VSIX needs to be updated with
<VisualStudio Version-"14.0">
<Edition>Pro</Edition>
</VisualStudio>

I've been using a modified VSIX but have only used it for View Entity Data Model (Read-Only) feature. Not sure if there are other known problems.

Closed Unassigned: Issues with : Migration, FK removed and generated SQL. [2879]

$
0
0
Hi guys.

Here is my problem, first time i met this kind of behaviour in entity framework 6.1.3

I just made a short solution to show you the problem.

Repro step:
1. In your project, create 2 classes: for my example, the House, and the Rooms. One house can contains rooms. But one room can only be in 1 house.

2. Enable Migration in the nuget console. Add-Migration Initial. Then Update-Database.

For "context.Rooms.ToString()" , Look at the generated SQL:
SELECT
[Extent1].[RoomId] AS [RoomId],
[Extent1].[Name] AS [Name],
[Extent1].[HouseId] AS [HouseId]
FROM [dbo].[Rooms] AS [Extent1]

3. Go the Room.cs. Comment the navigation property House and the foreign key property HouseID.

4. Add-Migration Room_RemoveFK. Update-Database Again.

And now, look at the generated SQL:
SELECT
[Extent1].[RoomId] AS [RoomId],
[Extent1].[Name] AS [Name],
__[Extent1].[House_HouseId] AS [House_HouseId]__
FROM [dbo].[Rooms] AS [Extent1]

I understand why the column is still here. In case of data. So i understand the steps consisting renaming it in the migration file.

But why this column is still here in the generated SQL ? Since the properties are no more in the code, this doesn't make sense.

Furthermore, if i delete this column in the database, the generated SQL causes a crash in the application, cause the column doesn't exist anymore.

How to deal with this ? Is this a bug ?

In the zip file, there is not any nuget package due to size limitation...

Comments: See comments

Edited Unassigned: Visual Studio 2015 crashes with EF 6.1.3 [2878]

$
0
0
I've a VB solution in VS 2015 Community Update 1, .Net 4.6.1 on Windows 8.1 64 bit with a Windows form executable project and class library project.
In the class library project i defined an entity model using EF 6.1.3 with database first: database is a SQL Server Express database with compatibility level set to 120.
Database contains some tables with relations between them, which are reflected in the model.
In the Winform project a reference is set to the class library one and the connection string has been copied in App.Config.
In the DataSource window entities from the model have been added. Everything works fine until the project window for the form become the active one: at this moment if you try to perform one of the following tasks:
- drag an entity from the DataSource window to the form;
- open and show in the DataSource window the elements list of an entity clicking on the left arrow;
- change in the DataSource window the way the entity should be dragged to the form (detail or datagrid),
Visual Studio stops responding and after a while crashes without any meaningful message.

I also noticed that if no relation between entities exists in the model, then it's possibile to drag the entity from the DataSource window to the form without any issue if you use DataGridView; however, if Detail mode is used, no crash occurs but some fields from the entity are not dragged to the form as they are not linked to any control (in the DataSource window no control is in the list related to these fields and Nothing is the only option).

Morevover, if after having dragged the unrelated entity from the DataSource window to the form you add a relation between entities in the model, as you click on the form window and active it Visual Studio again crashes.

Accordingly to the application log the issue was caused by MSVCR120_CLR0400.dll, version: 12.0.52512.0, exception code 0xc00000fd

Thanks to anybody could help me in solving this issue.

Stefano

Commented Issue: Update-Database and Add-Migration commands fail due to package ambiguity [2872]

$
0
0
---
UPDATE Feb-5-2016
---

We have determined that this is due to a breaking change outside of EF and are working with the Visual Studio and Windows teams to isolate the exact cause of the problem.

> We have been able to determine that executing [NuGet.VisualStudio.IVsPackageInstallerServices].AssemblyQualifiedName in the Package Management Console (which is PowerShell console hosted in VS) throws in recent preview builds but used to work in Windows 10 even if there is more than one assembly loaded in memory that implemented the type.


---

After updating to Windows 10 Enterprise Insider Preview build 11099, I'm now unable to run the 'Update-Database' and 'Add-Migration' commands. I'm using Visual Studio 2015 Update 1 and Entity Framework version 6.1.3.

I don't know how the update and the issue are related, but the commands output the following error:

Type name 'NuGet.VisualStudio.IVsPackageInstallerServices' is ambiguous, it could be 'NuGet.VisualStudio.IVsPackageInstallerServices,
Microsoft.VisualStudio.ApplicationInsights, Version=4.1.60107.3, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or
'NuGet.VisualStudio.IVsPackageInstallerServices, Microsoft.VisualStudio.Web.Application, Version=14.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a'.
At C:\Users\Mateus Rodrigues\OneDrive\Developer\Visual Studio\SiCond\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:1004 char:5
+ $packageInstallerServices = $componentModel.GetService([NuGet.Vis ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [], RuntimeException
+ FullyQualifiedErrorId : AmbiguousTypeReference

You cannot call a method on a null-valued expression.
At C:\Users\Mateus Rodrigues\OneDrive\Developer\Visual Studio\SiCond\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:1006 char:5
+ $vsPackage = $packageInstallerServices.GetInstalledPackages() | ? ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull

Join-Path : Cannot bind argument to parameter 'Path' because it is null.
At C:\Users\Mateus Rodrigues\OneDrive\Developer\Visual Studio\SiCond\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:713 char:28
+ $toolsPath = Join-Path $installPath tools
+ ~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Join-Path], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.JoinPathCommand

Join-Path : Cannot bind argument to parameter 'Path' because it is null.
At C:\Users\Mateus Rodrigues\OneDrive\Developer\Visual Studio\SiCond\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:780 char:74
+ ... [System.Reflection.Assembly]::LoadFrom((Join-Path $ToolsPath EntityF ...
+ ~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Join-Path], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.JoinPathCommand

You cannot call a method on a null-valued expression.
At C:\Users\Mateus Rodrigues\OneDrive\Developer\Visual Studio\SiCond\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:781 char:5
+ $dispatcher = $utilityAssembly.CreateInstance(
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull

Join-Path : Cannot bind argument to parameter 'Path' because it is null.
At C:\Users\Mateus Rodrigues\OneDrive\Developer\Visual Studio\SiCond\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:810 char:20
+ (Join-Path $runner.ToolsPath EntityFramework.PowerShell.dll),
+ ~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Join-Path], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.JoinPathCommand
Comments: After updating to Windows 10 Enterprise Insider Preview build 11099, I'm now unable to run the 'Update-Database' and 'Add-Migration' commands. I'm using Visual Studio 2015 Update 1 and Entity Framework version 6.1.3.

Commented Unassigned: migrate.exe, on a build server, wants to "start over" with migrations [2883]

$
0
0
Cross posted at [StackOverflow](http://stackoverflow.com/questions/35326171/migrate-exe-on-a-build-server-wants-to-start-over-with-migrations).

Part of our automated build process involves running migrate.exe to update test databases to the latest version of the database.

The process is relatively simple:

1. Copy migrate.exe to the /bin folder of the project being compiled
2. Execute migrate.exe with the connection string (specified as part of the build definition).

An example of step two (redacted, obviously) would be:

```
migrate.exe Company.Data.dll /connectionString="Server=...;Database=...;User Id=...;Password=..." /connectionProviderName="System.Data.SqlClient"
```

where Company.Data.dll is the just-built output of the project being compiled on the build server.

This process has been in place for a few months and has been working fine. Until today.

Today, when the above command runs, migrate.exe tries to run ALL of the migrations - starting from the beginning - not just the new ones that were added. This obviously fails because it tries to create tables that already exist in the database. The problem occurs whether there are actually pending migrations or not.

I've confirmed that the database pointed to by the connection string shown in the log file is the correct one and that it has all of the appropriate entries in the __MigrationHistory table that should cause migrations to just enter what is missing.

If I pull down the code from source control, build it and run migrate.exe myself locally (with the same connection string) it acts appropriately (initially running just the migrations it should, then on subsequent tries saying there were no pending explicit migrations).

It would seem to me that as long as the connection string was pointed at the right database and the name of the DbContext-derived class used for EF matches what is in the __MigrationHistory table, migrate.exe should be able to find the entries and not run those migrations.

What else am I missing that I should look at?

__Update:__
I've just had this happen when pointed at a different database on the same server. Same "workaround" (running migrate.exe locally). Just interesting to note that it happened exactly the same way when pointed at a different database.
Comments: I'm wondering if there is an issue with the ContextKey being used to identify the records that belong to the context being migrated. Would it be possible to capture the SQL that EF is sending to the database when migrate.exe is running and then also post the contents of the __MigrationHistory table? Also, just to rule out another possibility, have you made any customizations to the __MigrationHistory table (changed schema, etc.)?

Commented Unassigned: Foreign Key error on code first migration [2880]

$
0
0
I'm having a hard time getting some foreign keys to generate correctly in a migration.

This is what I'm trying to achieve (with some fields omitted for brevity):

![Image](http://s11.postimg.org/mrhh3tu0z/Capture.png)

My classes/Entities are as you'd expect:

```
public class PrivateExchange {

public int ID { get; set; }
public int AccountID { get; set; }
public int ExtensionLength { get; set; }
public string OutsideLinePrefix { get; set; }

// Other fields omitted...

public virtual ICollection<Extension> Extensions { get; set; }
public virtual ICollection<Branch> Branches { get; set; }
}

public class Branch {

public int ID { get; set; }
public int PrivateExchangeID { get; set; }
public int PurchasedQuantity { get; set; }
public string Features { get; set; }

public virtual PrivateExchange PrivateExchange { get; set; }
public virtual ICollection<Extension> Extensions { get; set; }

}

public abstract partial class Extension {

public int ID { get; set; }
public int PrivateExchangeID { get; set; }
public int BranchID { get; set; }
public string Number { get; set; }
public virtual PrivateExchange PrivateExchange { get; set; }
public virtual Branch Branch { get; set; }

}

public class Endpoint : Extension {

public EndpointStatuses Status { get; set; }
public string CLI { get; set; }

}

// Menu and queue are very similar to Endpoint, just with different fields. You get the idea.

// DbContext:
public class PBXContext : DbContext {

public IDbSet<PrivateExchange> PrivateExchanges { get; set; }
public IDbSet<Branch> Branches { get; set; }
public IDbSet<Extension> Extensions { get; set; }

protected override void OnModelCreating(DbModelBuilder modelBuilder) {

modelBuilder.HasDefaultSchema("pbx");

modelBuilder.Entity<Endpoint>().ToTable("Endpoints");
modelBuilder.Entity<Menu>().ToTable("Menus");
modelBuilder.Entity<Queue>().ToTable("Queues");

base.OnModelCreating(modelBuilder);
}
}
```

When I generate the migration for this, the foreign keys on the Extensions table are all screwed up. It doesn't seem to recognise that PrivateExchangeID is the foreign key, and tries to create a new separate foreign key instead.

This is what I end up with:

```
CreateTable(
"vspbx.Branches",
c => new
{
ID = c.Int(nullable: false, identity: true),
PrivateExchangeID = c.Int(nullable: false),
PurchasedQuantity = c.Int(nullable: false),
Features = c.String(),
})
.PrimaryKey(t => t.ID)
.ForeignKey("vspbx.PrivateExchanges", t => t.PrivateExchangeID, cascadeDelete: true)
.Index(t => t.PrivateExchangeID);

CreateTable(
"vspbx.Extensions",
c => new
{
ID = c.Int(nullable: false),
PrivateExchangeID = c.Int(nullable: false), // <- this is what I want the foreign key to be, but it ignores this.
BranchID = c.Int(nullable: false),
Number = c.String(),
PrivateExchange_ID = c.Int(), // <-- Where has this come from??
})
.PrimaryKey(t => t.ID)
.ForeignKey("vspbx.Branches", t => t.BranchID, cascadeDelete: true)
.ForeignKey("vspbx.PrivateExchanges", t => t.PrivateExchange_ID) // <-- This is wrong! should be PrivateExchangeID
.ForeignKey("vspbx.PrivateExchanges", t => t.ID) // <-- Eh??
.Index(t => t.ID)
.Index(t => t.BranchID)
.Index(t => t.PrivateExchange_ID);

CreateTable(
"vspbx.PrivateExchanges",
c => new
{
ID = c.Int(nullable: false, identity: true),
AccountID = c.Int(nullable: false),
ExtensionLength = c.Int(nullable: false),
OutsideLinePrefix = c.String(),
// ....
})
.PrimaryKey(t => t.ID);

CreateTable(
"vspbx.Endpoints",
c => new
{
ID = c.Int(nullable: false),
Status = c.Int(nullable: false),
CLI = c.String(),
})
.PrimaryKey(t => t.ID)
.ForeignKey("vspbx.Extensions", t => t.ID)
.Index(t => t.ID);
```

I've marked the problems with comments.

Why is entity framework migrations adding in the extra PrivateExchange_ID foreign key when it should just use the property that I provided: PrivateExchangeID...?
Comments: Hey, EF would introduce the `PrivateExchange_ID` column if it was not able to find a foreign key property by convention... though as you said, it should be detecting `PrivateExchangeID` as the foreign key property. Based on the code you provided I'm not able to reproduce the issue. My guess is that there is something more complex in your full model that is causing EF to not detect the foreign key correctly. Here is the code I used to try and reproduce it. ``` public class PrivateExchange { public int ID { get; set; } public int AccountID { get; set; } public int ExtensionLength { get; set; } public string OutsideLinePrefix { get; set; } public virtual ICollection<Extension> Extensions { get; set; } public virtual ICollection<Branch> Branches { get; set; } } public class Branch { public int ID { get; set; } public int PrivateExchangeID { get; set; } public int PurchasedQuantity { get; set; } public string Features { get; set; } public virtual PrivateExchange PrivateExchange { get; set; } public virtual ICollection<Extension> Extensions { get; set; } } public abstract partial class Extension { public int ID { get; set; } public int PrivateExchangeID { get; set; } public int BranchID { get; set; } public string Number { get; set; } public virtual PrivateExchange PrivateExchange { get; set; } public virtual Branch Branch { get; set; } } public class Endpoint : Extension { public string CLI { get; set; } } public class PBXContext : DbContext { public IDbSet<PrivateExchange> PrivateExchanges { get; set; } public IDbSet<Branch> Branches { get; set; } public IDbSet<Extension> Extensions { get; set; } protected override void OnModelCreating(DbModelBuilder modelBuilder) { modelBuilder.HasDefaultSchema("pbx"); modelBuilder.Entity<Endpoint>().ToTable("Endpoints"); } } ``` Using EF6.1.3, it correctly detects the foreign key. Here is the code generated in the migration. ``` ... CreateTable( "pbx.Extensions", c => new { ID = c.Int(nullable: false, identity: true), PrivateExchangeID = c.Int(nullable: false), BranchID = c.Int(nullable: false), Number = c.String(), }) .PrimaryKey(t => t.ID) .ForeignKey("pbx.Branches", t => t.BranchID, cascadeDelete: true) .ForeignKey("pbx.PrivateExchanges", t => t.PrivateExchangeID, cascadeDelete: true) .Index(t => t.PrivateExchangeID) .Index(t => t.BranchID); ... ``` Could you adjust the code listing above to something that reproduces the issue so that we can debug it for you. ~Rowan

Closed Unassigned: Generated SQL depends on the order of property setters in the materialized type [2877]

$
0
0
We have the following model in EF v6.1.3:
![Image](https://www.dropbox.com/s/ilvpos5y0cndkbw/ZooModel_MSSQL.jpg?raw=1)

Note that VW_MACSKA_VALIDITY is a view, and the association between VW_MACSKA_VALIDITY and MACSKA is only a conceptual level association.

The following query
```
ctx.MACSKAs.AsNoTracking()
.Select(
e => new
{
e.VW_MACSKA_VALIDITY.MCSVALIDFROM,
e.ZEBRA.NAME
}
).Take(5).ToList();
```
generates
```
SELECT
[Limit1].[C1] AS [C1],
[Limit1].[MCSVALIDFROM] AS [MCSVALIDFROM],
[Limit1].[NAME] AS [NAME]
FROM ( SELECT TOP (5)
[Extent2].[MCSVALIDFROM] AS [MCSVALIDFROM],
[Extent3].[NAME] AS [NAME],
1 AS [C1]
FROM [dbo].[MACSKA] AS [Extent1]
LEFT OUTER JOIN (SELECT
[VW_MACSKA_VALIDITY].[MACSKAID] AS [MACSKAID],
[VW_MACSKA_VALIDITY].[MCSVALIDFROM] AS [MCSVALIDFROM],
[VW_MACSKA_VALIDITY].[VALIDTO] AS [VALIDTO],
[VW_MACSKA_VALIDITY].[FKPROP] AS [FKPROP],
[VW_MACSKA_VALIDITY].[ZEBRAID] AS [ZEBRAID]
FROM [dbo].[VW_MACSKA_VALIDITY] AS [VW_MACSKA_VALIDITY]) AS [Extent2] ON [Extent1].[MACSKAID] = [Extent2].[MACSKAID]
INNER JOIN [dbo].[ZEBRA] AS [Extent3] ON [Extent1].[ZEBRAID] = [Extent3].[ZEBRAID]
) AS [Limit1]
```
but when we reorder the properties in the anonymous class
```
ctx.MACSKAs.AsNoTracking()
.Select(
e => new
{
e.ZEBRA.NAME,
e.VW_MACSKA_VALIDITY.MCSVALIDFROM,
}
).Take(5).ToList();
```
it generates
```
SELECT
[Limit1].[C1] AS [C1],
[Limit1].[NAME] AS [NAME],
[Limit1].[MCSVALIDFROM] AS [MCSVALIDFROM]
FROM ( SELECT TOP (5)
[Extent3].[NAME] AS [NAME],
[Extent4].[MCSVALIDFROM] AS [MCSVALIDFROM],
1 AS [C1]
FROM [dbo].[MACSKA] AS [Extent1]
LEFT OUTER JOIN (SELECT
[VW_MACSKA_VALIDITY].[MACSKAID] AS [MACSKAID],
[VW_MACSKA_VALIDITY].[MCSVALIDFROM] AS [MCSVALIDFROM],
[VW_MACSKA_VALIDITY].[VALIDTO] AS [VALIDTO],
[VW_MACSKA_VALIDITY].[FKPROP] AS [FKPROP],
[VW_MACSKA_VALIDITY].[ZEBRAID] AS [ZEBRAID]
FROM [dbo].[VW_MACSKA_VALIDITY] AS [VW_MACSKA_VALIDITY]) AS [Extent2] ON [Extent1].[MACSKAID] = [Extent2].[MACSKAID]
INNER JOIN [dbo].[ZEBRA] AS [Extent3] ON [Extent1].[ZEBRAID] = [Extent3].[ZEBRAID]
LEFT OUTER JOIN (SELECT
[VW_MACSKA_VALIDITY].[MACSKAID] AS [MACSKAID],
[VW_MACSKA_VALIDITY].[MCSVALIDFROM] AS [MCSVALIDFROM],
[VW_MACSKA_VALIDITY].[VALIDTO] AS [VALIDTO],
[VW_MACSKA_VALIDITY].[FKPROP] AS [FKPROP],
[VW_MACSKA_VALIDITY].[ZEBRAID] AS [ZEBRAID]
FROM [dbo].[VW_MACSKA_VALIDITY] AS [VW_MACSKA_VALIDITY]) AS [Extent4] ON [Extent1].[MACSKAID] = [Extent4].[MACSKAID]
) AS [Limit1]
```
Note the extra join of VW_MACSKA_VALIDITY in the latter test case. Why is the generated SQL different for the EF queries above?

Sample project attached.

Comments: **EF Team Triage:** The query pipeline in EF6.x is very complicated and anytime we adjust anything it tends to have a lot of unexpected side effects in seemingly unrelated queries. Because this query is generating SQL that is functional, but not optimal, and because there is an easy workaround to get the more optimal SQL, we have decided not to try and address this one.
Viewing all 10318 articles
Browse latest View live


Latest Images