Azure Pipeline Build Error

1 Answer 524 Views
General Discussions
Ryan
Top achievements
Rank 1
Iron
Iron
Ryan asked on 27 Apr 2021, 04:22 PM | edited on 27 Apr 2021, 06:26 PM

Hello,

My ASP.NET Web forms application compiles fine in Visual Studio 2019 however when the project is built with MSBuild in Azure Pipelines to automate some processes we are getting errors that the telerik web ui namespace cannot be loaded in because we are building against .NET 4.0 for this project and despite the Telerik.Web.UI.dll being a 4.0 built DLL it is complaining about some .NET 4.5 dependencies internally. How can I resolve this issue? If I switch this project to build with .NET 4.5 then these issues go away however we need to get the project working while compiling with .NET 4.0 for other reasons I cannot specify here.

Warning causing the errors at the bottom:

##[warning]D:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2123,5): Warning MSB3275: The primary reference "Telerik.Web.UI, Version=2020.1.219.40, Culture=neutral, PublicKeyToken=121fae78165ba3d4, processorArchitecture=MSIL" could not be resolved because it has an indirect dependency on the assembly "AWSSDK.S3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=885c28607f98e604" which was built against the ".NETFramework,Version=v4.5" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.0".

##[error]Artoo.Telerik.Web\Extensions\NumericTextBox.cs(11,55): Error CS0246: The type or namespace name 'RadNumericTextBox' could not be found (are you missing a using directive or an assembly reference?)


EDIT:

Adding this setting below to my csproj for this project removed this error but now I am getting an error saying Telerik.Web.UI is depending on System.Net.Http despite the fact that my project is .NET 4 and this assembly is for .NET 4.5 and above only.

<ResolveAssemblyReferenceIgnoreTargetFrameworkAttributeVersionMismatch>true</ResolveAssemblyReferenceIgnoreTargetFrameworkAttributeVersionMismatch>

New Error:

Warning MSB3268: The primary reference "Telerik.Web.UI, Version=2020.1.219.40, Culture=neutral, PublicKeyToken=121fae78165ba3d4, processorArchitecture=MSIL" could not be resolved because it has an indirect dependency on the framework assembly "System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v4.0". To resolve this problem, either remove the reference "Telerik.Web.UI, Version=2020.1.219.40, Culture=neutral, PublicKeyToken=121fae78165ba3d4, processorArchitecture=MSIL" or retarget your application to a framework version which contains "System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".

Thank you!

 

1 Answer, 1 is accepted

Sort by
0
Attila Antal
Telerik team
answered on 30 Apr 2021, 12:35 PM

Hi Ryan,

The problem you have described is rather environmental related than Telerik.

Problem

The primary reference "Telerik.Web.UI, Version=2020.1.219.40, Culture=neutral, PublicKeyToken=121fae78165ba3d4, processorArchitecture=MSIL" could not be resolved

Why?

because it has an indirect dependency on the assembly "AWSSDK.S3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=885c28607f98e604"

Conclusion

I can confirm that Telerik Assemblies do not reference nor have a dependency on the Amazon AWS SDK "AWSSDK.S3" assembly in the source code. Telerik Assemblies would not create such problems on their own.

I am assuming the MSBuild you have set in Azure would reference the "AWSSDK.S3" targeting the wrong .NET version. It could be that the web application references the AWS SDK.

You might want to consult this problem with Microsoft Azure experts to get a better understanding.

Regards,
Attila Antal
Progress Telerik

Тhe web is about to get a bit better! 

The Progress Hack-For-Good Challenge has started. Learn how to enter and make the web a worthier place: https://progress-worthyweb.devpost.com.

Tags
General Discussions
Asked by
Ryan
Top achievements
Rank 1
Iron
Iron
Answers by
Attila Antal
Telerik team
Share this question
or