Code contracts without DLLs on disk on asp.net 5 / vnext

Asp.Net vnext / 5 uses roslyn to compile on the fly, without creating any builds at all. Most code contract tools use compile-time code transformations to translate contracts to run-time checks.

How does it work with Asp.Net 5? I like to use attibute-based contracts, such as [NotNull] by parameters, but all this does not work if you do not have a compilation stage and no assemblies.

Any ideas in which this happens?

+4
source share
1 answer

The default behavior when building, as you say, but you still have the ability to create output files if you want.

If you work on the command line, go to your file folder project.jsonand use the command kpm build. This will create the Nuget packages and also leave the DLL in familiar places for each structure you are targeting.

For example, if you target on aspnet50,, you can get \bin\Debug\YourProject.Version.nupkgand\bin\Debug\aspnet50\YourProject.dll.

The Nuget package will contain the necessary assemblies for each structure you orientate, and you will have a directory inside the assembly configuration folder (for example, Debug) for each structure using a DLL.

Visual Studio 2015, , . Properties. Build , DLL . kpm build .

+3

All Articles