Tip: Extensions using .NET 3.5 fail compilation in Integration Studio

Tip: Extensions using .NET 3.5 fail compilation in Integration Studio

  
Symptom

You create an extension in Visual Studio for use with Agile Platform 5.1.1+. Your extension uses code primitives that are native to .NET 3.5. When publishing your extension in Visual Studio, everything works OK; however, when you publish the extension in Integration Studio you get a nasty syntax error:

.NET Compilation.
 
MyClass.cs(45,32): error CS1026: ) expected
MyClass.cs(45,46): error CS1002: ; expected
MyClass.cs(45,46): error CS1525: Invalid expression term 'in'
MyClass.cs(45,49): error CS1002: ; expected
MyClass.cs(45,91): error CS1002: ; expected
MyClass.cs(45,102): error CS1002: ; expected
MyClass.cs(45,102): error CS1525: Invalid expression term ')'



Cause

Your extension is using .NET 3.5 specific constructs; however, the Visual Studio project is configured to compile the source code with the .NET 2.0 compiler.
The problem here is that Visual Studio will automatically use the appropriate compiler - and therefore not change the project definitions. Since Integration Studio follows the exact definitions, compilation will fail.

Resolution

Open the Extension in Integration Studio. Locate the csproj file, and open it with a text editor:



In the first lines, you will find a line similar to:

<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="2.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">



You need to replace it with:

<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="3.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">


Cheers,