xForcer Posted October 9, 2019 Author Posted October 9, 2019 On 10/2/2019 at 1:28 PM, bulllox said: Yeah i build everything but thats the output i get You are missing something else or did something wrong in the process. Try doing everything from the scratch if you still have this problem
SotaRex Posted March 22, 2020 Posted March 22, 2020 He's saying that he needs "netstandard" but im using Net core ? Whats now ?
indrikh Posted June 23, 2020 Posted June 23, 2020 В 30.12.2018 в 04:20, xForcer сказал: Hi, can you tell me what I was wrong 1
Nerdzik Posted February 10, 2021 Posted February 10, 2021 How make on a Version 1.1 DP1-2, i have a problem. And I have before to compilation log in console Debug shows this Line using (DefaultDbContext dbContext = new DefaultDbContext()) { var playerCount = dbContext.Accounts.Count(); NAPI.Util.ConsoleOutput("Postaci w bazie danych: " + playerCount); } In main.cs File using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Text; using GTANetworkAPI; namespace GM { class main : Script { [ServerEvent(Event.ResourceStart)] public void OnResourceStart() { using (DefaultDbContext dbContext = new DefaultDbContext()) { var playerCount = dbContext.Accounts.Count(); NAPI.Util.ConsoleOutput("Postaci w bazie danych: " + playerCount); } } } } How repair this problem?
TechNo. Posted February 12, 2022 Posted February 12, 2022 On 2/10/2021 at 1:06 PM, Nerdzik said: How make on a Version 1.1 DP1-2, i have a problem. And I have before to compilation log in console Debug shows this Line using (DefaultDbContext dbContext = new DefaultDbContext()) { var playerCount = dbContext.Accounts.Count(); NAPI.Util.ConsoleOutput("Postaci w bazie danych: " + playerCount); } In main.cs File using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Text; using GTANetworkAPI; namespace GM { class main : Script { [ServerEvent(Event.ResourceStart)] public void OnResourceStart() { using (DefaultDbContext dbContext = new DefaultDbContext()) { var playerCount = dbContext.Accounts.Count(); NAPI.Util.ConsoleOutput("Postaci w bazie danych: " + playerCount); } } } } How repair this problem? I have this same issue. Has anyone been able to fix this?
TechNo. Posted February 12, 2022 Posted February 12, 2022 (edited) On 2/10/2021 at 1:06 PM, Nerdzik said: How make on a Version 1.1 DP1-2, i have a problem. And I have before to compilation log in console Debug shows this Line using (DefaultDbContext dbContext = new DefaultDbContext()) { var playerCount = dbContext.Accounts.Count(); NAPI.Util.ConsoleOutput("Postaci w bazie danych: " + playerCount); } In main.cs File using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Text; using GTANetworkAPI; namespace GM { class main : Script { [ServerEvent(Event.ResourceStart)] public void OnResourceStart() { using (DefaultDbContext dbContext = new DefaultDbContext()) { var playerCount = dbContext.Accounts.Count(); NAPI.Util.ConsoleOutput("Postaci w bazie danych: " + playerCount); } } } } How repair this problem? -----Don't mind my previous post I just figured out how to fix this error----- What you want to do is change your CSProj file to include these lines: Under <PropertyGroup> put this line: <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies> Then in your <ItemGroup> include this line below: <PackageReference Include="System.Diagnostics.DiagnosticSource" Version="5.0.1" /> From here save the csproj file, right click on your solution, and rebuild. Before doing the next step, backup the System.Diagnostics.DiagnosticSource.dll that is in server-files/dotnet/runtime just in case this fix does not work for you. Otherwise you will have no way of knowing what version it was. Next, navigate to server-files/dotnet/resources/yourProject/bin/Debug/netcoreapp3.1. In this folder you will find "System.Diagnostics.DiagnosticSource.dll" and you'll want to copy this file and paste it into server-files/dotnet/runtime. It will overwrite the current version of System.Diagnostics.DiagnosticSource.dll that is in server-files/dotnet/runtime and you want to do this. I believe the issue is occurring because the dependency in that runtime folder by default is older than the one we want to use for MySqlConnector. The author of MySqlConnector lists System.Diagnostics.DiagnosticSource.dll as the only dependency for netcoreapp3.1 so I'm guessing version was off. UPDATE: change version="5.0.1" to version="6.0.0". I tested and version 6.0.0 works too. Due to this, I don't think it's a versioning issue, just a matter of the incorrect Diagnostics.DiagnosticSource being in the runtime folder. Edited February 12, 2022 by TechNo.
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