MarkPflug
creating a nuget for a custom msbuild task
Here is a project I created that does what you're looking for:
https://github.com/MarkPflug/Sylvan.BuildTools.Resources/blob/main/source/Sylvan.BuildTools.Resources/Sylvan.BuildTools.Resources.csproj
This .csproj has all the settings needed to produce a correct package. However, this task has no third-partyh dependencies, which might complicate things a bit.
13 replies
creating a nuget for a custom msbuild task
You don't want your assemblies to end up in the
lib
folder, as that would cause the consuming project to use it at runtime. An MSBuild package should only be loaded at build time. So, you want to have your binaries in a different location, such as under your build
folder where your .props/.targets files live. I think you can do this by setting <BuildOutputTargetFolder>build</BuildOutputTargetFolder>
in the .csproj for your task.13 replies
✅ Reading/Writing in Excel with C#
I'm the author of a library for reading Excel data. It has a pretty minimal API, and is very specifically for getting data out of Excel, ie it doesn't handle formatting, styles, charts, etc. It essentially provides a
DbDataReader
over Excel, so is ideal for reading rectangular/tabular data. Though, with a bit of work it can be used to read unusual datasets too. Open source, MIT license, extremely memory/CPU efficient, handles reading .xlsx, .xlsb, and .xls:
https://github.com/MarkPflug/Sylvan.Data.Excel
Might be too minimal for what you need.43 replies
Work with .resx Resource files on vscode
Though it does have some "examples" in the unit test project:
https://github.com/MarkPflug/Sylvan.BuildTools.Resources/tree/main/source/Sylvan.BuildTools.Resources.Tests/Data
22 replies
Work with .resx Resource files on vscode
I've implemented a json-based alternative to .resx files that uses MSBuild code gen, instead of VS design-time code gen. Maybe it would work for you?
https://github.com/MarkPflug/Sylvan.BuildTools.Resources
22 replies
✅ "You must install or update .NET to run this application"
@QuaKe You might be able to make this work by adding/editing the *runtimeconfig.json for xstyler:
https://learn.microsoft.com/en-us/dotnet/core/versions/selection#control-roll-forward-behavior
You would need to set RollForward to Major, indicating that even though xstyler was built against .NET 6, that it should be allowed to run on .NET 8. I think the breaking changes since .NET 3.1 have been so minimal that it is extremely unlikely that there would be an incompatibility. In my opinion, all .NET tools should default to Rollforward=Major in the .csproj file, but it looks like xstyler doesn't do that.
6 replies
Blazor: CSV exported is empty
Second, you might run into issues because you aren't flushing/disposing anything. CsvWriter and even StreamWriter might have internal buffering that would prevent everything from arriving in the MemoryStream until they are flushed, or closed. Be aware, that disposing the StreamWriter will close the MemoryStream by default, there is a constructor overload that accepts a boolean to tell it to leave the stream open.
8 replies