User-413595476 posted
How can I transfer a connection string from a web,config file taken from a project produced in virtual studio 13 (highlighted in yellow below) to a AppSetting.json file in a project produced in virtual studio 19?
Errors:
Web
HTTP Error 500.30 - ANCM In-Process Start Failure
output
Exception thrown: 'System.FormatException' in Microsoft.Extensions.Configuration.FileExtensions.dll
Included Below;
-AppSettings.json
-DAL.OutlineContext
-Models.Level1
_Models.Level2
-Models.levelJoin1
Programming Environment
___________________________________________________________________________________________________________________________
{
"Logging": {
"LogLevel": {
"Default": "Warning"
}
},
"AllowedHosts": "*",
"ConnectionStrings": {
"<add" "name=\"OutlineContext\"",
"connectionString=\"Data Source=(LocalDb)\\v11.0;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\\Outline.mdf\"" "providerName=\"System.Data.SqlClient\"",
"/>"
// "cs": "Server=(localdb)\\mssqllocaldb;Database=cs-3e24dc9b-e3b5-4a06-b629-edeeed78359d;Trusted_Connection=True;MultipleActiveResultSets=true"
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
//
using Outline.Models;
using System.Data.Entity;
using System.Data.Entity.ModelConfiguration.Conventions;
namespace Outline.DAL
{
public class OutlineContext : DbContext
{
public OutlineContext() : base("OutlineContext") // The name of the connection string is passed in to the constructor.
{
}
public DbSet<Level1> Level1s { get; set; }
public DbSet<Level2> Level2s { get; set; }
public DbSet<Join1> Join1s { get; set; }
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Outline.Models
{
public class Level1
{
int Level1ID { get; set; }
string LevelString1 { get; set; }
public virtual ICollection<Join1> Join1s { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Outline.Models
{
public class Level2
{
int Leve21ID { get; set; }
string Level2String1 { get; set; }
public virtual ICollection<Join1> Join1s { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Outline.Models
{
public class Join1
{
public int JoinID { get; set; }
public int Level1ID { get; set; }
public int Leve21ID { get; set; }
public virtual Level1 Level1 { get; set; }
public virtual Level2 Level2 { get; set; }
}
}