.NET Compilation Error
Question

Hi,

After we upgraded our environment to Server Version 11.0.424.0 some of our extensions fail. While compiling the extension we saw the following output. We changed the ToolsVersion from 12.0 to 4.0 without success.

  • Project file contains ToolsVersion="12.0". This toolset may be unknown or missing, in which case you may be able to resolve this by installing the appropriate version of MSBuild, or the build may have been forced to a particular ToolsVersion for policy reasons. Treating the project as if it had ToolsVersion="4.0". For more information, please see https://go.microsoft.com/fwlink/?LinkId=291333.
      XMLUtils -> C:\Users\MyAwesomeComputer\AppData\Local\Temp\a105d767-5f3a-42e2-92ee-026ddbe4f126\Source\NET\bin\OutSystems.NssXMLUtils.dll

Our extension converts XML documents to a JSON structure. We saw errors related to the Newtonsoft package. We tried to add the package several times in Visual Studio code but after publishing a newer version of the extension above error pops up again.

  • Could not load file or assembly 'Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified.

We already republished to full solution. 

Regards,

Jeffrey


Solution

Our issue has been solved. For future reference hereby the solution. The reference path of the Newtonsoft property was incorrect. Most likely caused by installing the NuGet package. After we changed this to the correct path everything worked again as intended. 

 Path: C:\Program Files\OutSystems\Development Environment 11.0\Integration Studio\Newtonsoft.Json.dll

Jeffrey Meijer thank you so much for posting the solution.

That fixed our errors, but it's a little concerning that it happened at all. Our extensions had been working fine for months until we updated the Outsystems server - was I as a developer supposed to know to use the OS reference to NewtonSoft instead of the nuget package? Was this documented somewhere and I missed it? 

MichaelR wrote:

Jeffrey Meijer thank you so much for posting the solution.

That fixed our errors, but it's a little concerning that it happened at all. Our extensions had been working fine for months until we updated the Outsystems server - was I as a developer supposed to know to use the OS reference to NewtonSoft instead of the nuget package? Was this documented somewhere and I missed it? 

Haven't seen any documentation so far nor that anyone could know. As far as I know this is a problem that only occurs while upgrading the server version. We reported this to OutSystems a while ago, but it seems that it hasn't been solved yet.

How did you get into this property, is this in visual studio? I can't seem to find this in the extension.

mvp_badge
MVP

Change Integration Studio MSBUILD's location from .NET Framework to the one bundled with Visual Studio. Usually does the trick.

Cheers!

Thanks for the response Armondo. We tried your suggestion but unfortunately without any success. It seems that the Integration Studio is missing content with the Newtonsoft package.

While we're opening the extension via Service Studio, our first step is to verify the extension. We got an error but normally it's quite simpel to resolve this one, by adding the Newtonsoft package to the solution. We have done that uploaded the solution but both errors as mentioned in my initial post keeps popping up. After we closed the integration studio and re-open the extension... the Newtonsoft package is not related to the solution anymore.

mvp_badge
MVP

I find that weird, because as far as I recall, Newtonsoft is now added by default to the extension references? You can use nuget or even add the DLL manually. That should fix the issue.

Thanks again, and I tried but unfortunately it doesn't solve the issue.

mvp_badge
MVP

Jeffrey Meijer wrote:

Thanks again, and I tried but unfortunately it doesn't solve the issue.

Any chance you can share the extension so I can take a look?


Armando Gomes wrote:

Jeffrey Meijer wrote:

Thanks again, and I tried but unfortunately it doesn't solve the issue.

Any chance you can share the extension so I can take a look?


Sure. See attachment.


XMLUtilsv3.xif

mvp_badge
MVP

I was able to compile it without any change. See attached.

XMLUtilsv1.xif

Armando Gomes wrote:

I was able to compile it without any change. See attached.

Thanks Armando. I appreciate your effort a lot. It seems that we have issues with the Newtonsoft versions on our server. I'll open a support case as I'm pretty sure we can't resolve this.

Found conflicts between different versions of "Newtonsoft.Json" that could not be resolved.

  • .NET Compilation.

    C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2106,5): warning MSB3277: Found conflicts between different versions of "Newtonsoft.Json" that could not be resolved.  These reference conflicts are listed in the build log when log verbosity is set to detailed.
      XmlToJson -> C:\Users\MyAwesomeComputer\AppData\Local\Temp\10b2f7fe-2c68-4b2a-b221-46d34db1870e\Source\NET\bin\OutSystems.NssXmlToJson.dll
mvp_badge
MVP

Sure. Good luck with that :)

mvp_badge
MVP

Hi,

Out of curiosity, are you updating from OS10 or OS9?

