小编Val*_*met的帖子

无法安装 symfony/maker-bundle

我是 Symfony 的新手,我尝试安装symfony/maker-bundle,但它给了我以下错误:

Using version ^1.22 for symfony/maker-bundle
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Restricting packages listed in "symfony/symfony" to "4.4.*"
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - ocramius/proxy-manager 2.9.0 requires composer-runtime-api ^2.0.0 -> no matching package found.
    - ocramius/proxy-manager 2.9.0 requires composer-runtime-api ^2.0.0 -> no matching package found.
    - ocramius/proxy-manager 2.9.0 requires composer-runtime-api ^2.0.0 -> no matching package found.
    - Installation …
Run Code Online (Sandbox Code Playgroud)

php symfony composer-php

5
推荐指数
1
解决办法
2051
查看次数

EF Core EnsureDeleted 抛出“无法使用用户‘sa’登录”

我正在尝试使用Microsoft 文档中的这段代码来实现 EF Core 的单元/集成测试。

但是调用EnsureDeleted()不起作用,会抛出错误

SqlException:用户“sa”登录失败

这是 MS 文档中的示例:

public class SharedDatabaseFixture : IDisposable
{
    private static readonly object LockObject = new object(); 
    private static bool isDatabaseInitialized; 

    public SharedDatabaseFixture()
    {
        Connection = new SqlConnection("Server =; Database=; User Id=; Password=");

        Seed();
    
        Connection.Open();
    }

    public DbConnection Connection { get; }

    public OnlineMenuContext CreateContext(DbTransaction transaction = null)
    {
        var context = new OnlineMenuContext(
            new DbContextOptionsBuilder<OnlineMenuContext>().UseSqlServer(Connection)
                .Options
            );

        if (transaction != null)
        {
            context.Database.UseTransaction(transaction);
        }
    
        return context;
    }

    private void …
Run Code Online (Sandbox Code Playgroud)

c# entity-framework-core .net-core

2
推荐指数
1
解决办法
2265
查看次数