Developer forum

Forum » Dynamicweb 10 » AppStore nuget packages including other files that dll's

AppStore nuget packages including other files that dll's

Kevin Steffer
Kevin Steffer
Reply

We just tested out installing a nuget package with templates and it doesn't look like it gets intalled - is it something that could be supported in the future?


Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Thinking uncompiled razor templates in ressources that needs to be unpacked?

 
Kevin Steffer
Kevin Steffer
Reply

Preferrably anything that goes into /Files could be ItemTypes, Images, Respository files, Razor Templates for supporting install of Swift components and other implementation features.

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Hi Kevin

You can do that - as long as you do not have pre-combiled razor, that would be possible.

This is an example of a package that we create that adds presets of import and export jobs (they are xml files in the file system).

When this package is published to nuget, when installed, everything in the content element is being copied to the same location in the /files - so you can include images, templates etc.

<Project Sdk="Microsoft.NET.Sdk">
 
    <PropertyGroup>
        <PackageType>Template</PackageType>
        <PackageId>Dynamicweb.ERP.Import.Export</PackageId>
        <GeneratePackageOnBuild>true</GeneratePackageOnBuild>
        <Version>0.0.1</Version>
        <Title>Dynamicweb ERP Import Export preset</Title>
        <Authors>Dynamicweb Software A/S</Authors>
        <Description>Contains Data Integration Activities to Import and Export data to ERP</Description>
        <PackageTags>activity-preset;preset;dynamicweb</PackageTags>
 
        <TargetFramework>net6.0</TargetFramework>
 
        <IncludeContentInPack>true</IncludeContentInPack>
        <IncludeBuildOutput>false</IncludeBuildOutput>
        <ContentTargetFolders>content</ContentTargetFolders>
        <NoWarn>$(NoWarn);NU5128</NoWarn>
        <NoDefaultExcludes>true</NoDefaultExcludes>
        <PackageReadmeFile>readme.md</PackageReadmeFile>
        <PackageIcon>Icon.png</PackageIcon>
    </PropertyGroup>
 
    <ItemGroup>
        <Content Include="Files\**\*" Exclude="Files\**\bin\**;Files\**\obj\**" PackagePath="Files\System\Integration\Packages\Installed\%(RecursiveDir)%(Filename)%(Extension)" />
        <Compile Remove="**\*" />
    </ItemGroup>
    <ItemGroup>
        <None Include="Icon.png" Pack="true" Visible="true" PackagePath="\" />
        <None Include="readme.md" Pack="true" PackagePath="\" />
    </ItemGroup>
</Project>
 
Kevin Steffer
Kevin Steffer
Reply

It doesn't really extract that type of information using the "Local" App store - looks to me like the LocalAddinProvider only extracts dll files.

Have a look at Dynamicweb.Marketplace.Providers.LocalAddinProvider class Install method.

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

That's true. Works for packages out of nuget.

Locally you would usually just deploy your files directly - no need to pack it first.

But I guess your use case might be a library of your own add-ins that can be installed as needed?

I think we can add support for package content in local packages as well if needed.

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply
This post has been marked as an answer

Hi Again

Frederik did a quickfix, so there is now a pull request to support content files in local nuget packages as well:

https://dev.azure.com/dynamicwebsoftware/Dynamicweb/_git/Dynamicweb10/pullrequest/8011?_a=files

BR Nicolai

Votes for this answer: 1

 

You must be logged in to post in the forum