We had the same problem when we upgraded from OS) to OS10 because our applications were using the ARDOJSon and we had a conflict of versions. Replacing the calls to this library to the ones to the library provided by the platform solved the issue for us.

Cheers.

Hi,

We were already on OS11 but upgraded to the latest GA version. What do you mean by

  • Replacing the calls to this library to the ones to the library provided by the platform solved the issue for us.

Cheers

mvp_badge
MVP

Hi, 

In our case, was the first version of OS10, and there was also a conflict between the version of the JSON library used by the platform and the one used by ARDOJSon that we were using at the time.
Once we replace the ARDOJson by the platform functions in our code, everything started to compile again.

But if you were already in OS11, than this is something for the Support to help you solve as it seems a problem with the platform upgrade version.

Cheers.

Eduardo Jauch wrote:

Hi, 

In our case, was the first version of OS10, and there was also a conflict between the version of the JSON library used by the platform and the one used by ARDOJSon that we were using at the time.
Once we replace the ARDOJson by the platform functions in our code, everything started to compile again.

But if you were already in OS11, than this is something for the Support to help you solve as it seems a problem with the platform upgrade version.

Cheers.

Thanks for the guidance. We already raised a ticket for support. I'll post the solution here.

Cheers


Solution

Our issue has been solved. For future reference hereby the solution. The reference path of the Newtonsoft property was incorrect. Most likely caused by installing the NuGet package. After we changed this to the correct path everything worked again as intended. 

 Path: C:\Program Files\OutSystems\Development Environment 11.0\Integration Studio\Newtonsoft.Json.dll

Jeffrey Meijer thank you so much for posting the solution.

That fixed our errors, but it's a little concerning that it happened at all. Our extensions had been working fine for months until we updated the Outsystems server - was I as a developer supposed to know to use the OS reference to NewtonSoft instead of the nuget package? Was this documented somewhere and I missed it? 

MichaelR wrote:

Jeffrey Meijer thank you so much for posting the solution.

That fixed our errors, but it's a little concerning that it happened at all. Our extensions had been working fine for months until we updated the Outsystems server - was I as a developer supposed to know to use the OS reference to NewtonSoft instead of the nuget package? Was this documented somewhere and I missed it? 

Haven't seen any documentation so far nor that anyone could know. As far as I know this is a problem that only occurs while upgrading the server version. We reported this to OutSystems a while ago, but it seems that it hasn't been solved yet.

How did you get into this property, is this in visual studio? I can't seem to find this in the extension.

mvp_badge
MVP

Nice that you found the solution (and thank you for sharing it with us) :)

Had the same problem with an existing extension and got almost to the same solution before seeing this post.

This was what I've done:

When editing the extension in Visual Studio, try including the Newtonsoft.Json.dll reference from the Integration Studio folder (eg.: C:\Program Files\OutSystems\Development Environment 11\Integration Studio) 


But after reading your comments, I've tried to check if creating a new extension would have any difference.

I seams that now, the reference is already included in Integration Studio.

When opening the code in Visual Studio the reference won't be there, but you will be able to reference the dll and use it, since the Newtonsoft.Json.dll will be in the bin folder of your extension solution.


Sérgio Dias escreveu:

Teve o mesmo problema com uma extensão existente e chegou quase à mesma solução antes de ver este post.

Foi o que eu fiz:

Ao editar a extensão no Visual Studio, tente incluir a referência Newtonsoft.Json.dll da pasta Integration Studio (por exemplo: C: \ Arquivos de Programas \ OutSystems \ Development Environment 11 \ Integration Studio) 


Mas, depois de ler seus comentários, tentei verificar se a criação de uma nova extensão teria alguma diferença.

Eu confirmo que agora, a referência já está incluída no Integration Studio.

Ao abrir o código no Visual Studio, a referência não estará lá, mas você poderá fazer referência à dll e usá-la, pois o Newtonsoft.Json.dll estará na pasta bin da sua solução de extensão.



Ola

Como ilustrar na imagem, com o botão direito do mouse clica sobre o arquivo "Newtonsoft.jason.dell", escolha a opção "Exclud from Extension", -> NET Integrated Development Environment, selecione o compilador IDE da sua preferência.

Para mais Informações  leia https://success.outsystems.com/Documentation/11/Reference/Integration_Studio/Integration_Studio_Menus/Edit_Menu/Options_Window

Hi everyone, 

I got the issue bellow when I try to publish the extension. I already worked around with some solution above but seem it doesn't work for me. There is anyone know what happen on it?. 

