Fody | Extensible tool for weaving net assemblies | Game Engine library
kandi X-RAY | Fody Summary
kandi X-RAY | Fody Summary
Manipulating the IL of an assembly as part of a build requires a significant amount of plumbing code. This plumbing code involves knowledge of both the MSBuild and Visual Studio APIs. Fody attempts to eliminate that plumbing code through an extensible add-in model.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of Fody
Fody Key Features
Fody Examples and Code Snippets
Community Discussions
Trending Discussions on Fody
QUESTION
I've created an WPF MVVM app. The ViewModel has properties I can bind to from the View. But one of the properties is basically a model for a json document that has many properties which are either int, string or some other model and so on. In my view I have controls that update these properties. The object updates but no PropertyChanged events fire.
What's a clean way to handle a situation like this? Do I have to create dozens of property accessors in my ViewModel or is there a better way?
Edit for more detail:
Now using Fody per Andy:
In my VM:
...ANSWER
Answered 2022-Apr-03 at 08:20Since you want to stay MVVM and not add a bunch of properties (which makes sense,since the JSON schema could change). I would use data templates.
I would build a hierarchical collection of 'PropertyVMs' from the JSON that is bound to the ItemSource
of a TreeView
. Then define a DataTemplate
for the view of a single PropertyVM. That template would display the name of the node and the node content. When the content of a node changes, that node can propagate that notification back wherever it needs to go so that the underlying JSON gets updated.
This gives you a lot of flexibility. You could even define different data templates for different kinds of properties, like a numeric up down for numbers and a date time picker for DateTime
.
QUESTION
I want to release my WPF app just in an .exe file. I have 3 dll's from the WebView2 nuget package.
...ANSWER
Answered 2022-Mar-02 at 05:27What version of .NET are you targeting? This will be easiest if you're on .NET 5+ (ideally 6).
This page documents how to publish a .NET application as a single file, with instructions for the dotnet
CLI and Visual Studio. I believe you will need to follow the instructions under "Including native libraries" and set the IncludeNativeLibrariesForSelfExtract
MSBuild property to true, as both WPF and the WebView2 bindings use a native DLL.
QUESTION
I have a WPF Application with Catel.Core, Catel.MVVM, Catel.Analyzers and Catel.Fody installed.
When I start the application and try to resolve a Data Access Repository (ILigaMannschaftenZuordnungenRepository
) the exception Catel.IoC.TypeNotRegisteredException gets thrown. When I call dependencyResolver.CanResolve();
it returns true.
I made an extension method to register every service and repository in a single place.
...ANSWER
Answered 2022-Feb-10 at 19:56Okay, after debugging for quite some time and checking multiple things, I looked into my Data Access Repositories again. And I realized that my repository's implementation had an internal
constructor instead of a public constructor. The cause was the base Repository, which had an internal constructor. After changing from internal
to public
the DI Container resolved the types correctly.
If you are running into this problem, check if your types have public constructors.
Bad:
QUESTION
I try to embed the dll of a class library into my exe. I use visual studio 2019 and .net 5. I created two projects in one solution one is class library (dll), and the second is console application both targeted for .net core 5. I selected the console application as startup project. the class library contain only public static hello function which print out hello. I referenced the project of the class library into the console application then in the console application i only called the ClassNamespace.library.hello function. when I compile it, it workes fine. then I installed costura.fody as described in their readme, i added the to the console project by:
...ANSWER
Answered 2021-Jul-24 at 09:40This can be accomplished without any additional package. Since NET 5 you have to set two options.
QUESTION
I would like to get a Single .EXE File so I'm using Costura.Fody
.
After adding its NuGet package all of the DLLs are embeded to the .EXE file as expected. The problem is that I get all of those .xml files:
PS1: I'm using .NET Framework 4.6.1 (not able to use newer releases becouse of some of the DLLs).
PS2: Are those files required? Maybe I can delete them straight away...
...ANSWER
Answered 2022-Jan-11 at 11:24This is the default and sometimes frustrating behavior of costura.fody
.
If you notice, all of the following assemblies have their build option:
- Generate Xml Documentation set to true
costura.fody
takes those dlls and generates xml documentations that are oversizing your folder.
The solution is to exclude those files, look it up at the costura.fody
github channel.
QUESTION
When the BindingContext is set, IsValid sets IsLastnameValid and IsFirstnameValid to true even if the required parameters are not correct. And I don't understand why.
XMAL code
...ANSWER
Answered 2021-Dec-19 at 21:02This code works in my test repo (see link in my comment above):
QUESTION
COM Objects don't allow uses inheritance. I have many classes with devided logic, for re-use code. Can Roslyn change class inheritance and combine classes together? Or any fody weavers? How overwhelmed is using Roslyn for this task?
Example:
...ANSWER
Answered 2021-Dec-15 at 05:56You can 'combine' your inheritance into one class with Mono.Cecil or dnLib
Shouldn't be too hard. Course of action:
- Collect all of the classes you need to "crush down"
- Do a
foreach
through all classes resolving all inheritance tree - Remove inheritance from each class
- Add/remove wanted fields/properties/methods into it
- Save your assembly.
QUESTION
I'm writing an MVVM app and I'm trying to include a status bar at the bottom. I've set up the view and view model, which are supposed to track the status of the app's Logger class, which is a singleton for ease of use.
View:
...ANSWER
Answered 2021-Oct-24 at 13:00You should never call Task.Wait
on a Task
object. Always await
it in order to allow it to complete asynchronously. From your posted code it looks like you are blocking the UI thread, thus stealing resources that are needed to update the surface (rendering). Task.Wait
is a ticket to a deadlock.
Also, prefer Task.Run
over Task.Factory
.
Turning your blocking code into non-blocking shoulkd do the trick:
QUESTION
I'm trying to debug as always in VS 2019. Recently, for some reason, when I hit a breakpoint in specific .cs files the Locals window is empty. However, in other files locals are available! When I use Immediate Window in the files where locals are empty, I get "Unable to evaluate expression". But same command in other parts of the code is working.
Context:
Project is a C# library (dll) which loads as a plug-in in another application (Revit)
The pdb file is located in the same directory as the dll
Project is using Fody Weaver. However I've been using it before and I weren't having debugging issues with it.
I attach to the process using Debug > Attach to Process and the Automatic option:
I am attaching in the Debug mode and the dll is built using Debug mode as well.
The "Optimize Code" option is unchecked.
Things I have tried:
- Enabled "Use Managed Compatibility" mode
- Enabled "Suppress JIT optimization on module load"
- Enabled "Just My Code"
- Deleting breakpoints and creating the again
- Cleaning solution and rebuilding
- Restarting Visual Studio
- Starting Visual Studio as an administrator
- Updating Visual Studio to latest
- Restarting my computer
Update:
I tried refactoring and splitting the file where locals aren't showing, into two files. To my surprise now the locals are showing both in the file where they weren't showing before and in the new file. However, the values shown are still weird. The type of objects are shown as float {class}
and I can't expand to see their properties. See screenshot below from locals displayed in the new file:
ANSWER
Answered 2021-Oct-13 at 23:05So in my case the issue was a virus protection software called Cylance I had installed. I changed its settings to Monitor and in the Debug settings of VS, unchecked the "Use Managed Compatibility Mode" and the locals are all showing as expected again.
QUESTION
I have a (WPF) Catel DataWindow with a DataGrid, where the SelectedItem property is bound to a VM property, and has two buttons indented to launch different Catel TaskCommands on the selected data grid item.
Note the CommandParameters are bound in different ways to what seems - but isn't - the same value:
...ANSWER
Answered 2021-Oct-04 at 04:49I think this is caused by the moment the commands get (re)evaluated.
You probably have the InvalidateCommandsOnPropertyChange
property set to true
(default value). For more info, see https://github.com/catel/catel/blob/develop/src/Catel.MVVM/MVVM/ViewModels/ViewModelBase.cs#L1016
At this stage, the binding probably didn't have a chance yet to update itself and is thus sending the previous version.
A workaround for this issue could be to use the dispatcher service inside the VM to re-evaluate the commands yourself:
In the ctor:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install Fody
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page