[SOLVED] Schema generation in RCL
# package-development
r
Has anyone done anything with schema generation within an RCL? I've looked at examples like uSync but there's multiple projects all being built separately, ideally I'd want to to keep it all in the one project as I have now if possible
I saw @User's blog post (https://cornehoskam.com/posts/how-to-include-appsettings-schema-json-files-in-umbraco-packages) which was helpful getting me to a point, but it doesn't appear as those the
.targets
file is actually being run when I've created the NuGet package and then installed it into another project
w
I ran into something similar Rick recently
I think an RCL targets file was overriding my targets file or something similar
r
Yep, that's exactly what I'm trying to do!
w
OK so my commit message with it is > For RCL to be happy this needs to be a .targets and not .props as RCL uses that convention to set static assets
<None Include="..\appsettings-schema.umbraco.community.user2fa.json" Pack="true" PackagePath="\" />
Copy code
xml
<ItemGroup>
        <Content Include="buildTransitive\**" PackagePath="buildTransitive" />
    </ItemGroup>
r
Yep that's exactly what I'm after! Much appreciated @Warren Buckley 👏🏻
w
No problem
Took me a lot of head banging
As I was using .props and think Kevin does as well but its not in the same nuget build as the RCL with the static assets
As I think Corne's blog talks about using prop's as well
Build/pack it locally and use Nuget Package Explorer to view its contents and see what files you get bundled in it
So if you call it
packageID.props
it was getting ignored as the one for the RCL was being used
r
With your test site, were you able to get the schema file to appear just by including the RCL project with
<ProjectReference />
or did you have to
dotnet pack
first and actually install it?
w
Yeh dont think it worked as a proj ref from memory
I packed it locally and then installed it from a local folder as a nuget feed to test/verify it
If you find out how with a proj reference let me know 😄
r
Got it working! I think I was a) trying with a
.props
file and b) expecting it to appear when referenced rather than installed as a standalone NuGet package
w
Yep I ran into the exact same two issues and was very confused ?!
Glad I could help out
7 Views