Project file contains ToolsVersion="12.0". This toolset may be unknown or missing, in which case you may be able to resolve this by installing the appropriate version of MSBuild, or the build may have been forced to a particular ToolsVersion for policy reasons. Treating the project as if it had ToolsVersion="4.0". For more information, please see http://go.microsoft.com/fwlink/?LinkId=291333.

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3268: The primary reference "OutSystems.HubEdition.RuntimePlatform" could not be resolved because it has an indirect dependency on the framework assembly "System.ValueTuple, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v4.6.1". To resolve this problem, either remove the reference "OutSystems.HubEdition.RuntimePlatform" or retarget your application to a framework version which contains "System.ValueTuple, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51". 

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3268: The primary reference "OutSystems.REST.API" could not be resolved because it has an indirect dependency on the framework assembly "System.ValueTuple, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v4.6.1". To resolve this problem, either remove the reference "OutSystems.REST.API" or retarget your application to a framework version which contains "System.ValueTuple, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51". 

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3268: The primary reference "OutSystems.SOAP.API" could not be resolved because it has an indirect dependency on the framework assembly "System.ValueTuple, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v4.6.1". To resolve this problem, either remove the reference "OutSystems.SOAP.API" or retarget your application to a framework version which contains "System.ValueTuple, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51". 

TwoFA_Azure.cs(4,29): error CS0234: The type or namespace name 'RuntimePlatform' does not exist in the namespace 'OutSystems.HubEdition' (are you missing an assembly reference?) 

TwoFA_Azure.cs(5,18): error CS0234: The type or namespace name 'RuntimePublic' does not exist in the namespace 'OutSystems' (are you missing an assembly reference?) 

Interface.cs(4,29): error CS0234: The type or namespace name 'RuntimePlatform' does not exist in the namespace 'OutSystems.HubEdition' (are you missing an assembly reference?) 

Structures.cs(8,29): error CS0234: The type or namespace name 'RuntimePlatform' does not exist in the namespace 'OutSystems.HubEdition' (are you missing an assembly reference?) 

Structures.cs(9,29): error CS0234: The type or namespace name 'RuntimePlatform' does not exist in the namespace 'OutSystems.HubEdition' (are you missing an assembly reference?) 

Entities.cs(8,29): error CS0234: The type or namespace name 'RuntimePlatform' does not exist in the namespace 'OutSystems.HubEdition' (are you missing an assembly reference?) 

Entities.cs(9,29): error CS0234: The type or namespace name 'RuntimePlatform' does not exist in the namespace 'OutSystems.HubEdition' (are you missing an assembly reference?) 

Records.cs(9,29): error CS0234: The type or namespace name 'RuntimePlatform' does not exist in the namespace 'OutSystems.HubEdition' (are you missing an assembly reference?) 

Records.cs(10,29): error CS0234: The type or namespace name 'RuntimePlatform' does not exist in the namespace 'OutSystems.HubEdition' (are you missing an assembly reference?) 

RecordLists.cs(9,29): error CS0234: The type or namespace name 'RuntimePlatform' does not exist in the namespace 'OutSystems.HubEdition' (are you missing an assembly reference?) 

RecordLists.cs(10,29): error CS0234: The type or namespace name 'RuntimePlatform' does not exist in the namespace 'OutSystems.HubEdition' (are you missing an assembly reference?) 

RecordLists.cs(12,29): error CS0234: The type or namespace name 'RuntimePlatform' does not exist in the namespace 'OutSystems.HubEdition' (are you missing an assembly reference?) 

I am having the same problem. 

Within Integration Studio, I started a new Extension and try to compile. It's giving me the same error like above. And then I used this "Edit Source Code .NET" to launch it in VS.NET. I can build in VS.NET but I am not to do it in Integration Studio, any advice? Thanks.


Hi herman-z,

In my case I tried to use the other laptop and that one use VS2017 instead of VS2019 and it worked well. I also don't know what happens on it. But you can try to use the other laptop to see how it is.

Thanks Hien. But I am referring to my coworker's machine which also has VS2019 and it's working fine. 

I downloaded the latest copy of OutSystems, started Integration Studio with a new Extension and still see the same error. 

Just for record-keeping, and seemingly because Outsystems hasn't fixed it, it's happening to me as well. 

Created an extension with Integration Studio and all I did was import some table views. No custom C# or .net code was included in this extension, let alone adding dependencies or anything of the sort.

On my desktop computer, this compiles perfectly and I can One Click Publish.

On my work laptop, I get the aforementioned, "NET Compilation. Project file contains ToolsVersion="12.0"." error message. 

I can't really understand the solutions proposed here since I did not do any customisation to the code or use any custom configurations, just Integration Studio out of the box, as such I believe it should be considered a bug.  


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.