Loading...
xaxa96 avatar xaxa96 1 Точки

Проблем със задачите от Entity Framework Introduction.

Здравейте,

При пускане на файла за решение на задача за C# DB Advanced, Judge ми дава следната грешка:

Compiled file is missing. Compiler output: MSBuild version 17.3.2+561848881 for .NET

А това е кодът и проектът:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net6.0</TargetFramework>
    <RootNamespace>_02.DatabaseFirst</RootNamespace>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.Build" Version="17.8.3" />
    <PackageReference Include="Microsoft.Build.Framework" Version="17.8.3" />
    <PackageReference Include="System.Data.SqlClient" Version="4.8.5" />
  </ItemGroup>

</Project>
using System;
using System.Data.SqlClient;

namespace _02.DatabaseFirst;

public class Program
{
    private const string connectionString = @"Server=localhost;Database=MinionsDB;User Id=sa;Password=Husabergfs650";
    public static void Main(string[] args)
    {
        using SqlConnection sqlConnection = new SqlConnection(connectionString);
        try
        {
            sqlConnection.Open();
            using SqlCommand getViliansCommand = new SqlCommand(SqlQueries.VilliansWithMoreThan3Minions, sqlConnection);
            using SqlDataReader sqlReader = getViliansCommand.ExecuteReader();

            while (sqlReader.Read())
            {
                Console.WriteLine($"{sqlReader["Name"]} - {sqlReader["MinionsCount"]}");
            }
        }
        finally
        {
            sqlConnection.Close();
        }
    }
}
namespace _02.DatabaseFirst;

public static class SqlQueries
{
    public const string VilliansWithMoreThan3Minions = @"SELECT Name
                                                              ,COUNT(*) AS MinionsCount
                                                        FROM Villains v
                                                        JOIN MinionsVillains mv ON v.Id = mv.VillainId
                                                        GROUP BY Name
                                                        HAVING COUNT(*) > 3
                                                        ORDER BY MinionsCount";


}

Ако някой е имал подобен проблем, моля да сподели, понеже не успях да разбера каква е причината?

Тагове:
xaxa96 avatar xaxa96 1 Точки

А това е и цялата грешка:

Compiled file is missing. Compiler output: MSBuild version 17.3.2+561848881 for .NET
  Determining projects to restore...
  Restored /tmp/ExecutionStrategies/5s4fpgyr.rmo/UserProject/02.DatabaseFirst.csproj (in 3.06 sec).
  Restored /tmp/ExecutionStrategies/5s4fpgyr.rmo/NUnitLiteConsoleApp/NUnitLiteConsoleApp.csproj (in 3.06 sec).
  02.DatabaseFirst -> /tmp/ExecutionStrategies/5s4fpgyr.rmo/NUnitLiteConsoleApp/CompilationDir/02.DatabaseFirst.dll
/tmp/ExecutionStrategies/5s4fpgyr.rmo/NUnitLiteConsoleApp/Test_002_000_001.cs(9,7): error CS0246: The type or namespace name 'SoftUni' could not be found (are you missing a using directive or an assembly reference?) [/tmp/ExecutionStrategies/5s4fpgyr.rmo/NUnitLiteConsoleApp/NUnitLiteConsoleApp.csproj]
/tmp/ExecutionStrategies/5s4fpgyr.rmo/NUnitLiteConsoleApp/Test_002_000_001.cs(10,7): error CS0246: The type or namespace name 'SoftUni' could not be found (are you missing a using directive or an assembly reference?) [/tmp/ExecutionStrategies/5s4fpgyr.rmo/NUnitLiteConsoleApp/NUnitLiteConsoleApp.csproj]
/tmp/ExecutionStrategies/5s4fpgyr.rmo/NUnitLiteConsoleApp/Test_002_000_001.cs(11,7): error CS0246: The type or namespace name 'SoftUni' could not be found (are you missing a using directive or an assembly reference?) [/tmp/ExecutionStrategies/5s4fpgyr.rmo/NUnitLiteConsoleApp/NUnitLiteConsoleApp.csproj]
/tmp/ExecutionStrategies/5s4fpgyr.rmo/NUnitLiteConsoleApp/Test_002_001_001.cs(8,7): error CS0246: The type or namespace name 'SoftUni' could not be found (are you missing a using directive or an assembly reference?) [/tmp/ExecutionStrategies/5s4fpgyr.rmo/NUnitLiteConsoleApp/NUnitLiteConsoleApp.csproj]
/tmp/ExecutionStrategies/5s4fpgyr.rmo/NUnitLiteConsoleApp/Test_002_001_002.cs(6,37): error CS0234: The type or namespace name 'SqlServer' does not exist in the namespace 'Microsoft.EntityFrameworkCore' (are you missing an assembly reference?) [/tmp/ExecutionStrategies/5s4fpgyr.rmo/NUnitLiteConsoleApp/NUnitLiteConsoleApp.csproj]
/tmp/ExecutionStrategies/5s4fpgyr.rmo/NUnitLiteConsoleApp/Test_002_001_002.cs(9,7): error CS0246: The type or namespace name 'SoftUni' could not be found (are you missing a using directive or an assembly reference?) [/tmp/ExecutionStrategies/5s4fpgyr.rmo/NUnitLiteConsoleApp/NUnitLiteConsoleApp.csproj]
/tmp/ExecutionStrategies/5s4fpgyr.rmo/NUnitLiteConsoleApp/Test_002_001_002.cs(10,7): error CS0246: The type or namespace name 'SoftUni' could not be found (are you missing a using directive or an assembly reference?) [/tmp/ExecutionStrategies/5s4fpgyr.rmo/NUnitLiteConsoleApp/NUnitLiteConsoleApp.csproj]

Build FAILED.

/tmp/ExecutionStrategies/5s4fpgyr.rmo/NUnitLiteConsoleApp/Test_002_000_001.cs(9,7): error CS0246: The type or namespace name 'SoftUni' could not be found (are you missing a using directive or an assembly reference?) [/tmp/ExecutionStrategies/5s4fpgyr.rmo/NUnitLiteConsoleApp/NUnitLiteConsoleApp.csproj]
/tmp/ExecutionStrategies/5s4fpgyr.rmo/NUnitLiteConsoleApp/Test_002_000_001.cs(10,7): error CS0246: The type or namespace name 'SoftUni' could not be found (are you missing a using directive or an assembly reference?) [/tmp/ExecutionStrategies/5s4fpgyr.rmo/NUnitLiteConsoleApp/NUnitLiteConsoleApp.csproj]
/tmp/ExecutionStrategies/5s4fpgyr.rmo/NUnitLiteConsoleApp/Test_002_000_001.cs(11,7): error CS0246: The type or namespace name 'SoftUni' could not be found (are you missing a using directive or an assembly reference?) [/tmp/ExecutionStrategies/5s4fpgyr.rmo/NUnitLiteConsoleApp/NUnitLiteConsoleApp.csproj]
/tmp/ExecutionStrategies/5s4fpgyr.rmo/NUnitLiteConsoleApp/Test_002_001_001.cs(8,7): error CS0246: The type or namespace name 'SoftUni' could not be found (are you missing a using directive or an assembly reference?) [/tmp/ExecutionStrategies/5s4fpgyr.rmo/NUnitLiteConsoleApp/NUnitLiteConsoleApp.csproj]
/tmp/ExecutionStrategies/5s4fpgyr.rmo/NUnitLiteConsoleApp/Test_002_001_002.cs(6,37): error CS0234: The type or namespace name 'SqlServer' does not exist in the namespace 'Microsoft.EntityFrameworkCore' (are you missing an assembly reference?) [/tmp/ExecutionStrategies/5s4fpgyr.rmo/NUnitLiteConsoleApp/NUnitLiteConsoleApp.csproj]
/tmp/ExecutionStrategies/5s4fpgyr.rmo/NUnitLiteConsoleApp/Test_002_001_002.cs(9,7): error CS0246: The type or namespace name 'SoftUni' could not be found (are you missing a using directive or an assembly reference?) [/tmp/ExecutionStrategies/5s4fpgyr.rmo/NUnitLiteConsoleApp/NUnitLiteConsoleApp.csproj]
/tmp/ExecutionStrategies/5s4fpgyr.rmo/NUnitLiteConsoleApp/Test_002_001_002.cs(10,7): error CS0246: The type or namespace name 'SoftUni' could not be found (are you missing a using directive or an assembly reference?) [/tmp/ExecutionStrategies/5s4fpgyr.rmo/NUnitLiteConsoleApp/NUnitLiteConsoleApp.csproj]
    0 Warning(s)
    7 Error(s)

Time Elapsed 00:00:10.85

 

0
Можем ли да използваме бисквитки?
Ние използваме бисквитки и подобни технологии, за да предоставим нашите услуги. Можете да се съгласите с всички или част от тях.
Назад
Функционални
Използваме бисквитки и подобни технологии, за да предоставим нашите услуги. Използваме „сесийни“ бисквитки, за да Ви идентифицираме временно. Те се пазят само по време на активната употреба на услугите ни. След излизане от приложението, затваряне на браузъра или мобилното устройство, данните се трият. Използваме бисквитки, за да предоставим опцията „Запомни Ме“, която Ви позволява да използвате нашите услуги без да предоставяте потребителско име и парола. Допълнително е възможно да използваме бисквитки за да съхраняваме различни малки настройки, като избор на езика, позиции на менюта и персонализирано съдържание. Използваме бисквитки и за измерване на маркетинговите ни усилия.
Рекламни
Използваме бисквитки, за да измерваме маркетинг ефективността ни, броене на посещения, както и за проследяването дали дадено електронно писмо е било отворено.