postsharp Questions
2
Solved
PostSharp 3 is available only as a visual studio extension. Visual Studio Express don't support extension. Is there a way to use PostSharp 3 with Express version of Visual Studio?
Previously we us...
Leeann asked 21/3, 2013 at 7:4
1
Solved
Using Postsharp, how do you set the return value after an exception has been thrown?
I thought this would work:
namespace MvcApplication3.Controllers
{
public class ValuesController : ApiControl...
1
Solved
My project structure
A.dll, which has PostSharp installed via NuGet and uses it.
B.exe, which references A and does not use PostSharp.
Edit: I created a test solution to see if I could recreate...
2
Solved
I have a simple Cache attribute implemented using postsharp. When I set the cache policy I want to be able to set a update callback like below.
private static CacheItemPolicy GetCachePolicy(Cach...
2
Solved
After asking this question about implementing an aspect with PostSharp, it came to my mind that I might have to update the code of this aspect in the future, and that I did not want to take the ris...
Straley asked 16/3, 2012 at 12:41
1
Solved
Environment
Windows 7 x64
PostSharp 2.1.7.30 installed
PostSharp 2.1.7.29 (reference retrieved from the PostSharp install directory)
log4net 1.2.11.0 (reference retrieved from the net\2.0\release...
2
ASP.NET MVC proposes that use or extend built-in Authorization, Action, Result, Exception filters.
3th party .Net IoC containers (Unity, Ninject, Autofac) propose Interceptors
3th party AOP...
Telmatelo asked 21/2, 2013 at 17:42
2
Solved
I have the following code:
[Serializable]
class ExceptionAspectHandler:OnExceptionAspect
{
public override void OnException(MethodExecutionArgs args)
{
Console.WriteLine("{0}", args.Exception...
Cressy asked 11/5, 2012 at 14:14
1
Solved
I have a need to capture the input and output of F# functions and decided to try using PostSharp. I was unable to find documentation and a working F# example for using PostSharp with F#. Does anyon...
3
Solved
I know with Castle Windsor, you can register aspects (when using method interception in Windsor as AOP) using code instead of applying attributes to classes. Is the same possible in Postsharp? It's...
7
I'm wondering what the best way to do this is... I'm interested in introducing PostSharp into one of my projects, but I'm not sure how to unit test classes marked with an attribute properly.
For e...
Essene asked 10/2, 2010 at 20:13
1
Solved
I'm trying to set up a PostSharp aspect RunOutOfProcessAttribute so that it applies to:
all public methods
any method marked with the DoSpecialFunctionAttribute, regardless of member accessibilit...
1
I have a very strange problem. I have an Interface defined in a dll as follows:
public interface IKreator2
{
string Name { get; set; }
string Description { get; set; }
INotifyPropertyChanged S...
1
Solved
If you subscribe the .net event with the same subscribe more then once, then your subscribed method will be called the same times as subscribed. And if you unsubscribe just once, then it will be ju...
Hadley asked 17/4, 2012 at 9:2
1
Solved
I can specify the SkipPostSharp constant to ensure a project is excluded from the list of projects PS processes. I want to do it the other way around though. I want PS to assume it shouldn't proces...
Porphyria asked 21/3, 2012 at 23:59
3
I've recently started using PostSharp in some of my projects and have noticed an unfortunate side effect - the code coverage in all the projects its used with drops significantly.
I'm guessing the...
Megganmeggi asked 21/2, 2011 at 10:12
1
Solved
I'm using a PostSharp method attribute to do authorisation and auditing on my WCF service. It's working properly but now I'm trying to get my unit tests working with the attribute and am struggling...
Romonaromonda asked 19/1, 2012 at 4:18
2
I wish to write an attribute for a function (or class) that will catch any exception thrown and set its StackTrace property to string.Empty. How can I do this?
EDIT:
If I cannot accomplish this i...
Foppish asked 2/2, 2012 at 14:31
1
Solved
I need to do some stuff with parameteres passed into my method. How can I play with them (modify) using PostSharp ?
1
Solved
How can I write a PostSharp aspect to apply an attribute to a class? The scenario I'm considering is a WCF entity (or domain object) that needs to be decorated with the DataContract attribute. It s...
2
Solved
In my application I previously used regular C# attributes to "annotate" a method. E.g.:
[Foo(SomeKey="A", SomeValue="3")]
[Foo(SomeKey="B", SomeValue="4")]
public void TheMethod()
{
SpecialAttr...
3
We have an application here which is using postsharp to wrap certain methods within a transaction aspect derived from MethodInterceptionAspect. We use NHibernate 2.0 as an ORM for the application. ...
Chunky asked 21/1, 2010 at 1:3
4
Solved
How do you give a C# Auto-Property a default value, using a custom attribute?
This is the code I want to see:
class Person
{
[MyDefault("William")]
public string Name { get; set; }
}
I am aw...
Protege asked 20/6, 2011 at 0:2
1
Solved
I am running a .NET 4.0 Web Application (not web site) and PostSharp 1.5. I cannot get the OnEntry override method to execute using the OnMethodBoundaryAspect base class. Here is some relevant code...
3
Solved
I've recently started experimenting with PostSharp and I found a particularly helpful aspect to automate implementation of INotifyPropertyChanged. You can see the example here. The basic functional...
© 2022 - 2024 — McMap. All rights reserved.