704
Views
23
Comments
Solved
.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


Rank: #5867
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

mvp_badge
MVP
Rank: #56

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

Cheers!

Rank: #5867

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
Rank: #56

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.

Rank: #5867

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

mvp_badge
MVP
Rank: #56

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

XMLUtilsv1.xif

mvp_badge
MVP
Rank: #56

Sure. Good luck with that :)

mvp_badge
MVP
Rank: #5

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.

Rank: #5867

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
Rank: #5

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.

Rank: #5867
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

mvp_badge
MVP
Rank: #5

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

Staff
Rank: #1606

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.


Rank: #17257

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?) 

Rank: #36034

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.