YAFLogo

ora
  • ora
  • 78.8% (Friendly)
  • YAF Forumling Topic Starter YAF Version: v4 beta
6 months ago
Hi, I've tried building and publishing on my CentOS 8 machine and while it compiles and runs, anytime I try to navigate to root or /install I'm getting the following error:

NoValidDbAccessProviderFoundException: Unable to Locate Provider Named "Microsoft.Data.SqlClient" in Data Access Providers (DLL Not Located in Bin Directory?).

I've tried changing permissions and starting directory. Neither works.


Sponsor
tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.0 rc 2
6 months ago
Looks like the provider dll was not copied to the bin folder. Issue has been fixed in the source repository.
ora
  • ora
  • 78.8% (Friendly)
  • YAF Forumling Topic Starter YAF Version: v4 beta
6 months ago
Is there a similar issue with Postgres? I couldn't even get that one to build. (Sorry if this deserves its own thread)
tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.0 rc 2
6 months ago
Yes it's the same issue, and also already fixed. What build issues are you having?
ora
  • ora
  • 78.8% (Friendly)
  • YAF Forumling Topic Starter YAF Version: v4 beta
6 months ago
I apologize, I misremembered. The issue is at first run not during build:

Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'Npgsql, Version=8.0.1.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7'. The system cannot find the file specified.

EDIT: Full build process if it helps: https://paste.orawalters.com/121223-yaf.net-postgresql.sln-build 


tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.0 rc 2
6 months ago

I apologize, I misremembered. The issue is at first run not during build:

Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'Npgsql, Version=8.0.1.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7'. The system cannot find the file specified.

EDIT: Full build process if it helps: https://paste.orawalters.com/121223-yaf.net-postgresql.sln-build 

Originally Posted by: ora 

No problem, the issue on first run is already resolved in the source repository.

ora
  • ora
  • 78.8% (Friendly)
  • YAF Forumling Topic Starter YAF Version: v4 beta
6 months ago
I can confirm having pulled from master and rebuilt the issue is still there:

[ora@s1 clubmoneyyaf]$ ls
appsettings.json                            Microsoft.AspNetCore.Authentication.Facebook.dll       Newtonsoft.Json.Bson.dll                       System.Runtime.Caching.dll
Autofac.dll                                 Microsoft.AspNetCore.Authentication.Google.dll         Newtonsoft.Json.dll                            System.Security.Cryptography.ProtectedData.dll
Autofac.Extensions.DependencyInjection.dll  Microsoft.AspNetCore.Identity.UI.dll                   OEmbed.Core.dll                                System.ServiceModel.Syndication.dll
Azure.Core.dll                              Microsoft.AspNetCore.JsonPatch.dll                     package.json                                   tr
Azure.Identity.dll                          Microsoft.AspNetCore.Mvc.NewtonsoftJson.dll            pl                                             UAParser.Core.dll
BouncyCastle.Cryptography.dll               Microsoft.AspNetCore.Mvc.Razor.Extensions.dll          pt-BR                                          UAParser.dll
cs                                          Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.dll  publish                                        web.config
de                                          Microsoft.AspNetCore.Razor.Language.dll                QRCoder.dll                                    wwwroot
es                                          Microsoft.Bcl.AsyncInterfaces.dll                      ru                                             YAF
FarsiLibrary.Core.dll                       Microsoft.CodeAnalysis.CSharp.dll                      runtimes                                       YAF.Configuration.dll
fr                                          Microsoft.CodeAnalysis.dll                             ServiceStack.dll                               YAF.Configuration.pdb
Google.Authenticator.dll                    Microsoft.CodeAnalysis.Razor.dll                       ServiceStack.OrmLite.dll                       YAF.Core.dll
helpmenu.json                               Microsoft.Data.SqlClient.dll                           ServiceStack.OrmLite.PostgreSQL.dll            YAF.Core.pdb
it                                          Microsoft.Extensions.DependencyModel.dll               ServiceStack.OrmLite.PostgreSQL.xml            YAF.Data.PostgreSQL.dll
J2N.dll                                     Microsoft.Identity.Client.dll                          ServiceStack.OrmLite.SqlServer.dll             YAF.Data.PostgreSQL.pdb
ja                                          Microsoft.Identity.Client.Extensions.Msal.dll          ServiceStack.OrmLite.SqlServer.xml             YAF.deps.json
ko                                          Microsoft.IdentityModel.Abstractions.dll               ServiceStack.OrmLite.xml                       YAF.dll
Lucene.Net.Analysis.Common.dll              Microsoft.IdentityModel.JsonWebTokens.dll              ServiceStack.xml                               YAF.pdb
Lucene.Net.dll                              Microsoft.IdentityModel.Logging.dll                    SixLabors.ImageSharp.dll                       YAF.runtimeconfig.json
Lucene.Net.Highlighter.dll                  Microsoft.IdentityModel.Protocols.dll                  System.ComponentModel.Composition.dll          YAF.Types.dll
Lucene.Net.Memory.dll                       Microsoft.IdentityModel.Protocols.OpenIdConnect.dll    System.Configuration.ConfigurationManager.dll  YAF.Types.pdb
Lucene.Net.Queries.dll                      Microsoft.IdentityModel.Tokens.dll                     System.IdentityModel.Tokens.Jwt.dll            YAF.Web.dll
Lucene.Net.QueryParser.dll                  Microsoft.SqlServer.Server.dll                         System.Linq.Async.dll                          YAF.Web.pdb
Lucene.Net.Sandbox.dll                      MimeKit.dll                                            System.Memory.Data.dll                         zh-Hans
MailKit.dll                                 mimeTypes.json                                         System.Net.Http.Formatting.dll                 zh-Hant
[ora@s1 clubmoneyyaf]$ ./YAF
Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'Npgsql, Version=8.0.1.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7'. The system cannot find the file specified.

