U-sql referenced assembly built with 4.5.1? Whereas documented 4.5 is needed
Opened this issue · 11 comments
It's documented that U-SQL uses .net 4.5
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
(Originally posted here, but cross posting in case it's a bug / edge case with recent visual studio updates https://stackoverflow.com/questions/51878732/u-sql-referenced-assembly-built-with-4-5-1-whereas-documented-4-5-is-needed)
I've added a workaround to the stackoverflow post if anyone's interested. https://stackoverflow.com/a/51879203/141022
The best solution for me was to open the project file and modify the target framework version.
I'm not quite sure why Microsoft's U-SQL project templates are in such disarray.
For me...
VS 2017 15.9.7
Data Lake Tools 2.3.7000.1
Creating a brand new USQL class library project gives you a project that targets net45 but references assemblies targetting net452. It fails to build.
Updating the class library to target net452 causes the build to succeed, but any USQL / USQL Database projects using the class library project will fail to build.
The solution for me was to open USQL/USQL Database project in editor and change target framework version from NET45 to NET452.
The big question I have is, why do all of these projects target NET45 in the latest tools, when the infrastructure on Azure is running net452?
And why does the ClassLib project template reference NET452 assemblies when it itself doesn't target NET452?
You're welcome.
By the way, I just spent a sprint evaluating U-SQL.
I have a fairly large list of reasons I'm recommending we avoid it for now, much of which has to do with frustrating tooling in visual studio.
If you are interested in some constructive criticism I'm happy to help.
Happy to. I'll edit my findings for your team and send within a day or two.
Sent.