R – target Silverlight 3.0 using NAnt

nantnetsilverlight-3.0

How can I add a silverlight-3.0 target framework to NAnt? I tried modifying the nant.exe.config file, based on silverlight-2.0 profile, but that fails during compilation with CS0518: Type "System.Object" not defined or imported [error message translated from Polish]. Also, the silverlight-2.0 target does not seem to set "SILVERIGHT" conditional compilation define like Visual Studio does, which complicates writing multi-target libraries.

Does anyone here build mixed target solutions (with libraries for both full .NET framework and Silverlight)?

Best Answer

You can download the NAnt 0.91 Alpha 2 Release, which includes support for the net-4.0 framework. That framework works for compiling solutions with Silverlight 4 apps.

I have a solution that includes a Silverlight 4 application and a .NET 3.5 ASP.NET web project and I'm using the alpha release net-4.0 framework to compile and it works great.

Alternatively, still using the Nant alpha version, if you just need to compile a SilverLight 4 application with Nant and you can grab the silverlight-4.0 framework tag from Nant CVS here. and add that tag to your Nant.exe.config file.