ascpixi
✅ Evaluating arbitrary XML in MSBuild?
Hi all! :cathi:
Is there any way to evaluate some arbitrary XML in MSBuild - similarly to how you'd do it with
<Import>
, just without the need for a file? My use case is that I want to call into a script, e.g. python supply-props.py
, which will supply dynamically-generated properties, targets, etc., based on a more sane build DSL, and then import those from the string that Exec
returns.
I know that I can write the output to a temporary file and then <Import>
it, but doing it in-memory without the need for that would be much more elegant.
Thanks in advance! :catlove:13 replies
`RoslynCodeTaskFactory` using an ancient version of .NET...?
Hiya all! :cathi:
I'm trying to define an inline task with
RoslynCodeTaskFactory
, but it seems like the corelib that the factory uses is a bit old - for example, there's no System.Range
, you can't split by strings (only by chars!), and even ProcessStartInfo.ArgumentList
doesn't exist. How can I tell the factory to use a more reasonable version?
I'm defining the task like this:
5 replies
❔ ✅ Unhandled Exception: EETypeRva:0x0017C798: Reflection_Disabled on startup?
Hi all!
I'm trying to build an AOT-compiled project with reflection disabled, using
<IlcDisableReflection>true</IlcDisableReflection>
. However, I'm getting the following exception on startup:
The project compiles fine without IlcDisableReflection
. This exception only appeared when I added GUI functionality to my project with the help of ImGui.NET.
The NuGet packages I'm using are:
Can anyone help me out? Thanks in advance! 76 replies
❔ Any way to make VS work with shared project wildcards?
Hi everyone!
I have a C# shared project in a solution, and its
projitems
file is defined as the following:
By default, Visual Studio adds each file to this XML file. This keeps causing merge conflicts, since VS doesn't even settle on the order of how it adds the files.
MSBuild works fine with this, and works perfectly; no issues there. However, with VS, several issues arise:
- when adding a file, it gets added to "Miscellaneous Files". In order to fix this, I have to:
- exclude the file from the project
- include the file
- restart VS, not saving the projitems
- again include the file
- when removing a file, it removes all files. Probably because it associates the wildcard entry with the removed file, and removes said wildcard entry. This can realistically only be fixed by restarting VS, discarding the projitems
changes it made, and then telling it to include any file. After this, it will refresh the project, reflecting that all C# files are included in the project.
I don't want to use individual entries for each file because of the merge conflict issue I've mentioned earlier, but also because VS sometimes even fails at that - sometimes I just see unreferenced files that were supposed to be deleted, but just kinda... stuck around. With a wildcard, this at least solves that issue - but many more, more severe ones arise.
How can I make VS work with such wildcards? I'm not sure whether I can even use a csproj
, because I'm compiling under NAOT w/ no corlib (the std library is supplied by the shared project) and I don't want to mess around with any of the internal classlib
functionality (unless there is a way to package in the whole project just like a shared one).
Thanks in advance! 8 replies
❔ Documentation on the AOT runtime's internal type system (EEType)?
I'm trying to create my own operating system in C#, using the ZeroSharp repository (https://github.com/MichalStrehovsky/zerosharp) and looking to RoseOS (https://github.com/Michael-Kelley/RoseOS) for guidance. Right now, I'm implementing the core library (corelib), and I've encountered the
EEType
type.
From my research, this type represents the type of an object internally, and is present in every System.Object
instance. There is close to no documentation for this type, since it's used internally, and the only implementation I've seen on this is the one in CoreRT (https://github.com/dotnet/corert/blob/master/src/Common/src/Internal/Runtime/EEType.cs). I've tried documenting this type so I could understand it later on, but this has proven very difficult in practice.
Is there any documentation written for this? Or is there any documentation that would help me with writing my own core library, including these internal runtime types? Thanks!11 replies
❔ ✅ Deserializing a JSON array that contains a derived type AND a base type with JSON.NET?
I have three classes:
ScratchTarget
contains all common fields that ScratchScene
and ScratchSprite
will have; I know that all of the JSON array entries will have fields from that class.
However, some objects will be of type ScratchScene
, and some will be of type ScratchSprite
. I have a isStage
field in ScratchTarget
that informs me of the type of said ScratchTarget
.
How would I go about deserializing such a JSON array to a List<ScratchTarget>
, with the JSON.NET deserializer also converting the extra fields by picking either ScratchScene
or ScratchSprite
?20 replies