Question

Is there any way to use PostSharp 3.0+ in Visual Studio 2008? Exactly what I need is [NotNull] attribute.

Était-ce utile?

La solution

The general requirements to use PostSharp are documented on this page - Requirements. Note, that there are PostSharp VS extension and PostSharp build components. And you need to consider the target framework of your project.

PostSharp 3.0+ VS extension requires VS 2010 or later. However, it's possible to build your project without VS and VS extension installed on a machine.

PostSharp 3.0+ build-time components are distributed in a NuGet package and require .NET 4.0 to run.

In general, you can use PostSharp with projects that target .NET 2.0 or later. The supported target frameworks for the particular project depend on the components of the PostSharp you're using (Supported Target Frameworks). If you want to use [NotNull] attribute from the Model Pattern Library, then it requires that your project targets at least .NET 4.0.

Based on all this, the short answer to your question is no, this scenario is not supported. If you're determined to try to make this work, here are some ideas:

Autres conseils

From the CTP announcement:

http://www.postsharp.net/blog/post/Announcing-PostSharp-3-CTP

I am guessing not:

Support for Visual Studio 2012

Visual Studio 2012 is now fully supported. Windows Store projects are supported too (see below). Visual Studio 2010 is still supported at an equal level of features, but support for Visual Studio 2008 has been discontinued.

You could try the manual install method:

http://support.sharpcrafters.com/discussions/problems/1377-requires-nuget#comment_27626000

But I'd expect some disappointment.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top