c# - MS-Build BeforeBuild not firing -


I have customized a .propro project to run some custom functions before the main build I am here. However, I can not execute tasks at all.

I joined & lt; Target name = "beforeBuild" /> Specified in the element .csproj file and added a simple message function, but when I create a message, the message does not appear in my output, so it seems that the function is not working So this piece does not output to the message;

Listing 1: No messages appear

  & lt; Target name = "first building" & gt; & Lt; Message text = "about creating an ORM layer" value = "normal" /> & Lt; / Target & gt;  

However, if I screw with some attributes, then I can fail to execute .csproj at all;

Listing 2: An MSBuild configuration error

  & lt; Target name = "first build" & gt; & Lt; Message text = "About creating an ORM layer" XXImportance = "normal" /> & Lt; / Target & gt;  

XXImpportance attribute note I think build error is

  my.csproj (83,46): error MSB4064: The "XXImportance" parameter is not supported by the "message" function Verify the parameters on the job, and this is a set of public instance property.  

It shows that the XML is being parsed, that the message class has been found, and that the square is being reflected for available properties .

Update 1: On the advice of @Martin, I tried to run MSBuild on the console, and this error Found

  c: \ path \ to \ my.csproj (74,11): Error MSB4019: Imported Project "C: \ Microsoft.CSharp.targets" was not found. Confirm that the & lt path, import & gt; The announcement is correct, and that the file exists on the disk.  

Line 74 reads;

  & lt; Import Project = "$ (MSBuildToolsPath) \ Microsoft.CSharp.targets" / & gt; <2:  Update 2:  I am compiling in VS 2008, which uses the C # 3 compiler, but I'm compiling the project is a Framework 2.0 project. When run from command line (see update 1), build fails because there is an illusion where  Microsoft.CSharp.targets  file is specified. 

The event is firing, but you may need to change your settings in VS:

Tools-> Options -> Projects and Solutions-> Build and Run:

Set the MSBUild Web site for at least or general.

In addition, if you will consolidate through the msbill in the console see the message without changing the above settings.


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -