InvalidProjectFileException Class

This exception is thrown whenever there is a problem with the user's XML project file. The problem might be semantic or syntactical. The latter would be of a type typically caught by XSD validation (if it was performed by the project writer).

MSBuild is now included in Visual Studio instead of the .NET Framework. You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0.

Inheritance Hierarchy

System.Object
  System.Exception
    Microsoft.Build.Exceptions.InvalidProjectFileException

Namespace:  Microsoft.Build.Exceptions
Assembly:  Microsoft.Build (in Microsoft.Build.dll)

Syntax

'Declaration
<SerializableAttribute> _
Public NotInheritable Class InvalidProjectFileException _
    Inherits Exception
[SerializableAttribute]
public sealed class InvalidProjectFileException : Exception
[SerializableAttribute]
public ref class InvalidProjectFileException sealed : public Exception
[<Sealed>]
[<SerializableAttribute>]
type InvalidProjectFileException =  
    class 
        inherit Exception 
    end
public final class InvalidProjectFileException extends Exception

The InvalidProjectFileException type exposes the following members.

Constructors

  Name Description
Public method InvalidProjectFileException() Default constructor.MSBuild is now included in Visual Studio instead of the .NET Framework. You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0.
Public method InvalidProjectFileException(String) Creates an instance of this exception using the specified error message.MSBuild is now included in Visual Studio instead of the .NET Framework. You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0.
Public method InvalidProjectFileException(String, Exception) Creates an instance of this exception using the specified error message and inner exception.MSBuild is now included in Visual Studio instead of the .NET Framework. You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0.
Public method InvalidProjectFileException(String, Int32, Int32, Int32, Int32, String, String, String, String) Creates an instance of this exception using rich error information.MSBuild is now included in Visual Studio instead of the .NET Framework. You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0.

Top

Properties

  Name Description
Public property BaseMessage Gets the exception message not including the project file.MSBuild is now included in Visual Studio instead of the .NET Framework. You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0.
Public property ColumnNumber Gets the invalid column number (if any) in the project.MSBuild is now included in Visual Studio instead of the .NET Framework. You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0.
Public property Data (Inherited from Exception.)
Public property EndColumnNumber Gets the last column number (if any) of a range of invalid columns in the project.MSBuild is now included in Visual Studio instead of the .NET Framework. You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0.
Public property EndLineNumber Gets the last line number (if any) of a range of invalid lines in the project.MSBuild is now included in Visual Studio instead of the .NET Framework. You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0.
Public property ErrorCode Gets the error code (if any) associated with the exception message.MSBuild is now included in Visual Studio instead of the .NET Framework. You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0.
Public property ErrorSubcategory Gets the error sub-category (if any) that describes the type of this error.MSBuild is now included in Visual Studio instead of the .NET Framework. You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0.
Public property HasBeenLogged Gets a flag that determines whether the exception has already been logged. Allows the exception to be logged at the most appropriate location, but continue to be propagated.MSBuild is now included in Visual Studio instead of the .NET Framework. You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0.
Public property HelpKeyword Gets the F1-help keyword (if any) associated with this error, for the host IDE.MSBuild is now included in Visual Studio instead of the .NET Framework. You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0.
Public property HelpLink (Inherited from Exception.)
Public property InnerException (Inherited from Exception.)
Public property LineNumber Gets the invalid line number (if any) in the project.MSBuild is now included in Visual Studio instead of the .NET Framework. You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0.
Public property Message Gets the exception message including the affected project file (if any).MSBuild is now included in Visual Studio instead of the .NET Framework. You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. (Overrides Exception.Message.)
Public property ProjectFile Gets the file (if any) associated with this exception. This may be an imported file.MSBuild is now included in Visual Studio instead of the .NET Framework. You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0.
Public property Source (Inherited from Exception.)
Public property StackTrace (Inherited from Exception.)
Public property TargetSite (Inherited from Exception.)

Top

Methods

  Name Description
Public method Equals (Inherited from Object.)
Public method GetBaseException (Inherited from Exception.)
Public method GetHashCode (Inherited from Object.)
Public method GetObjectData ISerializable method which we must override since Exception implements this interface If we ever add new members to this class, we'll need to update this.MSBuild is now included in Visual Studio instead of the .NET Framework. You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. (Overrides Exception.GetObjectData(SerializationInfo, StreamingContext).)
Public method GetType (Inherited from Exception.)
Public method ToString (Inherited from Exception.)

Top

Remarks

WARNING: marking a type [Serializable] without implementing ISerializable imposes a serialization contract -- it is a promise to never change the type's fields i.e. the type is immutable; adding new fields in the next version of the type without following certain special FX guidelines, can break both forward and backward compatibility

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Microsoft.Build.Exceptions Namespace