You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since there aren't default templates for creating runtime components, one has to start with a regular class library and start modifying the .csproj from there. if you don't set the TargetFramework correctly to something like net8.0-windows10.0.19041.0 you'll get random errors. instead, the error isn't helpful and if you enable logging, the log file just shows this:
Generating assembly AppService version 1.0.0.0
Found 1 types
defining type: Class AppService.Class1
writing custom mapped interfaces for AppService.Class1
add method from symbol: .ctor
custom mapping System.Object to System.Object from mscorlib
attribute type found
adding attribute type
System.NullReferenceException: Object reference not set to an instance of an object.
at Generator.WinRTTypeWriter.AddType(INamedTypeSymbol type, Boolean treatAsProjectedType)
at Generator.WinRTTypeWriter.AddCustomAttributes(String attributeTypeName, IList`1 primitiveTypes, IList`1 primitiveValues, EntityHandle parentHandle)
at Generator.WinRTTypeWriter.AddActivatableAttribute(EntityHandle parentHandle, UInt32 version, String factoryInterface)
at Generator.WinRTTypeWriter.AddComponentType(INamedTypeSymbol type, Action visitTypeDeclaration)
at Generator.WinRTTypeWriter.VisitClassDeclaration(ClassDeclarationSyntax node)
at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxWalker.Visit(SyntaxNode node)
at Generator.ComponentGenerator.Generate()
To Reproduce
create .NET8 class library
add package reference to cswinrt
set <CSWinRTComponent>true</CSWinRTComponent> in the csproj
change TargetFramework to net8.0-windows
build
Expected behavior
this would provide an error that the project isn't configured correctly
Version Info
2.0.7
The text was updated successfully, but these errors were encountered:
Since there aren't default templates for creating runtime components, one has to start with a regular class library and start modifying the .csproj from there. if you don't set the
TargetFramework
correctly to something likenet8.0-windows10.0.19041.0
you'll get random errors. instead, the error isn't helpful and if you enable logging, the log file just shows this:To Reproduce
<CSWinRTComponent>true</CSWinRTComponent>
in the csprojTargetFramework
tonet8.0-windows
Expected behavior
this would provide an error that the project isn't configured correctly
Version Info
2.0.7
The text was updated successfully, but these errors were encountered: