ILReader | interprete CIL-bytes of methods and delegates bodies
kandi X-RAY | ILReader Summary
kandi X-RAY | ILReader Summary
Provides a way to read and interprete CIL-bytes of methods and delegates bodies.
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 ILReader
ILReader Key Features
ILReader Examples and Code Snippets
Community Discussions
Trending Discussions on ILReader
QUESTION
I'm generating Web API controllers at runtime (.Net Core 3.0). What I have is a generic base controller from which I inherit the generated controller and when setting up the http actions I want to call a method from the base class and return its value. When I call /api/Foo/1 an InvalidProgramException is being raised.
EDIT: I simplified the code and added a running example (see Working Example project).
What I want to achieve:
...ANSWER
Answered 2020-Jan-10 at 10:09I had to massage your code quite a bit to get it to compile and run. Once I did this, it ran perfectly, so I'm not sure which part of my massaging fixed the problem you had. The changes I made:
- When you define your
tb
(by callingDefineType
), you need to make sure that it inherits frombaseCrudController
. Since you declarebaseCrudController
later, I'm not convinced you were doing this. But it's hard to say, because this code isn't in your question - In your call to
tb.DefineMethod
, strings in C# need double quotes, not single quotes - In that same call, you need
typeof(Foo), new[] { typeof(int) }
nottypeof(Foo), typeof(int)
, as you need to pass an array of parameter types - You need to use
typeof(HttpGetAttribute)
, nottypeof(HttpGet)
HttpGetAttribute
has multiple constructors, and you can't rely on the order that they're returned in. Explicitly specify that you want the parameterless constructor- You don't need the
nops
, and you don't need thestloc
/ldloc
after thecall
. Those are only added in Debug builds to help the debugger - In fact, since you haven't declared a local slot
0
, thestloc.0
andldloc.0
are invalid. When you're usingSystem.Reflection.Emit
, if you need to store a value into a local slot, use aLocalBuilder
and don't explicitly address the slots by number. - When you call the base method, its name is
"DoGet"
and not"GetInBase"
Make all of those changes and you get this, which works:
QUESTION
I know that there are multiple posts, blogs etc related to same issue but none of them helped me thus I'm posting this question here for some expert opinion.
Environment: Windows 10, Office 2016, .Net Framework 4.5.1, Visual Studio 2010 Tools for Office runtime
My outlook addin works perfectly fine on Win7, Win8.1, Outlook 2013, 2016.
Issue: Outlook add-in is not loading up on outlook startup, I see that LoadBehaviour is changing from 3 to 2. When I double-click and install the .vsto file from the installed location that time add-in is installed successfully but still the add-in is not loaded up during outlook startup.
I have followed all the steps provided by Hamed Ahmadi in his blog. But none of them helped.
Fusion logs:
...ANSWER
Answered 2017-Nov-01 at 10:59Finally, I was able to solve my issue.
Problem was with the registry entry which I had in the Visual Studio Installer project.
I was using [INSTALLDIR]PhishLabs.OutlookAddin.vsto|vstolocal
which worked perfectly fine in Win7, Win8.1 deployments but in Win10 it was failing.
I had replaced INSTALLDIR
with TARGETDIR
which is working fine now on Win10.
[TARGETDIR]PhishLabs.OutlookAddin.vsto|vstolocal
is what you need.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install ILReader
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