Xan.Nava
❔ Which C# nethost file to include in c++ host application
I am fallowing this tutorial on how to create a nethost application(c++) for .net applications. I am targeting .net 8.0, and have downloaded the sdk but am a bit confused on where to find the nethost file and what to actually include(.dll/.lib/.h)?
For example I have found
though not sure if the pack is correct. I saw there were some for Maui, and some just .Net.Runtime for Mono and WebAssembly. and some with a Emscripten.
I want to for now just use a console application for both c++ and C# sides. I see the .NETCore packs have my .net 8.0 as an option. Is them being called .NETCore just a wierd naming thing on microsofts side(from the .net Core vs .net Framework times)?
8 replies
❔ Who to unify data access within a program.
For a quick bacground. I like being able to see where things are happening. If something is "hiding(AKA I can't inspect the code and see what it is calling)" connections through fancy practices I consider a code smell. Likewise How data is accessed should be clear in my opinion. Receiving data shouldn't change the data's state. There are more protocols for external data, like accessing data bases, or APIs, but I haven't seen a good protocol/framework for within a program.
There are some guidelines programmers fallow that help, like naming conventions. Some have performance hits, just as I imagine other protocols do. Have any of you made/used protocols for within a program?
15 replies
❔ Target runtime doesn't support default interface implementation.
As the title says.
My csproj file
https://pastebin.com/wFbwGJDn
I am trying to use this in unity which supports this feature on 2022.2b. The documentation for unity says it is using the fallowing.
https://docs.unity3d.com/2022.2/Documentation/Manual/dotnetProfileSupport.html
.NET Framework (any version) Supported
29 replies
How to override virtual interface in an interface
So I know a virtual method has a base implementation for interfaces, but I want to override that in a second interface that implements that interface, as fallows.
The above gives me an error, and if I get rid of override it requires a new keyword. I could just leave it to what ever inherits it, but the functionality is very straight forward, and just need it sepperated from the generic class so I can use it in a more generic way.
23 replies
How to call a static method form interface in a generic class.
So I have a class as bellow.
and then a second generic class.
but I am getting the error.
https://learn.microsoft.com/en-us/dotnet/csharp/misc/cs0704?f1url=%3FappId%3Droslyn%26k%3Dk(CS0704)
The problem is I can't directly call the type from a generic. Is there anyway to do this, or am I trying to do something C# just can't do?
13 replies
How to use Tuple in generic class?
So I know you can use Tuple<Type, Func<object>> for example, but is there any way to just use (Type type, Func<Object> obj)? Or even give Tuple<> names so it isn't Item1, Item2?
I imagine if this isn't implemented it has to do with how the () tuple works at compile, but I would think it is easy enough on compile time to just do .ToTuple() wherever it would be needed.
33 replies