Closed darkguy2008 closed 3 years ago
Nevermind, fixed it by adding the full code of the Dnne.Attributes.cs
file:
namespace DNNE
{
internal class ExportAttribute : System.Attribute
{
public ExportAttribute() { }
public string EntryPoint { get; set; }
}
internal class C99TypeAttribute : System.Attribute
{
public C99TypeAttribute(string code) { }
}
internal class C99DeclCodeAttribute : System.Attribute
{
public C99DeclCodeAttribute(string code) { }
}
}
I find it weird that it works, considering the type should come from your namespace (to avoid different types of the same name...?) but hey, it's a solution.
Thanks and sorry for opening the bug :)
@darkguy2008 It is expected for you to define the DNNE
attributes if you need them. A design principle of the DNNE
project was to avoid adding arbitrary assembly references that increase deployment sizes. The attributes in questions are needed only at code gen time and not used at all at run time. Since attribute look up is typically just string compare they can be defined anywhere - yay. This means as a consumer there is no need to define them unless desired and if used don't need to be deployed since they are a code gen concept and serve no purpose at run time. If`DNNE
did provide them then you would need to also deploy another assembly to handle resolution at run time.
Note that the type name look up requires namespace + type name to match what the tooling is looking for.
Hello!
First of all thanks a lot for this awesome project, it's opening a lot of doors in regards of native/managed library development, thanks!
I'm facing a small issue here which I'd love to get some help from you: See, when creating a class like this:
I get an error in
[DNNE.C99Type("struct T*")]
where it saysThe type or namespace name 'DNNE' could not be found (are you missing a using directive or an assembly reference?)
. I say, alright, let's implement it like so:But when I compile, I get a lot of compile errors:
Mainly because in Native.g.c, I see this:
Notice it says
/* SUPPLY TYPE */
instead ofstruct T*
.This is my .csproj:
Any ideas? :)