locked
error MSB4022: The result "" of evaluating the value "$(MicrosoftNETBuildExtensionsTasksAssembly)" RRS feed

  • Question

  • User101249 posted

    have to do some work on an older application. i am getting this error

    error MSB4022: The result "" of evaluating the value "$(MicrosoftNETBuildExtensionsTasksAssembly)" of the "AssemblyFile" attribute in element is not valid.

    a little annoying that every time xam is updated, it's going to break just about anything.

    this project is old and i have to use the mono runtime 4.8.1 (project uses fody). cleaning the solution just hangs using this runtime. i tried running it using a different runtime and i get either a fody exception or that weird error above

    i tried closing and restarting visual studio 2017. i also tried remove bin and obj folders

    any help would be nice, thanks in advance

    Thursday, May 2, 2019 2:11 PM

Answers

  • User368901 posted

    It could be a known issue :[msbuild] Fixes Microsoft.NET.Build.Extensions.Tasks.dll path #5492.

    Here is what you can try:

    Edit your .iOS.csproj file, removing the snippets below:

    <UsingTask
            TaskName="GetDependsOnNETStandard"
            Condition="'$(IsXBuild)' != 'true' and Exists('$(MSBuildExtensionsPath)\Microsoft\Microsoft.NET.Build.Extensions\tools\net46\Microsoft.NET.Build.Extensions.Tasks.dll')"
            AssemblyFile="$(MSBuildExtensionsPath)\Microsoft\Microsoft.NET.Build.Extensions\tools\net46\Microsoft.NET.Build.Extensions.Tasks.dll" />
            Condition="'$(IsXBuild)' != 'true'"
            AssemblyFile="$(MicrosoftNETBuildExtensionsTasksAssembly)" />
    

    And add below line within your project tags:

    <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    ...
    <Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
    ...
    </Project>
    

    If the problem persists, could you please post your .csproj file?

    Notes: you can edit your csproj file by right click your project in VS2017 -> unload project->right click again->Edit .iOS.csproj file.

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Monday, May 6, 2019 2:16 AM

All replies

  • User368901 posted

    It could be a known issue :[msbuild] Fixes Microsoft.NET.Build.Extensions.Tasks.dll path #5492.

    Here is what you can try:

    Edit your .iOS.csproj file, removing the snippets below:

    <UsingTask
            TaskName="GetDependsOnNETStandard"
            Condition="'$(IsXBuild)' != 'true' and Exists('$(MSBuildExtensionsPath)\Microsoft\Microsoft.NET.Build.Extensions\tools\net46\Microsoft.NET.Build.Extensions.Tasks.dll')"
            AssemblyFile="$(MSBuildExtensionsPath)\Microsoft\Microsoft.NET.Build.Extensions\tools\net46\Microsoft.NET.Build.Extensions.Tasks.dll" />
            Condition="'$(IsXBuild)' != 'true'"
            AssemblyFile="$(MicrosoftNETBuildExtensionsTasksAssembly)" />
    

    And add below line within your project tags:

    <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    ...
    <Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
    ...
    </Project>
    

    If the problem persists, could you please post your .csproj file?

    Notes: you can edit your csproj file by right click your project in VS2017 -> unload project->right click again->Edit .iOS.csproj file.

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Monday, May 6, 2019 2:16 AM
  • User101249 posted

    @ElvisXia thank you for taking the time to respond

    i am not sure if i explained it as best as i could...sounded pretty generic...however

    i was able to fix the issue (surprisingly). i updated the fody packages (fody, asycnerrorhandler.fody, and propertychanged.fody). i also updated the xamarin.forms packages in the pcl and the ios project. some cleaning, deleting bin and obj directories...and to my amazement...it now works

    i hope i didn't waste too much of your time.

    Monday, May 6, 2019 7:23 PM
  • User233823 posted

    So, on Mac Mojave after VS2019 (8.1.3) upgrade, I ran into the same issue. I tried above. Removed UsingTask from Xamarin.iOS.Common.targets and now getting below. Getting restore information for project /Users/user/Projects/sample4/sample4.Android/sample4.Android.csproj Value cannot be null. Parameter name: key So, I create a new blank project and it doesn't work! Great!!

    Saturday, June 29, 2019 4:55 PM
  • User101249 posted

    @"ManishJain.2477"

    hi Manish....i have come to realize that when dealing with this product (xamarin/visual studio)....that you have it install on more than one machine. in the past i worked with a contractor and he would always roll his eyes (we would work on the same project) when i told him i upgraded to the latest version of visual studio.

    at home i have an imac and a mac book pro. the laptop is always a release or two behind because every time i upgrade xamarin/visual studio....it just will not work and i have to spend days getting older applications to compile.

    no difference here. recently we had to change a freaking entry to a resource file. i upgraded visual studio and now, the app will not compile/clean. it just hangs when trying to clean and the detailed error message is: MonoDevelop.Core.Execution.RemoteProcessException: The operation failed due to an internal error: MSBuild operation failed"

    so now i know..not to upgrade xamarin on my laptop here or the work issued laptop. there have been times that i have to leave the office to go home and work because visual studio wouldn't compile my projects on the office computer after an upgrade.

    i remember how upset we were when the decision was made to move to ionic. it doesn't seem like such a bad idea now

    Sunday, June 30, 2019 9:27 PM
  • User13174 posted

    Although this is an old post, I recently got the same issue on my Mac with VS version 8.8.10 (build 2).

    After restarting VS and opening my Xamarin.Forms project I noticed a notification bar at the top stating that I needed to install the command-line toolkit. Probably since XCode was updated on my machine and VS needed to update it.

    After installing this and cleaning my project, things were set straight and I could manage packages, build etc.

    Hope this helps someone in the future.

    Friday, February 26, 2021 7:58 AM