n8ta
How to run a target when any of a set of input files has changed?
I'm trying to build a large project that msbuild does not understand via a <Target> with the inputs parameter as a list of all source files in that project and outputs as the single file the build produces. However, even when I change a file in the Inputs of the <Target> the target is not re-run. There is not a 1-1 mapping between inputs and outputs.
19 replies
✅ How does this code call System.Text.StringBuilder.ToString?
I've grabbed stacks of my program at runtime and I can see it in the PersistSettings method and then above that on the stack is System.Text.StringBuilder.ToString. Can anyone tell where that method could be inserted by the compiler?
7 replies
❔ ENV var dump collection not working on some machines
I'm using these env vars to collect dumps from my .net core macOS app (docs: https://learn.microsoft.com/en-us/dotnet/core/diagnostics/collect-dumps-crash)
DOTNET_CreateDumpVerboseDiagnostics=1
DOTNET_CreateDumpLogToFile=/var/tmp/dotnet.log
COMPlus_DbgEnableMiniDump=1
COMPlus_CreateDumpDiagnostics=1
COMPlus_EnableCrashReport=1
COMPlus_EnableDumpOnSigTerm=1
This works locally on an arm device and an intel device. I see /var/tmp/dotnet.log show up with coredump diagnostics and I see coredumps in TMPDIR. However when I run it in an azure devops pipeline no coredumps are created and the coredump log only contains
0003bf7f TickFrequency: 1000000 ticks per ms
0003bf7f PAGE_SIZE 4096
I'm not sure how to debug this further since I cannot ssh into my ADO pipeline agent. Anyone have any suggestions on next steps?
2 replies
❔ No atomic appends to file in .NET core?
I've used this snippet before to do atomic appends to a file https://stackoverflow.com/questions/1862309/how-can-i-do-an-atomic-write-append-in-c-or-how-do-i-get-files-opened-with-the but it seems that this no longer works in .NET core.
I found this attempt to fix https://github.com/dotnet/runtime/pull/55465 which was not merged and this proposal https://github.com/dotnet/runtime/issues/53432#issuecomment-902478772.
Is there any other way to accomplish atomic appends? I only really need macos support but it seems like cross plat isn't too much to ask (:
5 replies
Specifying framework version of dependency manually in SDK style project
I am updating an old project to the SDK style and I have a reference that looked like
After moving to SDK style I had
Which caused the build system to select the net46 version of the package not the net45 which turns out to be important. How can I override that behavior? Going back to the <Reference seems to work but it'd be nice to use PackageReference if possible.
11 replies
❔ System.TypeLoadException
Having an issue where my native bindings project (using objective-sharpie) expects a class to exist in the Xamarin.Mac assembly but when it runs in some of my projects it hits:
System.TypeLoadException : Could not resolve type with token 01000012 from typeref (expected class 'ObjCRuntime.ThrowHelper' in assembly 'Xamarin.Mac, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065')
I built the my package on Xamarin 9.0.1.2 and the application is being built into an application w/ 9.0.1.5. Is this mismatch the problem? What else might be the issue?
7 replies
VS Mac bindgen error
I've used objective sharpie to generate a c# wrapper around an obj-c library following https://learn.microsoft.com/en-us/xamarin/cross-platform/macios/binding/objective-sharpie/
When I go to build my project with vs mac I receive this:
error BI1042: bgen: Missing '[Field (LibraryName=value)]' for {0} (e.g."__Internal")
as part of the _GenerateBindings target. What does this mean? There's no associated line number and I'm not clear on what this task does.
2 replies
❔ How to take a native crash [{0x7f803bba7228} + 0x3bd] + PDB/DLL and get a line number?
I have a native crash from a .net application on macOS that contains some managed code in the stack.
10 MyDll.MyClass.Myfunction (string,string) [{0x7f803bba7228} + 0x3bd] [/xyz/MyDll/MyClass.cs :: 378u] (0x14b362550 0x14b362c88) [0x7f8032105240 - MyApp.exe] [0x14b36290d]
I have the DLL and PDB and I'd like to turn this into a line number. How can I do that?
20 replies
❔ Convert decimal without trailing 0s
My goal is to print decimal numbers with all available precision and without a trailing .0
I'd like 123.0 to convert to 123 not 123.0. How can I do this for the decimal type? I was somewhat surprised that 123.0 and 123 are converted into different values.
24 replies
❔ Binding redirects not being loaded despite config file being set
I have net48 package with a binding redirect from newtonsoft 0->13 to 13.0.0.0
This redirect is not being used at runtime and I can confirm that with fusion++
https://pastebin.com/NVw4wxsc
However if I debug and inspect what my config file path is
var configFile = AppDomain.CurrentDomain.SetupInformation.ConfigurationFile;
It is correct and when I open it I see my redirect.
How can I debug why my config file's binding redirect is not being parsed?
This only happens when run as a test not when we run the normal app.2 replies