Recently added Visual Studio 2022 to M1 Macbook, so I tried to add new console app and NUnit class library project in this sample project
This TDDSample.UnitTest project's target framework is ".NET 6.0.6".
Everything is building successfully, but when I try to run this unit test project, it's showing the following error:
Testhost process exited with error:
Error: an assembly specified in the application dependencies manifest (TDDSample.UnitTest.deps.json) was not found:
package: 'NUnit', version: '3.13.3'
path: 'lib/netstandard2.0/nunit.framework.dll'
Please check the diagnostic logs for more information.
Testhost process exited with error:
Error: An assembly specified in the application dependencies manifest (TDDSample.UnitTest.deps.json) was not found:
package: 'NUnit', version: '3.13.3'
path: 'lib/netstandard2.0/nunit.framework.dll'.
Please check the diagnostic logs for more information.
After deleting the unit test project and recreating the unit test project, issue able to fix, seems like some project cache problem
I'm getting this error on a new Windows 10 Enterprise 2004 installation with the latest version of Visual Studio 2019 Enterprise installed. I am just trying to compile a stock .NET Core Console app; I get this error when I try to build the solution.
Severity Code Description Project File Line Suppression State
Error MSB4018 The "ResolvePackageAssets" task failed unexpectedly.
NuGet.Packaging.Core.PackagingException: Unable to find fallback package folder 'C:\Program Files
(x86)\Progress\ToolboxNugetPackages'.
at NuGet.Packaging.FallbackPackagePathResolver..ctor(String userPackageFolder, IEnumerable`1
fallbackPackageFolders)
at Microsoft.NET.Build.Tasks.NuGetPackageResolver.CreateResolver(IEnumerable`1 packageFolders)
at Microsoft.NET.Build.Tasks.NuGetPackageResolver.CreateResolver(LockFile lockFile)
at Microsoft.NET.Build.Tasks.ResolvePackageAssets.CacheWriter..ctor(ResolvePackageAssets task)
at
Microsoft.NET.Build.Tasks.ResolvePackageAssets.CacheReader.CreateReaderFromDisk(ResolvePackageAssets
task, Byte[] settingsHash)
at Microsoft.NET.Build.Tasks.ResolvePackageAssets.CacheReader..ctor(ResolvePackageAssets task)
at Microsoft.NET.Build.Tasks.ResolvePackageAssets.ReadItemGroups()
at Microsoft.NET.Build.Tasks.ResolvePackageAssets.ExecuteCore()
at Microsoft.NET.Build.Tasks.TaskBase.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() ConsoleApp1
C:\Program
Files\dotnet\sdk\3.1.301\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets
234
I found the problem - one of the installers for a WPF Control I have been using for a while has a bug where it now generates a nuget package cache for UI Controls; the Nuget package does exist and but it's in the wrong location. This specific bug is made manifest when one changes the default installation directory 'C:\Program Files (x86)\Progress'. To remedy the situation I copied the Nuget Cache to the expectant location and the problem went away.
I am new to Xamarin and have created a cross-platform project in Visual Studio 2017.
When I build that project, I am getting the below issue:
Severity: Error
Code: MSB4062
Description: The "Xamarin.Forms.Build.Tasks.XamlGTask" task could not be loaded from the assembly C:\Users\E6430\.nuget\packages\xamarin.forms\3.1.0.637273\build\netstandard2.0\Xamarin.Forms.Build.Tasks.dll. Could not load file or assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.
Project: TestApp
File: C:\Users\E6430\.nuget\packages\xamarin.forms\3.1.0.637273\build\netstandard2.0\Xamarin.Forms.targets
Line: 84
My NuGet is also get coloured with yellow colour.
Try this:
Unload project from the solution
Restart visual studio and open solution
Reload project
Rebuild
If persist:
Just run Visual studio as Administrator!
Ref: https://forums.xamarin.com/discussion/106784/error-with-latest-nuget-v2-5-0-77-xamarin-forms-build-tasks-gettasksabi-task-could-not-be-loaded
Has anyone managed to build Xamarin Android apps with VS2017 MSBuild and Jenkins?
On our build machine we can build via the command prompt but when building via Jenkins we get this error.
C:\Program Files (x86)\Microsoft Visual
Studio\2017\Professional\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(2371,2):
error MSB4062: The "Xamarin.Android.Tasks.GetAndroidPackageName" task
could not be loaded from the assembly C:\Program Files (x86)\Microsoft
Visual
Studio\2017\Professional\MSBuild\Xamarin\Android\Xamarin.Android.Build.Tasks.dll.
Method 'get_BuildEngine' in type 'Xamarin.Android.Tasks.AsyncTask'
from assembly 'Xamarin.Android.Build.Tasks, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null' does not have an implementation.
Confirm that the declaration is correct, that the assembly
and all its dependencies are available, and that the task contains a
public class that implements Microsoft.Build.Framework.ITask
We're using a Pipeline script with the following command. The same command works fine with VS2015 MSBuild and Jenkins.
bat "${msbuild15} /consoleloggerparameters:ErrorsOnly /v:quiet
/p:Configuration=ProductionRelease /p:Platform=\"Any CPU\" /t:Rebuild
Field\Product.Android.sln"
GetAndroidPackageName
This task will be failed majorly because your manifest file gets malframed, may be that manifest xml malframed, unncessary charecters might be present.
Remove them And your issue will be solved..
When I try to build the application I get an exception the following exception :
C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(681,3): error : Failed to resolve assembly: 'Java.Interop, Version=0.1.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065'
I tried cleaning the project and building it again, also updated the Xamarin.Forms packages but still with no luck.
A little overview on the stack trace :
2>C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(681,3): error : Failed to resolve assembly: 'Java.Interop, Version=0.1.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065'
2> Tool /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin/mtouch execution finished. (TaskId:153)
2> MTouch: 2016-07-05T14:27:15.8191415+05:30 - Finished (TaskId:153)
2> Output Item(s): _NativeLibrary= (TaskId:153)
2>Done executing task "MTouch" -- FAILED. (TaskId:153)
Has anyone received this error? I am running the latest Xamarin for Visual Studio.
As mentioned in the comments above by #SushiHangover Java.Interop.dll is from Xamarin.Android and I was getting an error in Xamarin.IOS.
I had a reference of Mono.Android in PCL which is always referenced in Xamarin.IOS so indirectly I was referencing dll of Xamarin.Android to Xamarin.IOS. Removing the reference from PCL solved my problem.
Step-by-step instructions on how to fish this one out, as it took me some time to find where the 'Android polluted' peace of code was.
Unload your Common code project
Open .csproj look for something like this
<ItemGroup>
<Reference Include="Mono.Android">
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v11.0\Mono.Android.dll</HintPath>
</Reference>
Delete this segment from csproj.
Load the project
Clean and rebuild the solution having iOS as startup Project, at this point, you will get a build error that will show which .cs file fails to build due to missing reference.
Go there and move the mechanism to an Android specific project.
As mentioned by #AkashAmin 'Mono.Android' referenced should not be there in PCL project.
But with this, also make sure that you have not added any 'Android' specific code in PCL project by adding 'using Android', if this was done then you need to remove this code by using 'Dependency Services', Click here
I had the same problem and when I removed the android.mono reference from pcl project it worked fine.
I think it happens because we are building project in ios and it doesn't have any android libraries
Platform specific code within the Shared Project will cause iOS compiler to attempt to use the platform specific assemblies when compiling.
In my case, I had a reference within my Shared Project's code, within the "using" statements, which was causing iOS to attempt to link to Android specific assemblies.
Removing the code from the Shared Project allowed for successful compiling of the project.
Just in case, I got this error from working with ReSharper on VS2013 (https://bugzilla.xamarin.com/show_bug.cgi?id=41627).
What I did was use the Workaround to explicitly add java.interop.dll assembly to my project. This problem doesn't affect Build so you can deploy first and VS will download java.interop to your app's obj\Debug\linksrc folder, which you can reference...
You need to check your PLC project on Android link. In PLC project ctrl+f and lets go find "Android" and delete it.