Skip to content

Tons of exceptions thrown in trying to generate CRUD, PostgreSQL DB #266

@jbsiii-3

Description

@jbsiii-3

Hi,
I've used Scaffold-DbContext to create the model classes for a database, which works fine. When I attempt to use Dapper to generate the CRUD infrastructure, I get tons of errors in the window at the bottom, which doesn't scroll at all. I can drag below the bottom to view the error text, and have copied the first part of the errors below.

This was working but now isn't. Thoughts?
Error during the operation: Compiler Errors :
Line 105,10 : #warning: 'To protect potentially sensitive information in your connection string, you should move it out of source code. You can avoid scaffolding the connection string by using the Name= syntax to read it from configuration - see https://go.microsoft.com/fwlink/?linkid=2131148. For more guidance on storing connection strings, see http://go.microsoft.com/fwlink/?LinkId=723263.'
Line 4,37 : The type or namespace name 'Metadata' does not exist in the namespace 'Microsoft.EntityFrameworkCore' (are you missing an assembly reference?)
Line 6,32 : The type or namespace name 'RazorPages' does not exist in the namespace 'Microsoft.AspNetCore.Mvc' (are you missing an assembly reference?)
Line 69,39 : The type or namespace name 'DbContext' could not be found (are you missing a using directive or an assembly reference?)
Line 1163,31 : The type or namespace name 'PageModel' could not be found (are you missing a using directive or an assembly reference?)
Line 54,22 : The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
Line 804,22 : The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
Line 80,24 : The type or namespace name 'DbSet<>' could not be found (are you missing a using directive or an assembly reference?)
Line 888,22 : The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
Line 889,22 : The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
Line 890,22 : The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
Line 908,22 : The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
Line 29,22 : The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
Line 30,22 : The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
Line 31,22 : The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
Line 32,22 : The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
Line 33,22 : The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
Line 55,22 : The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
Line 34,22 : The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
Line 35,22 : The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
Line 56,22 : The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
Line 36,22 : The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
Line 37,22 : The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
Line 57,22 : The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
Line 38,22 : The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
Line 58,22 : The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
Line 59,22 : The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
Line 60,22 : The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
Line 81,24 : The type or namespace name 'DbSet<>' could not be found (are you missing a using directive or an assembly reference?)
Line 930,22 : The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
Line 824,22 : The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
Line 82,24 : The type or namespace name 'DbSet<>' could not be found (are you missing a using directive or an assembly reference?)
Line 838,22 : The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
Line 839,22 : The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
Line 841,22 : The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
Line 870,22 : The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
Line 83,24 : The type or namespace name 'DbSet<>' could not be found (are you missing a using directive or an assembly reference?)
Line 84,24 : The type or namespace name 'DbSet<>' could not be found (are you missing a using directive or an assembly reference?)
Line 85,24 : The type or namespace name 'DbSet<>' could not be found (are you missing a using directive or an assembly reference?)
Line 86,24 : The type or namespace name 'DbSet<>' could not be found (are you missing a using directive or an assembly reference?)
Line 87,24 : The type or namespace name 'DbSet<>' could not be found (are you missing a using directive or an assembly reference?)
Line 88,24 : The type or namespace name 'DbSet<>' could not be found (are you missing a using directive or an assembly reference?)
Line 953,16 : The type or namespace name 'DateOnly' could not be found (are you missing a using directive or an assembly reference?)
Line 89,24 : The type or namespace name 'DbSet<>' could not be found (are you missing a using directive or an assembly reference?)
Line 90,24 : The type or namespace name 'DbSet<>' could not be found (are you missing a using directive or an assembly reference?)
Line 954,16 : The type or namespace name 'DateOnly' could not be found (are you missing a using directive or an assembly reference?)
Line 959,22 : The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
Line 960,22 : The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
Line 961,22 : The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
Line 962,22 : The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
Line 91,24 : The type or namespace name 'DbSet<>' could not be found (are you missing a using directive or an assembly reference?)
Line 963,16 : The type or namespace name 'DateOnly' could not be found (are you missing a using directive or an assembly reference?)
Line 964,22 : The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
Line 971,33 : The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
Line 92,24 : The type or namespace name 'DbSet<>' could not be found (are you missing a using directive or an assembly reference?)
Line 805,22 : The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
Line 806,22 : The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
Line 93,24 : The type or namespace name 'DbSet<>' could not be found (are you missing a using directive or an assembly reference?)
Line 94,24 : The type or namespace name 'DbSet<>' could not be found (are you missing a using directive or an assembly reference?)
Line 95,24 : The type or namespace name 'DbSet<>' could not be found (are you missing a using directive or an assembly reference?)
Line 96,24 : The type or namespace name 'DbSet<>' could not be found (are you missing a using directive or an assembly reference?)
Line 97,24 : The type or namespace name 'DbSet<>' could not be found (are you missing a using directive or an assembly reference?)
Line 98,24 : The type or namespace name 'DbSet<>' could not be found (are you missing a using directive or an assembly reference?)
Line 99,24 : The type or namespace name 'DbSet<>' could not be found (are you missing a using directive or an assembly reference?)
Line 1009,22 : The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
Line 1010,22 : The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
Line 1011,22 : The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
Line 101,47 : The type or namespace name 'DbContextOptionsBuilder' could not be found (are you missing a using directive or an assembly reference?)
Line 110,49 : The type or namespace name 'ModelBuilder' could not be found (are you missing a using directive or an assembly reference?)
Line 780,45 : The type or namespace name 'ModelBuilder' could not be found (are you missing a using directive or an assembly reference?)
Line 75,27 : The type or namespace name 'DbContextOptions<>' could not be found (are you missing a using directive or an assembly reference?)
Line 1109,22 : The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
Line 1127,22 : The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
Line 1110,22 : The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
Line 1082,22 : The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
Line 1083,22 : The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
Line 1084,22 : The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
Line 1032,22 : The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
Line 1085,22 : The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
Line 1087,22 : The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
Line 1089,22 : The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
Line 1090,22 : The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
Line 1091,22 : The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
Line 1092,22 : The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
Line 1139,22 : The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
Line 1038,22 : The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
Line 1140,22 : The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
Line 1039,22 : The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
Line 1141,22 : The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
Line 1044,22 : The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
Line 1048,35 : The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
Line 1161,6 : The type or namespace name 'ResponseCacheAttribute' could not be found (are you missing a using directive or an assembly reference?)
Line 1161,6 : The type or namespace name 'ResponseCache' could not be found (are you missing a using directive or an assembly reference?)
Line 1162,6 : The type or namespace name 'IgnoreAntiforgeryTokenAttribute' could not be found (are you missing a using directive or an assembly reference?)
Line 1162,6 : The type or namespace name 'IgnoreAntiforgeryToken' could not be found (are you missing a using directive or an assembly reference?)
Line 1161,20 : The type or namespace name 'Duration' could not be found (are you missing a using directive or an assembly reference?)
Line 1161,34 : The type or namespace name 'Location' could not be found (are you missing a using directive or an assembly reference?)
Line 1161,45 : The name 'ResponseCacheLocation' does not exist in the current context
Line 1161,73 : The type or namespace name 'NoStore' could not be found (are you missing a using directive or an assembly reference?)
Line 1165,22 : The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
Line 1169,26 : The type or namespace name 'ILogger<>' could not be found (are you missing a using directive or an assembly reference?)
Line 1171,27 : The type or namespace name 'ILogger<>' could not be found (are you missing a using directive or an assembly reference?)
InnerException StackTrace at Dapper.Crud.VSExtension.Helpers.AssemblyHelper.BuildAssembly(String code) in C:\Projects\Dapper.Crud.Extension\Dapper.Crud.VSExtension\Helpers\AssemblyHelper.cs:line 49
at Dapper.Crud.VSExtension.Helpers.AssemblyHelper.ExecuteCode(String code, String namespacename, String classname, Boolean isstatic) in C:\Projects\Dapper.Crud.Extension\Dapper.Crud.VSExtension\Helpers\AssemblyHelper.cs:line 61
at Dapper.Crud.VSExtension.frmExtension.GetPropertyInfos(String model) in C:\Projects\Dapper.Crud.Extension\Dapper.Crud.VSExtension\frmExtension.cs:line 278
at Dapper.Crud.VSExtension.frmExtension.GenerateCrud() in C:\Projects\Dapper.Crud.Extension\Dapper.Crud.VSExtension\frmExtension.cs:line 73 Code using System;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions