3
votes

It's documented that U-SQL uses .net 4.5

https://docs.microsoft.com/en-us/azure/data-lake-analytics/data-lake-analytics-u-sql-programmability-guide#use-assembly-versioning

So to ensure that our own custom assemblies are built to that runtime.

When creating a "Class Library (For U-SQL Application)" via Azure Data Lake And Stream Analytics Tools version 2.3.4000.3 it's set to build to .net 4.5 which is fine, but it appears to be referencing e.g. Microsoft.Analytics.Interfaces which is built to 4.5.2 and fails to load.

I'm using Visual Studio 15.8.0, it feels like because it's from a general visual studio folder that it's been upgraded unbeknown to u-sql.

Severity Code Description Project File Line Suppression State Warning The primary reference "Microsoft.Analytics.Interfaces" could not be resolved because it was built against the ".NETFramework,Version=v4.5.2" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.5". MYUDFNAMEHERE C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets 2110

4

4 Answers

2
votes

This happened again with VS update (15.9.14 on July 9, 2019), all U-SQL projects and Analytics dll's changed the target framework from 4.5 to 4.7.2 but Azure Data Lake does not support 4.7.2. Or at least there is no documentation for it...

So we created our own package with Analytics.dll for both version so we can upgrade when Azure Data Lake will officially support 4.7.2 and higher.

1
votes

I've found if I remove the following references:

Microsoft.Analytics.Interfaces Microsoft.Analytics.Interfaces.Streaming Microsoft.Analytics.Types

And then add the nuget package: Microsoft.Azure.DataLake.USQL.Interfaces v1.1.0

It resolves the reference issue.

And checking the properties of the assemblies, the version is on both 10.2.2.0 so seems safe.

I do however still get:

Severity Code Description Project File Line Suppression State Warning The primary reference "C:\Users\USERNAME.nuget\packages\microsoft.azure.datalake.usql.interfaces\1.1.0\lib\net45\Microsoft.Analytics.UnitTest.dll" could not be resolved because it was built against the ".NETFramework,Version=v4.5.2" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.5". Tt.NetworkAnalytics.ServiceIndex.Usql.Udf C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets 2110

But I'm not concerned as this project isn't my unit testing project.

1
votes

Downgrade the package to old version 1.0.0 Microsoft.Azure.DataLake.USQL.Interface. This helped me to solve same issue.

1
votes

The best solution for me was to open the project file(s) in a text editor and modify the target framework version. This worked for both the U-SQL Project type and the U-SQL Database Project type.

At the time of this writing, I have modified from 4.5 to 4.5.2.

I'm not quite sure why Microsoft's U-SQL project templates are in such disarray.