© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•2y ago•
8 replies
Memw

Running custom build targets within library user

I have all my code to implement views within a big HTTP library I'm making, that parses files with html and c# together with custom expressions and all.

I was thinking that the best way would be leaving the user of the library (the library can be installed trough nuget) to declare a property like
Views
Views
or something like that with a path, and then my library would copy these files from the user specified path to the user project bin so the library has access to those, any other suggestions on how to open view files for the library to access.

For now I was thinking on the first part, it would be possible to make a custom property available to the users csproj and running a target like

<Target Name="CopyMemwLibViews" BeforeTargets="Build">
  <Copy Condition="Exists('$(Views)')" SourceFiles="$(Views)" DestinationFolder="$(OutputPath)\Views" />
</Target>
<Target Name="CopyMemwLibViews" BeforeTargets="Build">
  <Copy Condition="Exists('$(Views)')" SourceFiles="$(Views)" DestinationFolder="$(OutputPath)\Views" />
</Target>


if the user has that property declared in their csproj?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Targets not running
C#CC# / help
2y ago
Maui - pre build targets iOS
C#CC# / help
11mo ago
Directory.Build.targets is ignored (with Rider?)
C#CC# / help
5mo ago