File name: 'Npgsql, Version=8.0.1.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7'
   at YAF.Data.PostgreSQL.PostgreSQLModule.Load(ContainerBuilder builder)
   at Autofac.Module.Configure(IComponentRegistryBuilder componentRegistry)
   at Autofac.Core.Registration.ModuleRegistrar.<.ctor>b__1_0(IComponentRegistryBuilder reg)
   at Autofac.ContainerBuilder.Build(IComponentRegistryBuilder componentRegistry, Boolean excludeDefaultModules)
   at Autofac.ContainerBuilder.UpdateRegistry(IComponentRegistryBuilder componentRegistry)
   at Autofac.Module.Configure(IComponentRegistryBuilder componentRegistry)
   at Autofac.Core.Registration.ModuleRegistrar.<.ctor>b__1_0(IComponentRegistryBuilder reg)
   at Autofac.ContainerBuilder.Build(IComponentRegistryBuilder componentRegistry, Boolean excludeDefaultModules)
   at Autofac.ContainerBuilder.Build(ContainerBuildOptions options)
   at Autofac.Extensions.DependencyInjection.AutofacServiceProviderFactory.CreateServiceProvider(ContainerBuilder containerBuilder)
   at Microsoft.Extensions.Hosting.HostBuilder.InitializeServiceProvider()
   at Microsoft.Extensions.Hosting.HostBuilder.Build()
   at YAF.Program.Main(String args) in /home/ora/YAFNET/yafsrc/YetAnotherForum.NET/Program.cs:line 53
   at YAF.Program.<Main>String args)
Aborted (core dumped)

tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.0 rc 2
6 months ago
i checked your build log. I didnt notice you use dotnet publish in that case the reference assemblies where missing. It its fixed now.
ora
  • ora
  • 78.8% (Friendly)
  • YAF Forumling Topic Starter YAF Version: v4 beta
6 months ago
Weirdly I'm having the exact same issue with PostgreSQL. I haven't tried SQLite again.
tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.0 rc 2
6 months ago
I tested it on multiple computer

clone the repository

run clean first dotnet clean /p:Configuration=Release YAF.NET-PostgreSQL.sln

then publish dotnet publish /p:Configuration=Release YAF.NET-PostgreSQL.sln

and the Npgsql.dll exists in the publish folder

ora
  • ora
  • 78.8% (Friendly)
  • YAF Forumling Topic Starter YAF Version: v4 beta
6 months ago
Am I perhaps checking the wrong publish folder?

yafsrc/YetAnotherForum.NET/bin/Release/net8.0/publish/


tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.0 rc 2
6 months ago

Am I perhaps checking the wrong publish folder?

yafsrc/YetAnotherForum.NET/bin/Release/net8.0/publish/

Originally Posted by: ora 

That is the correct folder

ora
  • ora
  • 78.8% (Friendly)
  • YAF Forumling Topic Starter YAF Version: v4 beta
6 months ago
I have no idea why I don't have it then. I've even tried deleting the folder and recloning the repo (instead of pulling)
tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.0 rc 2
6 months ago
Did you try the dotnet clean command? or manually delete the folder yafsrc/YetAnotherForum.NET/obj/ and yafsrc/YetAnotherForum.NET/bin/ before compiling?
ora
  • ora
  • 78.8% (Friendly)
  • YAF Forumling Topic Starter YAF Version: v4 beta
6 months ago
I deleted everything and cloned it exactly from GitHub. Then renamed the test folder, then copied the clean and publish commands directly from your post. I have no idea what's going on! 😓