【发布时间】:2018-11-22 14:09:35
【问题描述】:
我正在一家新公司开始工作,我应该开始使用其他人在 .net core MVC 中开发的系统。
我有数据库的本地副本和代码的本地副本。 我可以访问 SQL 服务器数据库并在 SQL Server 2014 中发出我自己的 SQL 请求,不幸的是我无法将我的 Visual Studio 代码连接到我的数据库并使一切都在本地工作。
我尝试加载“Views\Home\Index.cshtml”,页面开始在“localhost:45896”加载,几秒钟后我收到以下错误:
json 文件中的路径似乎没有正确写入,但我不知道如何以其他方式编写它。
或者其他的。
连接字符串:
“连接字符串”:{ "DefaultConnection": "Server=/SQLExpress;Database=something_article;User ID=管理员;密码=管理员;", "EntityFrameworkConnection": "数据源=172.16.10.5;初始目录=companyname_common;持久安全信息=True;用户 id=admin;password=azerty;MultipleActiveResultSets=True;App=EntityFramework"" },
谢谢
最好的问候 瑞
启动应用程序时出错。 Win32Exception: 乐 chemin d'accès spécifié n'est pas valide
未知位置 SqlException: Une erreur Liée au réseau ou spécifique à l'instance s'est produite lors de l'établissement d'une connexion à SQL 服务器。 Le serveur est introuvable ou n'est pas 可访问。 Vérifiez que le nom de l'instance est correct et que SQL Server est configuré pour autoriser les connexions distancees。 (提供者:命名 Pipes Provider,错误:40 - Impossible d'ouvrir une connexion à SQL 服务器)
System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity 身份、SqlConnectionString 连接选项、SqlCredential 凭证、对象 providerInfo、字符串 newPassword、SecureString newSecurePassword, bool redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, DbConnectionPool 池,字符串 accessToken,bool applyTransientFaultHandling)
Win32Exception: Le chemin d’accès spécifié n’est pas valideSystem.ComponentModel.Win32Exception (0x80004005): Le chemin d'accès spécifié n'est pas valide
SqlException: Une erreur Liée au réseau ou spécifique à l'instance s'est produite lors de l'établissement d'une connexion à SQL Server。 Le serveur est introuvable ou n'est pas 可访问。已验证 nom de l'instance est correct et que SQL Server est configuré pour autoriser les connexions distancees。 (提供者:命名管道提供者, 错误:40 - Impossible d'ouvrir une connexion à SQL Server)
System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity身份、SqlConnectionString 连接选项、SqlCredential 凭证、对象 providerInfo、字符串 newPassword、SecureString newSecurePassword, bool redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, DbConnectionPool 池,字符串 accessToken,bool applyTransientFaultHandling) System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions 选项,DbConnectionPoolKey poolKey,对象 poolGroupProviderInfo, DbConnectionPool 池,DbConnection owningConnection, DbConnectionOptions 用户选项) System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool 池,DbConnection owningObject,DbConnectionOptions 选项, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions) System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal 旧连接) System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal 旧连接) System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, uint waitForMultipleObjectsTimeout, bool allowCreate, bool onlyOneCheckConnection, DbConnectionOptions userOptions, out DbConnection内部连接) System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject,TaskCompletionSource 重试, DbConnectionOptions userOptions, out DbConnectionInternal connection) System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection,TaskCompletionSource 重试, DbConnectionOptions userOptions,DbConnectionInternal oldConnection, 出 DbConnection 内部连接) System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection 外部连接,DbConnectionFactory 连接工厂, TaskCompletionSource 重试,DbConnectionOptions 用户选项) System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource 重试) System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource 重试) System.Data.SqlClient.SqlConnection.Open() Hangfire.SqlServer.SqlServerStorage.CreateAndOpenConnection() Hangfire.SqlServer.SqlServerStorage.UseConnection(DbConnection dedicatedConnection, Func func) Hangfire.SqlServer.SqlServerStorage.UseConnection(DbConnection dedicatedConnection, Action action) Hangfire.SqlServer.SqlServerStorage.Initialize() Hangfire.SqlServer.SqlServerStorage..ctor(字符串名称或连接字符串,SqlServerStorageOptions 选项) Hangfire.SqlServerStorageExtensions.UseSqlServerStorage(IGlobalConfiguration 配置,字符串名称或连接字符串,SqlServerStorageOptions 选项) SofedisWebsite.Startup.b__4_6(IGlobalConfiguration m) 在 Startup.cs 中
m.UseSqlServerStorage(Configuration.GetConnectionString("DefaultConnection"),新的 SqlServerStorageOptions()
Hangfire.HangfireServiceCollectionExtensions+c__DisplayClass1_0.b__10(IGlobalConfiguration 配置) Hangfire.HangfireServiceCollectionExtensions.GetInitializedJobStorage(IServiceProvider 服务提供者) Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitFactoryService(FactoryService factoryService,ServiceProvider 提供者) Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor.VisitCallSite(IServiceCallSite callSite, TArgument 参数) Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite,ServiceProvider 提供者) Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitSingleton(SingletonCallSite singletonCallSite,ServiceProvider 提供者) Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor.VisitCallSite(IServiceCallSite callSite, TArgument 参数) Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(IServiceCallSite callSite,ServiceProvider 提供者) Microsoft.Extensions.DependencyInjection.ServiceProvider+c__DisplayClass16_0.b__0(ServiceProvider 提供者) Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(类型 服务类型) Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider 提供者,类型 serviceType) Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider 提供者) Hangfire.HangfireApplicationBuilderExtensions.UseHangfireServer(IApplicationBuilder 应用程序,BackgroundJobServerOptions 选项, IEnumerable additionalProcesses, JobStorage 存储) SofedisWebsite.Startup.Configure(IApplicationBuilder app, IHostingEnvironment 环境,ILoggerFactory loggerFactory, IApplicationLifetime appLifetime, FileServerProvider FileServerprovider) 在 Startup.cs 中
app.UseHangfireServer(new BackgroundJobServerOptions() System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() Microsoft.AspNetCore.Hosting.ConventionBasedStartup.Configure(IApplicationBuilder应用程序) Microsoft.AspNetCore.Server.IISIntegration.IISSetupFilter+c__DisplayClass3_0.b__0(IApplicationBuilder 应用程序) Microsoft.AspNetCore.Hosting.Internal.AutoRequestServicesStartupFilter+c__DisplayClass0_0.b__0(IApplicationBuilder 建设者) Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
.NET Framework X64 v4.0.30319.42000 |
Microsoft.AspNetCore.Hosting 版本 1.1.1 |微软Windows 10.0.10586 |需要帮助吗?
【问题讨论】:
-
也许您可以在名为 Web.config 的文件中查看您的 MVC 应用程序并找到
并确保它指向您的 localdb? -
我的 web.config 文件中没有“ConnectionString”。 :(
-
已解决,如何关闭?
-
发表您对这个问题的答案并接受它
标签: c# asp.net json model-view-controller aspnetcoretemplatepack