swisslife-oss / thor-generator Goto Github PK
View Code? Open in Web Editor NEWAn Event Tracing for Windows (ETW) EventSource generator built on .Net Core 2.0
License: MIT License
An Event Tracing for Windows (ETW) EventSource generator built on .Net Core 2.0
License: MIT License
For enum parameter will be an attachment created which is not expected
We need a new template that does not rely on any other packages. The current c# default template relies on the ChilliCream.Tracing.Abstractions package.
The chocolatey package is not really a good way to consume and use the generator. It would be much more useful to use the generator as dotnet cli integration.
Hi,
We have an interface that contains a method which has a parameter that is a collection.
[EventSourceDefinition(Name = "xxx")]
public interface IXXXEventSource
{
[Event(1, Level = EventLevel.Warning,
Message = "XXX", Version = 4)]
void SomeXXXs(List<string> xxxs);
}
The Thor Generator v1.3.3 currently fails to generate the class for this interface. We get the following error in the console output:
Processing \src\EventSources\EventSources.csproj -> \src\EventSources\EventSources.csproj ...
1>
1>Unhandled Exception: System.ArgumentNullException: Value cannot be null.
1>Parameter name: type
1> at Thor.Generator.Templates.ModelExtensions.AddParameter(EventModel eventModel, String name, String type) in C:\thor\generator\src\Generator\Templates\ModelExtensions.cs:line 65
1> at Thor.Generator.Templates.EventSourceDefinitionVisitor.VisitMethodDeclaration(MethodDeclarationSyntax node) in C:\thor\generator\src\Generator\Templates\EventSourceDefinitionVisitor.cs:line 85
1> at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxWalker.Visit(SyntaxNode node)
1> at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxWalker.DefaultVisit(SyntaxNode node)
1> at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxWalker.Visit(SyntaxNode node)
1> at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxWalker.DefaultVisit(SyntaxNode node)
1> at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxWalker.Visit(SyntaxNode node)
1> at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxWalker.DefaultVisit(SyntaxNode node)
1> at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxWalker.Visit(SyntaxNode node)
1> at Thor.Generator.EventSourceResolver.d__3.MoveNext() in C:\thor\generator\src\Generator\EventSourceResolver.cs:line 33
1> at Thor.Generator.EventSourceGenerator.Generate() in C:\thor\generator\src\Generator\EventSourceGenerator.cs:line 39
1> at Thor.Generator.Tasks.EventSourceGeneratorTaskBase.GenerateEventSources(Project source, Project target) in C:\thor\generator\src\Generator\Tasks\EventSourceGeneratorTaskBase.cs:line 123
1> at Thor.Generator.Tasks.ProjectEventSourceGeneratorTask.Execute() in C:\thor\generator\src\Generator\Tasks\ProjectEventSourceGeneratorTask.cs:line 77
1> at Thor.Generator.CLI.Program.Main(String[] args) in C:\thor\generator\src\Generator.CLI\Program.cs:line 20
1> .nuget\packages\thor.generator\1.3.3\build\Thor.Generator.targets(16,5): error MSB3073: The command "".nuget\packages\thor.generator\1.3.3\build..\tools\win10-x64\thorgen.exe" project -s "\src\EventSources\EventSources.csproj" -t "\src\EventSources\EventSources.csproj"" exited with code -532462766.
1>Done building project "EventSources.csproj" -- FAILED.
There is an easy workaround for this issue: use a wrapper class around the collection and have the parameter be of that type.
We should introduce a new package dependency property to the template settings file. All packages that are defined there will then be automatically added to the generator target project it it is missing those packages.
The generator should enable unsafe code for the project it is adding the event sources to if the setting was not already set.
The current generator will only accept value types and string as payloads to be compliant with etw. There are cases were customers still want to generate an event source with custom objects for which they handle the payload serialisation in an nonevent method.
The template info file should define which types are accepted by a template. Moreover, a template should explicitly in- or exclude types or work with wildcards.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.