gumbarros
gumbarros
CC#
Created by gumbarros on 4/5/2023 in #help
❔ What is the difference between public static and public static virtual in a interface?
This is a interface for dynamic plugins loaded from a AssemblyLoadContext.
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;

namespace JJIntegration.PluginContracts;

public interface IScheduleTask
{
/// more code above...

/// <summary>
/// Name of the task that will appear to the user
/// </summary>
string TaskName { get; }



/// <summary>
/// Add the dependencies from this ScheduleTask to the IServiceCollection of the application
/// </summary>


// My friends, what is the difference here if I add a virtual keyword? This method is meant to be optionally overriden.
public static IServiceCollection AddServices(IServiceCollection services, IConfiguration configuration)
{
return services;
}

/// more code below...
}
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;

namespace JJIntegration.PluginContracts;

public interface IScheduleTask
{
/// more code above...

/// <summary>
/// Name of the task that will appear to the user
/// </summary>
string TaskName { get; }



/// <summary>
/// Add the dependencies from this ScheduleTask to the IServiceCollection of the application
/// </summary>


// My friends, what is the difference here if I add a virtual keyword? This method is meant to be optionally overriden.
public static IServiceCollection AddServices(IServiceCollection services, IConfiguration configuration)
{
return services;
}

/// more code below...
}
What is the difference between public static virtual and public static in a interface? When I use public static virtual, the method cannot be loaded by reflection.
4 replies
CC#
Created by gumbarros on 11/3/2022 in #help
Why my MD5 hash is weak?
7 replies
CC#
Created by gumbarros on 11/3/2022 in #help
Path.Combine to folder behind
Why this is not working?
var root = Path.Combine("/../","/../", builder.Environment.ContentRootPath);
var sharedSettings = Path.Combine(root, "appsettings.json");
var root = Path.Combine("/../","/../", builder.Environment.ContentRootPath);
var sharedSettings = Path.Combine(root, "appsettings.json");
10 replies
CC#
Created by gumbarros on 10/16/2022 in #help
Help with WPF app
It's this microsoft store app https://apps.microsoft.com/store/detail/c-to-dart-transpiler/9P5BNFRSMQ00?hl=pt-br&gl=br, it's not mine but I really need to use it. I found the error on the event viewer. How can I solve this without the source code?
4 replies