Skip to content

Visual Studio extension (VSIX) that generates a WebFramework plugin file handler (FileHandler.cs) for the files in Files/.

License

Notifications You must be signed in to change notification settings

pmpwsk/PluginFilePacker

Repository files navigation

PluginFilePacker

Visual Studio extension (VSIX) that generates a WebFramework plugin file handler (FileHandler.cs) for the files in Files/.

Example of a generated file on GitHub: ServerPlugin/FileHandler.cs

Website: https://uwap.org/projects/plugin-file-packer

Version for Visual Studio Code: https://marketplace.visualstudio.com/items?itemName=uwap-org.uwap-pluginfilepacker-vsc

Main features

  • Generating a plugin file handler for static files (using text for dynamically modified text files or using a .RESX file / base64 string otherwise (depending on the setting))
  • Calling a custom file handler if no matching file was found (see "Usage" below)
  • Automatically detecting the namespace and class name of the existing FileHandler.cs or FileHandlerCustom.cs
  • Dynamically replacing [PATH_PREFIX] with the current plugin path prefix, [PATH_HOME] with the plugin's current home/root path, [DOMAIN] with the current domain and [DOMAIN_MAIN] with the main domain for the current domain

Installation

You can find this extension on the Visual Studio marketplace as: PluginFilePacker

Alternatively, you can download the .vsix file from the releases on GitHub and open it to install the extension.

Usage

To execute the command, go to: Tools > Generate FileHandler.cs (if there are multiple projects in your solution, you might need to click on the desired project to select it!)

There are some settings under Tools > Options > PluginFilePacker, those are documented in their description.

To create a custom file handler as a fallback, create a file FileHandlerCustom.cs using the same namespace and partial class, then add two methods like this:
byte[]? GetFileCustom(string relPath, string pathPrefix, string domain)
string? GetFileVersionCustom(string relPath)

About

Visual Studio extension (VSIX) that generates a WebFramework plugin file handler (FileHandler.cs) for the files in Files/.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages