How can I use NAnt to compile WPF controls

Freelance Jobs

I have a WPF project and I'm trying to setup a NAnt build script for it. The problem is that when it tries to compile the WPF controls, the .g.cs files are not being generated as they are when building from within Visual Studio. I'm using the csc build task.

From my reading it seems that when Visual Studio builds, it performs a pre-build step that generates the .g.cs files. Is it possible to do this via NAnt?

I found this post about WPF, .g.cs and baml:

Any ideas? Thanks in advance.

2008-09-17 21:56:57 Scores:2

1 answer

Answer 1

You might want to try using the msbuild task

Nick Monkman H
2008-09-17 21:59:03
Yep, I think this is the only way. Thanks.
andypike H
2008-09-18 12:26:45 Scores:0
Share |
View original post at

Related topics

Building a WPF App with NAnt

Is there some way to compile (with the CSC task) a WPF Application with NAnt except for using the <msbuild> task from the NantContrib? ...

Why do I get a "Metafile not found" error when trying to compile a WPF application?

I had to rebuild a project in my application. I created a new project, created each file, and copied the contents of each file into the new project one at a time making all the necessary changes. Now when I try to compile the project, it gives me three errors: The metafile c:\projects\project1\CustomerModule\bin\Debug\CustomerModule.dll ...

Calling NAnt from a .Net Application

I am working on a prototype project and need to put a new layer of abstraction over my existing NAnt scripts, for which I'd like to use .Net, possibly even WPF. What I have at present is a NAnt script which I call from a Command window (a DOS box, for ...

How do WPF Markup Extensions raise compile errors?

Certain markup extensions raise compile errors. For example StaticExtension (x:Static) raises a compile error if the referenced class cannot be found. Anyone know the mechanism for this? Is it baked into the XAML compiler or is such functionaility available to custom markup extensions? EDIT: mfeingold below suggested that I need to ...

Which files have to be in SVN repository for other people to be able to compile?

I've created a Codeplex site for an app I'm building and right now I just right click the entire solution folder Visual C# Express created for me, and used that. Now in my repo I have a lot files that I'm assuming will enable the user to compile my application on ...

Is there a way to set textblocks to static on a UserControl in C# before compile?

EDIT: Apparently I was a little confusing. The original post will remain below, but the main thing I'm asking is if there is a way to make a textblock on a usercontrol static, so that when I try to set it's value with a static method, it doesn't whine and ...

How to compile a wpf application as a DLL?

When I set the output type to Class Library, VS complains about stuff like how I don't have InitializeComponent, etc. Winforms doesn't complain like this. How to fix this? ...

VS on the compile is going to put SQL DB file in bin/debug

Hi I use SQL Compact DB in WPF Project. My project hase this folder structure: Project_name DB_file bin debug release Connection string has this format string connStr="DB_file"; If I debug WPF app in Visual Studio it also create copy of DB file in debug or release folder. I would like use only the one DB file, how ...

Is it possible to compile the same control for both WPF and Silverlight?

I have a complex control for Silverlight, and I need to have the same functionality in WPF. Any way to share the codebase? ...

How to compile a .NET assembly against Silverlight?

I am trying to compile AvalonEdit for Silverlight, but I am not sure how to do it as I never worked with Silverlight, only WPF. I tried to add this control to my Silverlight application but Visual Studio complained that the assembly wasn't compiled against Silverlight. I thought it was ...