Arthason Posted August 4, 2019 Posted August 4, 2019 (edited) System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.FileNotFoundException: Could not load file or assembly 'System.Diagnostics.DiagnosticSource, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. Das System kann die angegebene Datei nicht finden. at EntityFrameworkServicesBuilder Microsoft.EntityFrameworkCore.Infrastructure.EntityFrameworkServicesBuilder.TryAddCoreServices() at bool Microsoft.EntityFrameworkCore.Internal.ServiceProviderCache.ApplyServices(IDbContextOptions options, ServiceCollection services) at IServiceProvider Microsoft.EntityFrameworkCore.Internal.ServiceProviderCache.GetOrAdd(IDbContextOptions options, bool providerRequired)+(long k) => { } at TValue System.Collections.Concurrent.ConcurrentDictionary<TKey, TValue>.GetOrAdd(TKey key, Func<TKey, TValue> valueFactory) at IServiceProvider Microsoft.EntityFrameworkCore.Internal.ServiceProviderCache.GetOrAdd(IDbContextOptions options, bool providerRequired) at new Microsoft.EntityFrameworkCore.DbContext(DbContextOptions options) at new Test.DBCtx() at void Test.Main.OnResourceStart() --- End of inner exception stack trace --- at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) at GTANetworkInternals.ScriptingEngine.InvokeVoidMethod(String method, Object[] args) at System.Collections.Generic.List`1.ForEach(Action`1 action) at GTANetworkInternals.EventHandler.ParseEx(Event _event, ScriptingEngine engine, Object[] arguments) at System.Collections.Generic.List`1.ForEach(Action`1 action) at GTANetworkInternals.GameServer.StartResource(String resourceName, String parent) I got this error Edited August 4, 2019 by Arthason
xForcer Posted August 5, 2019 Author Posted August 5, 2019 58 minutes ago, Arthason said: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.FileNotFoundException: Could not load file or assembly 'System.Diagnostics.DiagnosticSource, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. Das System kann die angegebene Datei nicht finden. at EntityFrameworkServicesBuilder Microsoft.EntityFrameworkCore.Infrastructure.EntityFrameworkServicesBuilder.TryAddCoreServices() at bool Microsoft.EntityFrameworkCore.Internal.ServiceProviderCache.ApplyServices(IDbContextOptions options, ServiceCollection services) at IServiceProvider Microsoft.EntityFrameworkCore.Internal.ServiceProviderCache.GetOrAdd(IDbContextOptions options, bool providerRequired)+(long k) => { } at TValue System.Collections.Concurrent.ConcurrentDictionary<TKey, TValue>.GetOrAdd(TKey key, Func<TKey, TValue> valueFactory) at IServiceProvider Microsoft.EntityFrameworkCore.Internal.ServiceProviderCache.GetOrAdd(IDbContextOptions options, bool providerRequired) at new Microsoft.EntityFrameworkCore.DbContext(DbContextOptions options) at new Test.DBCtx() at void Test.Main.OnResourceStart() --- End of inner exception stack trace --- at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) at GTANetworkInternals.ScriptingEngine.InvokeVoidMethod(String method, Object[] args) at System.Collections.Generic.List`1.ForEach(Action`1 action) at GTANetworkInternals.EventHandler.ParseEx(Event _event, ScriptingEngine engine, Object[] arguments) at System.Collections.Generic.List`1.ForEach(Action`1 action) at GTANetworkInternals.GameServer.StartResource(String resourceName, String parent) I got this error Are you sure you followed every step carefully? Btw, I will update this tutorial this week per Adam's suggestion. Haven't had the time to do it recently
Arthason Posted August 5, 2019 Posted August 5, 2019 vor 6 Stunden schrieb xForcer: Are you sure you followed every step carefully? Btw, I will update this tutorial this week per Adam's suggestion. Haven't had the time to do it recently Yes. The NuGet packages where updated, it could be a new dependency
Astroo Posted August 11, 2019 Posted August 11, 2019 How get from database for example money? Is any special functions for get params from db? Or I must use GetEntitySharedData?
xForcer Posted August 11, 2019 Author Posted August 11, 2019 1 hour ago, Astroo said: How get from database for example money? Is any special functions for get params from db? Or I must use GetEntitySharedData? Use int to store and load money to/from database. You can store the money into C# properties per player or use SetEntityData. You can find better tutorials for that
yhyhydryx Posted September 9, 2019 Posted September 9, 2019 Hi. Is possibility to connect with microsoft sql database?
xForcer Posted September 22, 2019 Author Posted September 22, 2019 (edited) On 9/10/2019 at 12:30 AM, yhyhydryx said: Hi. Is possibility to connect with microsoft sql database? Yes, you just have to use a different provider Finally updated the code. If there is anything wrong, let me know so I can quickly fix it. I could eventually add repositories and other advanced stuff, but I would like to keep it simple and effective Edited September 22, 2019 by xForcer
bulllox Posted October 1, 2019 Posted October 1, 2019 (edited) One Question I was trying your Tutorial but if i want to start my Server it says "The type or namespace name 'Key' could not be found (are you missing a using directive or an assembly reference?" So i added "<assembly ref="../../runtime/System.ComponentModel.DataAnnotations.dll" />" in my meta.xml but still the same error what are im doing wrong? Edit: Here the file with the Error using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Text; namespace wsgRoleplay.Player { public class PlayerInfo { [Key] public int UID { get; set; } public string _uName { get; set; } public string _uPassword { get; set; } public int _uMoney { get; set; } public int _uJob { get; set; } public int _uNJob { get; set; } public int _uGang { get; set; } public int _uSFrak { get; set; } } } Edited October 1, 2019 by bulllox forgot something
xForcer Posted October 2, 2019 Author Posted October 2, 2019 3 hours ago, bulllox said: One Question I was trying your Tutorial but if i want to start my Server it says "The type or namespace name 'Key' could not be found (are you missing a using directive or an assembly reference?" So i added "<assembly ref="../../runtime/System.ComponentModel.DataAnnotations.dll" />" in my meta.xml but still the same error what are im doing wrong? Edit: Here the file with the Error using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Text; namespace wsgRoleplay.Player { public class PlayerInfo { [Key] public int UID { get; set; } public string _uName { get; set; } public string _uPassword { get; set; } public int _uMoney { get; set; } public int _uJob { get; set; } public int _uNJob { get; set; } public int _uGang { get; set; } public int _uSFrak { get; set; } } } Did you build the solution and copied every dll needed to the runtime folder as the tutorial says?
bulllox Posted October 2, 2019 Posted October 2, 2019 Yeah i build everything but thats the output i get
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now