I am getting a number of erros and warnings. Just installed Xamarin - visual-studio
I just started reading Charles Petzold's book Creating Mobile Apps with Xamarain.Forms but didn't get very far at all because I've hit a number of errors and warnings and am not sure how to fix them. I have tried uninstalling Visual Studios and reinstalling it to no avail.
I am uncertain what the issue is really because I am able to build and deploy the app to my Android device for either the Portable or Shared Xamarin.Forms app.I would just like to understand what these errors are exactly and how to fix them. If there is a resource somewhere that I can learn about them or if the answer is simple and straightforward I'd love to know.
Thanks much,
I included all the errors and warnings I got for each type of app below.
Starting with a blank Xamarin.Forms Portable app.
First dialogue error:
Package Installation Error
Could not add all required packages to the project.
The following packages failed to install from
'C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\: Microsoft.NETCore.UniversalWindowsPlatfrom.5.0.0
: Package restore failed.Rolling back pagage changes for 'App3.UWP'.
And in the Error List I have 12 Warnings
Severity Code Description Project File Line Suppression State
Warning IDE0006 Error encountered while loading the project.Some project features, such as full solution analysis for the failed project and projects that depend on it, have been disabled.App3 1 Active
Warning The "XamlCTask" task failed unexpectedly.
System.IO.FileNotFoundException: Could not find file 'c:\users\user\documents\visual studio 2015\Projects\App3\App3\App3\obj\Debug\App3.dll'.
File name: 'c:\users\user\documents\visual studio 2015\Projects\App3\App3\App3\obj\Debug\App3.dll'
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at Mono.Cecil.ModuleDefinition.GetFileStream(String fileName, FileMode mode, FileAccess access, FileShare share)
at Mono.Cecil.ModuleDefinition.ReadModule(String fileName, ReaderParameters parameters)
at Xamarin.Forms.Build.Tasks.XamlCTask.Compile()
at Xamarin.Forms.Build.Tasks.XamlCTask.Execute()
at Microsoft.Build.Framework.ITask.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() App3
Warning IDE0006 Error encountered while loading the project.Some project features, such as full solution analysis for the failed project and projects that depend on it, have been disabled.App3.Droid 1 Active
Warning Unexpected error - Please file a bug report at http://bugzilla.xamarin.com. Reason: System.IO.FileNotFoundException: Could not load assembly 'App3, Version=, Culture=neutral, PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile? App3.Droid
Warning Type universe cannot resolve assembly: System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.App3.UWP
Warning Cannot resolve Assembly or Windows Metadata file 'System.Runtime.dll' App3.UWP c:\users\user\documents\visual studio 2015\Projects\App3\App3\App3.UWP\App3.UWP.csproj
Warning IDE0006 Error encountered while loading the project.Some project features, such as full solution analysis for the failed project and projects that depend on it, have been disabled.App3.WinPhone 1 Active
Warning The "XamlCTask" task failed unexpectedly.
System.IO.FileNotFoundException: Could not find file 'c:\users\user\documents\visual studio 2015\Projects\App3\App3\App3.WinPhone\obj\Debug\App3.WinPhone.exe'.
File name: 'c:\users\user\documents\visual studio 2015\Projects\App3\App3\App3.WinPhone\obj\Debug\App3.WinPhone.exe'
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at Mono.Cecil.ModuleDefinition.GetFileStream(String fileName, FileMode mode, FileAccess access, FileShare share)
at Mono.Cecil.ModuleDefinition.ReadModule(String fileName, ReaderParameters parameters)
at Xamarin.Forms.Build.Tasks.XamlCTask.Compile()
at Xamarin.Forms.Build.Tasks.XamlCTask.Execute()
at Microsoft.Build.Framework.ITask.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() App3.WinPhone
Warning IDE0006 Error encountered while loading the project.Some project features, such as full solution analysis for the failed project and projects that depend on it, have been disabled.App3.Windows 1 Active
Warning The "XamlCTask" task failed unexpectedly.
System.IO.FileNotFoundException: Could not find file 'c:\users\user\documents\visual studio 2015\Projects\App3\App3\App3.Windows\obj\Debug\App3.Windows.exe'.
File name: 'c:\users\user\documents\visual studio 2015\Projects\App3\App3\App3.Windows\obj\Debug\App3.Windows.exe'
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at Mono.Cecil.ModuleDefinition.GetFileStream(String fileName, FileMode mode, FileAccess access, FileShare share)
at Mono.Cecil.ModuleDefinition.ReadModule(String fileName, ReaderParameters parameters)
at Xamarin.Forms.Build.Tasks.XamlCTask.Compile()
at Xamarin.Forms.Build.Tasks.XamlCTask.Execute()
at Microsoft.Build.Framework.ITask.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() App3.Windows
Warning IDE0006 Error encountered while loading the project.Some project features, such as full solution analysis for the failed project and projects that depend on it, have been disabled.App3.iOS 1 Active
Warning The "XamlCTask" task failed unexpectedly.
System.IO.FileNotFoundException: Could not find file 'c:\users\user\documents\visual studio 2015\Projects\App3\App3\App3.iOS\obj\iPhone\Debug\App3iOS.exe'.
File name: 'c:\users\user\documents\visual studio 2015\Projects\App3\App3\App3.iOS\obj\iPhone\Debug\App3iOS.exe'
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at Mono.Cecil.ModuleDefinition.GetFileStream(String fileName, FileMode mode, FileAccess access, FileShare share)
at Mono.Cecil.ModuleDefinition.ReadModule(String fileName, ReaderParameters parameters)
at Xamarin.Forms.Build.Tasks.XamlCTask.Compile()
at Xamarin.Forms.Build.Tasks.XamlCTask.Execute()
at Microsoft.Build.Framework.ITask.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() App3.iOS
And when trying to build the solution I get 14 Errors and 8 Warnings
Severity Code Description Project File Line Suppression State
Warning The "XamlCTask" task failed unexpectedly.
System.IO.FileNotFoundException: Could not find file 'c:\users\user\documents\visual studio 2015\Projects\App3\App3\App3.iOS\obj\iPhone\Debug\App3iOS.exe'.
File name: 'c:\users\user\documents\visual studio 2015\Projects\App3\App3\App3.iOS\obj\iPhone\Debug\App3iOS.exe'
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at Mono.Cecil.ModuleDefinition.GetFileStream(String fileName, FileMode mode, FileAccess access, FileShare share)
at Mono.Cecil.ModuleDefinition.ReadModule(String fileName, ReaderParameters parameters)
at Xamarin.Forms.Build.Tasks.XamlCTask.Compile()
at Xamarin.Forms.Build.Tasks.XamlCTask.Execute()
at Microsoft.Build.Framework.ITask.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() App3.iOS
Error Xamarin.Forms 2.0.0.6482 is not compatible with UAP, Version = v10.0 (win10-arm-aot). 0
Error Xamarin.Forms 2.0.0.6482 is not compatible with UAP, Version= v10.0 (win10-x64). 0
Error Xamarin.Forms 2.0.0.6482 is not compatible with UAP, Version= v10.0. 0
Error Some packages are not compatible with UAP, Version= v10.0 (win10-x86-aot). 0
Error Xamarin.Forms 2.0.0.6482 is not compatible with UAP, Version= v10.0 (win10-x86-aot). 0
Error Xamarin.Forms 2.0.0.6482 is not compatible with UAP, Version= v10.0 (win10-x86). 0
Error Some packages are not compatible with UAP, Version = v10.0 (win10-x64-aot). 0
Error Some packages are not compatible with UAP, Version = v10.0 (win10-arm-aot). 0
Error Some packages are not compatible with UAP, Version = v10.0 (win10-x64). 0
Error Some packages are not compatible with UAP, Version = v10.0 (win10-arm). 0
Error Some packages are not compatible with UAP, Version = v10.0 (win10-x86). 0
Error Xamarin.Forms 2.0.0.6482 is not compatible with UAP, Version= v10.0 (win10-arm). 0
Error Some packages are not compatible with UAP, Version = v10.0. 0
Error Xamarin.Forms 2.0.0.6482 is not compatible with UAP, Version= v10.0 (win10-x64-aot). 0
Warning IDE0006 Error encountered while loading the project.Some project features, such as full solution analysis for the failed project and projects that depend on it, have been disabled.App3 1 Active
Warning IDE0006 Error encountered while loading the project.Some project features, such as full solution analysis for the failed project and projects that depend on it, have been disabled.App3.Droid 1 Active
Warning Type universe cannot resolve assembly: System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.App3.UWP
Warning Cannot resolve Assembly or Windows Metadata file 'System.Runtime.dll' App3.UWP c:\users\user\documents\visual studio 2015\Projects\App3\App3\App3.UWP\App3.UWP.csproj
Warning IDE0006 Error encountered while loading the project.Some project features, such as full solution analysis for the failed project and projects that depend on it, have been disabled.App3.WinPhone 1 Active
Warning IDE0006 Error encountered while loading the project.Some project features, such as full solution analysis for the failed project and projects that depend on it, have been disabled.App3.Windows 1 Active
Warning IDE0006 Error encountered while loading the project.Some project features, such as full solution analysis for the failed project and projects that depend on it, have been disabled.App3.iOS 1 Active
I am able to debug/deploy the Xamarin.Froms Portable to my Android Device.
Also when I create a blank Xamarin.forms Shared app I get the dialog error:
A problem was encountered creating the sub project 'App4.UWP'. The project requires a platform SDK (UAP, Version=10.0.10240.0) that is not installed please visit the folllowing link for more information: http://go.microsft.com/fwlink/?prd=12514&pver=14.0&sbp=PlatformSDKMissing&plcid=0x409&o1=UAP,%20Version=10.0.10240.0
Entering this url into my browser I am told the DNS address could not be found.
When it is finished creating the project I have 6 Warnings:
Severity Code Description Project File Line Suppression State
Warning The referenced component 'System.ObjectModel' could not be found. App4.Droid
Warning The "XamlCTask" task failed unexpectedly.
System.IO.FileNotFoundException: Could not find file 'c:\users\user\documents\visual studio 2015\Projects\App4\App4\App4.Droid\obj\Debug\App4.Droid.dll'.
File name: 'c:\users\user\documents\visual studio 2015\Projects\App4\App4\App4.Droid\obj\Debug\App4.Droid.dll'
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at Mono.Cecil.ModuleDefinition.GetFileStream(String fileName, FileMode mode, FileAccess access, FileShare share)
at Mono.Cecil.ModuleDefinition.ReadModule(String fileName, ReaderParameters parameters)
at Xamarin.Forms.Build.Tasks.XamlCTask.Compile()
at Xamarin.Forms.Build.Tasks.XamlCTask.Execute()
at Microsoft.Build.Framework.ITask.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() App4.Droid
Warning The "XamlCTask" task failed unexpectedly.
System.IO.FileNotFoundException: Could not find file 'c:\users\user\documents\visual studio 2015\Projects\App4\App4\App4.WinPhone\obj\Debug\App4.WinPhone.exe'.
File name: 'c:\users\user\documents\visual studio 2015\Projects\App4\App4\App4.WinPhone\obj\Debug\App4.WinPhone.exe'
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at Mono.Cecil.ModuleDefinition.GetFileStream(String fileName, FileMode mode, FileAccess access, FileShare share)
at Mono.Cecil.ModuleDefinition.ReadModule(String fileName, ReaderParameters parameters)
at Xamarin.Forms.Build.Tasks.XamlCTask.Compile()
at Xamarin.Forms.Build.Tasks.XamlCTask.Execute()
at Microsoft.Build.Framework.ITask.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() App4.WinPhone
Warning IDE0006 Error encountered while loading the project.Some project features, such as full solution analysis for the failed project and projects that depend on it, have been disabled.App4.Windows 1 Active
Warning The "XamlCTask" task failed unexpectedly.
System.IO.FileNotFoundException: Could not find file 'c:\users\user\documents\visual studio 2015\Projects\App4\App4\App4.Windows\obj\Debug\App4.Windows.exe'.
File name: 'c:\users\user\documents\visual studio 2015\Projects\App4\App4\App4.Windows\obj\Debug\App4.Windows.exe'
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at Mono.Cecil.ModuleDefinition.GetFileStream(String fileName, FileMode mode, FileAccess access, FileShare share)
at Mono.Cecil.ModuleDefinition.ReadModule(String fileName, ReaderParameters parameters)
at Xamarin.Forms.Build.Tasks.XamlCTask.Compile()
at Xamarin.Forms.Build.Tasks.XamlCTask.Execute()
at Microsoft.Build.Framework.ITask.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() App4.Windows
When I build the solution I get 3 Warnings
Severity Code Description Project File Line Suppression State
Warning The "XamlCTask" task failed unexpectedly.
System.IO.FileNotFoundException: Could not find file 'c:\users\user\documents\visual studio 2015\Projects\App4\App4\App4.iOS\obj\iPhone\Debug\App4iOS.exe'.
File name: 'c:\users\user\documents\visual studio 2015\Projects\App4\App4\App4.iOS\obj\iPhone\Debug\App4iOS.exe'
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at Mono.Cecil.ModuleDefinition.GetFileStream(String fileName, FileMode mode, FileAccess access, FileShare share)
at Mono.Cecil.ModuleDefinition.ReadModule(String fileName, ReaderParameters parameters)
at Xamarin.Forms.Build.Tasks.XamlCTask.Compile()
at Xamarin.Forms.Build.Tasks.XamlCTask.Execute()
at Microsoft.Build.Framework.ITask.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() App4.iOS
Warning The referenced component 'System.ObjectModel' could not be found.App4.Droid
Warning IDE0006 Error encountered while loading the project.Some project features, such as full solution analysis for the failed project and projects that depend on it, have been disabled.App4.Windows 1 Active
I am able to build and debug/deploy the Xamarin.Forms Shared to my Android device.
So what do I need to do to resolve these warnings and errors?
I have some answers, and some ways forward, for these issues. First, it should be noted that these appear to be disparate issues, but I will answer each as I can.
First, for the errors that may occur after updating NuGet Packages, those can generally be solved by cleaning the project. So steps would be: After updating packages > close Visual Studio > Open Visual Studio > Clean Project > Build
For the XAMLC error, I have created a bug on Xamarin's bug tracking tool
For the IDE0006 error, I have also created a new bug
For the the following error:
'C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\: Microsoft.NETCore.UniversalWindowsPlatfrom.5.0.0
: Package restore failed.Rolling back pagage changes for 'App3.UWP'.
I've been unable to reproduce that error. But I will kep trying. As soon as I can, I will update this post.
Thanks!
By updating nuget, etc., I have gotten rid of all errors except the following when compiling the "Welcome to Xamarin Forms" template -
Severity Code Description Project File Line Suppression State
Warning The referenced component 'System.ObjectModel' could not be found.
Related
<DebugType>none</DebugType> leads to Xamarin App not compiling in Debug
In Visual Studio 2022 with a Xamarin project that works and builds going through the "release steps" from https://learn.microsoft.com/en-us/xamarin/android/deploy-test/release-prep/?tabs=windows leads to a project that will only build in release mode. In debug mode the below errors occur. AFTER HOURS of tracking it down I am able to fix the build by removing the following line from the project file in the section. <DebugType>none</DebugType> This is the error when in Debug mode with the above line in the project file. Build works just fine in release. Main error appears to be The "XamlCTask" task failed unexpectedly. Build started... 1>------ Build started: Project: TechClient.Mobile, Configuration: Debug Any CPU ------ 1>C:\Users\marti\.nuget\packages\xamarin.forms\5.0.0.2401\buildTransitive\Xamarin.Forms.targets(119,3): error MSB4018: The "XamlCTask" task failed unexpectedly. 1>C:\Users\marti\.nuget\packages\xamarin.forms\5.0.0.2401\buildTransitive\Xamarin.Forms.targets(119,3): error MSB4018: System.Runtime.Serialization.SerializationException: Unable to find assembly 'Mono.Cecil, Version=0.10.3.0, Culture=neutral, PublicKeyToken=50cebf1cceb9d05e'. 1>C:\Users\marti\.nuget\packages\xamarin.forms\5.0.0.2401\buildTransitive\Xamarin.Forms.targets(119,3): error MSB4018: 1>C:\Users\marti\.nuget\packages\xamarin.forms\5.0.0.2401\buildTransitive\Xamarin.Forms.targets(119,3): error MSB4018: Server stack trace: 1>C:\Users\marti\.nuget\packages\xamarin.forms\5.0.0.2401\buildTransitive\Xamarin.Forms.targets(119,3): error MSB4018: at System.Runtime.Serialization.Formatters.Binary.BinaryAssemblyInfo.GetAssembly() 1>C:\Users\marti\.nuget\packages\xamarin.forms\5.0.0.2401\buildTransitive\Xamarin.Forms.targets(119,3): error MSB4018: at System.Runtime.Serialization.Formatters.Binary.ObjectReader.GetType(BinaryAssemblyInfo assemblyInfo, String name) 1>C:\Users\marti\.nuget\packages\xamarin.forms\5.0.0.2401\buildTransitive\Xamarin.Forms.targets(119,3): error MSB4018: at System.Runtime.Serialization.Formatters.Binary.ObjectMap..ctor(String objectName, String[] memberNames, BinaryTypeEnum[] binaryTypeEnumA, Object[] typeInformationA, Int32[] memberAssemIds, ObjectReader objectReader, Int32 objectId, BinaryAssemblyInfo assemblyInfo, SizedArray assemIdToAssemblyTable) 1>C:\Users\marti\.nuget\packages\xamarin.forms\5.0.0.2401\buildTransitive\Xamarin.Forms.targets(119,3): error MSB4018: at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryObjectWithMapTyped record) 1>C:\Users\marti\.nuget\packages\xamarin.forms\5.0.0.2401\buildTransitive\Xamarin.Forms.targets(119,3): error MSB4018: at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run() 1>C:\Users\marti\.nuget\packages\xamarin.forms\5.0.0.2401\buildTransitive\Xamarin.Forms.targets(119,3): error MSB4018: at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage) 1>C:\Users\marti\.nuget\packages\xamarin.forms\5.0.0.2401\buildTransitive\Xamarin.Forms.targets(119,3): error MSB4018: at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage) 1>C:\Users\marti\.nuget\packages\xamarin.forms\5.0.0.2401\buildTransitive\Xamarin.Forms.targets(119,3): error MSB4018: at System.Runtime.Remoting.Channels.CrossAppDomainSerializer.DeserializeObject(MemoryStream stm) 1>C:\Users\marti\.nuget\packages\xamarin.forms\5.0.0.2401\buildTransitive\Xamarin.Forms.targets(119,3): error MSB4018: at System.Runtime.Remoting.Messaging.SmuggledMethodReturnMessage.FixupForNewAppDomain() 1>C:\Users\marti\.nuget\packages\xamarin.forms\5.0.0.2401\buildTransitive\Xamarin.Forms.targets(119,3): error MSB4018: at System.Runtime.Remoting.Channels.CrossAppDomainSink.SyncProcessMessage(IMessage reqMsg) 1>C:\Users\marti\.nuget\packages\xamarin.forms\5.0.0.2401\buildTransitive\Xamarin.Forms.targets(119,3): error MSB4018: 1>C:\Users\marti\.nuget\packages\xamarin.forms\5.0.0.2401\buildTransitive\Xamarin.Forms.targets(119,3): error MSB4018: Exception rethrown at [0]: 1>C:\Users\marti\.nuget\packages\xamarin.forms\5.0.0.2401\buildTransitive\Xamarin.Forms.targets(119,3): error MSB4018: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) 1>C:\Users\marti\.nuget\packages\xamarin.forms\5.0.0.2401\buildTransitive\Xamarin.Forms.targets(119,3): error MSB4018: at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) 1>C:\Users\marti\.nuget\packages\xamarin.forms\5.0.0.2401\buildTransitive\Xamarin.Forms.targets(119,3): error MSB4018: at Microsoft.Build.Framework.ITask.Execute() 1>C:\Users\marti\.nuget\packages\xamarin.forms\5.0.0.2401\buildTransitive\Xamarin.Forms.targets(119,3): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() 1>C:\Users\marti\.nuget\packages\xamarin.forms\5.0.0.2401\buildTransitive\Xamarin.Forms.targets(119,3): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() 1>Done building project "TechClient.Mobile.csproj" -- FAILED. Why was the "debug" line added and is it needed? What should I do about it to keep the security that the preparing a Xamarin for release document talks about? So far I have just been removing the none line when I want to debug and adding it back in for releases.
Why TeamCIty build fails with "because it is being used by another process", does it build parallel?
I have a TeamCity installed on my server and my .Net Core project occasionally fails with the following message. If TeamCity uses parallel build, then how can I disable it? Or how can I make this TeamCity build more stable? The code compiles on my dev machine without any issue, the code also compiles without any issue in Azure DevOps Build (a.k.a. Visual Studio Online). [22:06:31][build] /opt/dotnet/sdk/2.1.402/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(129,5): error MSB4018: The "GenerateDepsFile" task failed unexpectedly. [22:06:31][build] /opt/dotnet/sdk/2.1.402/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(129,5): error MSB4018: System.IO.IOException: The process cannot access the file '/home/tagent3/TeamCityBuildAgent/work/479321994f6f7261/.../Contracts.deps.json' because it is being used by another process. [22:06:31][build] /opt/dotnet/sdk/2.1.402/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(129,5): error MSB4018: at System.IO.FileStream.Init(FileMode mode, FileShare share) [22:06:31][build] /opt/dotnet/sdk/2.1.402/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(129,5): error MSB4018: at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) [22:06:31][build] /opt/dotnet/sdk/2.1.402/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(129,5): error MSB4018: at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize) [22:06:31][build] /opt/dotnet/sdk/2.1.402/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(129,5): error MSB4018: at System.IO.File.Create(String path) [22:06:31][build] /opt/dotnet/sdk/2.1.402/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(129,5): error MSB4018: at Microsoft.NET.Build.Tasks.GenerateDepsFile.ExecuteCore() [22:06:31][build] /opt/dotnet/sdk/2.1.402/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(129,5): error MSB4018: at Microsoft.NET.Build.Tasks.TaskBase.Execute() [22:06:31][build] /opt/dotnet/sdk/2.1.402/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(129,5): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [22:06:31][build] /opt/dotnet/sdk/2.1.402/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(129,5): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) [22:06:31]
You can add an MSBuild switch /m:1 (or /maxcpucount:1) It says it should default to 1, but I have also seen comments on threads saying adding the flag fixed some parallel build issues so perhaps it has changed. Docs here https://learn.microsoft.com/en-us/visualstudio/msbuild/msbuild-command-line-reference?view=vs-2017
I fixed this using argument verbosity normal level in Command Line Parameters: -v n
Failed to load file or assembly SpecFlow.Assist.Dynamic when running tests
I have a CodedUI Test project in Visual Studio 2013. After following instructions for integrating SpecFlow with the CodedUI API, I'm getting the following error in the FeatureSetup (Assembly binding logging was turned on) Test Name: TheWelcomeScreen Test FullName: (...)Feature.TheWelcomeScreen Test Source: c:\path\to\My.feature : line 6 Test Outcome: Failed Test Duration: 0:00:00 Result Message: Class Initialization method (...)Feature.FeatureSetup threw exception. System.IO.FileNotFoundException: System.IO.FileNotFoundException: Could not load file or assembly 'SpecFlow.Assist.Dynamic, Version=1.0.2.0, Culture=neutral' or one of its dependencies. The system cannot find the file specified. === Pre-bind state information === LOG: DisplayName = SpecFlow.Assist.Dynamic, Version=1.0.2.0, Culture=neutral (Partial) WRN: Partial binding information was supplied for an assembly: WRN: Assembly Name: SpecFlow.Assist.Dynamic, Version=1.0.2.0, Culture=neutral | Domain ID: 2 WRN: A partial bind occurs when only part of the assembly display name is provided. WRN: This might result in the binder loading an incorrect assembly. WRN: It is recommended to provide a fully specified textual identity for the assembly, WRN: that consists of the simple name, version, culture, and public key token. WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue. LOG: Appbase = file:///C:/Path/To/Current/TestResults/Directory/Out LOG: Initial PrivatePath = NULLCalling assembly : TechTalk.SpecFlow, Version=1.9.0.77, Culture=neutral, PublicKeyToken=0778194805d6db41. === LOG: This bind starts in default load context. LOG: Using application configuration file: C:\Path\To\Current\TestResults\Directory\Out\BWE.Tests.DLL.config LOG: Using host configuration file: LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config. LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind). LOG: Attempting download of new URL file:///C:/Path/To/Current/TestResults/Directory/Out/SpecFlow.Assist.Dynamic.DLL. LOG: Attempting download of new URL file:///C:/Path/To/Current/TestResults/Directory/Out/SpecFlow.Assist.Dynamic/SpecFlow.Assist.Dynamic.DLL. LOG: Attempting download of new URL file:///C:/Path/To/Current/TestResults/Directory/Out/SpecFlow.Assist.Dynamic.EXE. LOG: Attempting download of new URL file:///C:/Path/To/Current/TestResults/Directory/Out/SpecFlow.Assist.Dynamic/SpecFlow.Assist.Dynamic.EXE. Result StackTrace: at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) at System.Reflection.Assembly.Load(String assemblyString) at TechTalk.SpecFlow.Infrastructure.BindingAssemblyLoader.Load(String assemblyName) at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext() at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection) at TechTalk.SpecFlow.Infrastructure.TestRunnerFactory.Create(Assembly testAssembly) at TechTalk.SpecFlow.TestRunnerManager.CreateTestRunner(TestRunnerKey key) at TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(TestRunnerKey key) at TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(Assembly testAssembly, Boolean async) at TechTalk.SpecFlow.TestRunnerManager.GetTestRunner() at (...)Feature.FeatureSetup(TestContext testContext) in c:\path\to\My.feature.cs:line 0 My packages.config file for this solution: <?xml version="1.0" encoding="utf-8"?> <packages> <package id="AutoMapper" version="3.3.0" targetFramework="net40" /> <package id="CompareNETObjects" version="3.01.0.0" targetFramework="net40" /> <package id="ImpromptuInterface" version="6.2.2" targetFramework="net40" /> <package id="SpecFlow" version="1.9.0" targetFramework="net40" /> <package id="SpecFlow.Assist.Dynamic" version="1.0.2" targetFramework="net40" /> </packages> In the "Properties" for the SpecFlow.Assist.Dynamic DLL, the CopyLocal setting is set to true. After building the solution, the bin\Debug folder has SpecFlow.Assist.Dynamic.dll in it, but the folder for the current test run in the TestResults folder does not contain this DLL. It does contain these DLLs: The DLL for my project AutoMapper.dll KellermanSoftware.Compare-Net-Objects.dll TechTalk.SpecFlow.dll I've opened and closed Visual Studio, uninstalled and reinstalled the NuGet package, deleted the package sources locally, cleaned, rebuilt, rebooted, manually removed the bin\Debug folder and rebuilt... The list goes on. I'm still getting the same exception.
I don't know if it by design or not but MSTest does not deploy assemblies to the test folder unless at least one type from that assembly is used in the tests or code under test. So if you are instantiating types from and assembly by reflection then you'll run into issues. This issue has been noted by others. The simple solution is to do one of two things: Use a dummy type from the assembly in question in your tests. Just do a redendant var dummy = new TheType() Use a deployment item to copy the dll. This is less good I think as you might not get it deployed unless you are running a test which has the deployment item on it, which could mean you need to use the attribute several times, although I'm not 100% sure about that.
Template Error asp
I finally made my monodevelop to create an mvc3 razor project, but not everything works. When I try to create a view, it says it can not find a template. Also, when I try to create the project, it says this: System.IO.FileNotFoundException: Could not find file "/usr/lib/monodevelop/AddIns/MonoDevelop.AspNet.Mvc/Templates/Common/Index.cshtml". File name: '/usr/lib/monodevelop/AddIns/MonoDevelop.AspNet.Mvc/Templates/Common/Index.cshtml' at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) [0x0032f] in /build/mono/src/mono-3.2.3/mcs/class/corlib/System.IO/FileStream.cs:320 at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share) [0x00000] in /build/mono/src/mono-3.2.3/mcs/class/corlib/System.IO/FileStream.cs:132 at (wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare) at System.IO.File.OpenRead (System.String path) [0x00000] in /build/mono/src/mono-3.2.3/mcs/class/corlib/System.IO/File.cs:341 at System.IO.StreamReader..ctor (System.String path, System.Text.Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize) [0x00077] in /build/mono/src/mono-3.2.3/mcs/class/corlib/System.IO/StreamReader.cs:189 at System.IO.StreamReader..ctor (System.String path) [0x00000] in /build/mono/src/mono-3.2.3/mcs/class/corlib/System.IO/StreamReader.cs:165 at (wrapper remoting-invoke-with-check) System.IO.StreamReader:.ctor (string) at System.IO.File.ReadAllText (System.String path) [0x00000] in /build/mono/src/mono-3.2.3/mcs/class/corlib/System.IO/File.cs:537 at MonoDevelop.Ide.Templates.TextFileDescriptionTemplate.CreateContent (System.String language) [0x00027] in /build/monodevelop/src/monodevelop-4.0.13/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/TextFileDescriptionTemplate.cs:77 at MonoDevelop.Ide.Templates.SingleFileDescriptionTemplate.CreateContent (MonoDevelop.Projects.Project project, System.Collections.Generic.Dictionary`2 tags, System.String language) [0x00003] in /build/monodevelop/src/monodevelop-4.0.13/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs:311 at MonoDevelop.Ide.Templates.SingleFileDescriptionTemplate.CreateFileContent (MonoDevelop.Projects.SolutionItem policyParent, MonoDevelop.Projects.Project project, System.String language, System.String fileName, System.String identifier) [0x0001a] in /build/monodevelop/src/monodevelop-4.0.13/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs:264 at MonoDevelop.Ide.Templates.SingleFileDescriptionTemplate.SaveFile (MonoDevelop.Projects.SolutionItem policyParent, MonoDevelop.Projects.Project project, System.String language, System.String baseDirectory, System.String entryName) [0x0006b] in /build/monodevelop/src/monodevelop-4.0.13/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs:204 at MonoDevelop.Ide.Templates.SingleFileDescriptionTemplate.AddFileToProject (MonoDevelop.Projects.SolutionItem policyParent, MonoDevelop.Projects.Project project, System.String language, System.String directory, System.String name) [0x0000a] in /build/monodevelop/src/monodevelop-4.0.13/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs:113 at MonoDevelop.Ide.Templates.SingleFileDescriptionTemplate.AddToProject (MonoDevelop.Projects.SolutionItem policyParent, MonoDevelop.Projects.Project project, System.String language, System.String directory, System.String name) [0x00009] in /build/monodevelop/src/monodevelop-4.0.13/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs:108 at MonoDevelop.Ide.Templates.DirectoryTemplate.AddToProject (MonoDevelop.Projects.SolutionItem policyParent, MonoDevelop.Projects.Project project, System.String language, System.String directory, System.String name) [0x00068] in /build/monodevelop/src/monodevelop-4.0.13/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/DirectoryTemplate.cs:102 at MonoDevelop.Ide.Templates.DirectoryTemplate.AddToProject (MonoDevelop.Projects.SolutionItem policyParent, MonoDevelop.Projects.Project project, System.String language, System.String directory, System.String name) [0x00068] in /build/monodevelop/src/monodevelop-4.0.13/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/DirectoryTemplate.cs:102 at MonoDevelop.Ide.Templates.ProjectDescriptor.InitializeItem (MonoDevelop.Projects.SolutionItem policyParent, MonoDevelop.Projects.ProjectCreateInformation projectCreateInformation, System.String defaultLanguage, MonoDevelop.Projects.SolutionEntityItem item) [0x00224] in /build/monodevelop/src/monodevelop-4.0.13/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/ProjectDescriptor.cs:162 I have to create the view because it doesnt make one at the start. I tried to find a template for the razorview engine, but I can't find them.
I just had this problem myself. I'm using arch linux. After I got the error I uninstalled monodevelop, but not the dependencies. I then went to: https://github.com/mono/monodevelop and followed the instructions there. I used git clone https://github.com/mono/monodevelop.git cd monodevelop git submodule update --init --recursive ./configure --profile=stable ; make ; sudo make install I then went into monodevelop and created a MVC 3 project with razor and it snapped right open. No issues at all.
MVC3 project will not load dll properly aftering moving to win7 64-bit machine
IT recently moved me from a win xp 32-bit machine onto a Win 7 Enterprise 64-bit machine. After installing VS2010, MVC3 and various other components, I pulled the most current version of an MVC3 project I am working on. When I run the debugger, I get the Yellow Screen of Death, which references a dll from another project in my solution with the following error code: Could not load file or assembly 'Core' or one of its dependencies. Access is denied. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. And the Stack Trace: [FileLoadException: Could not load file or assembly 'Core' or one of its dependencies. Access is denied.] [FileLoadException: Could not load file or assembly 'Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Access is denied.] System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0 System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +39 System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks) +132 System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +144 System.Reflection.Assembly.Load(String assemblyString) +28 System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +46 [ConfigurationErrorsException: Could not load file or assembly 'Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Access is denied.] System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +618 System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +209 System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +130 System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +178 System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies() +94 System.Web.Compilation.BuildManager.CallPreStartInitMethods() +332 System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +677 [HttpException (0x80004005): Could not load file or assembly 'Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Access is denied.] System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +8972240 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +97 System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +258 It ran fine on the other machine, and will load on the server fine. Is there any security issues or anything I am overlooking, I am new to the win7 64 bit environment? Or is there something else I forgot to account for that is obvious to one of you? EDIT: I have also tried IIS Express 7.5 with the same end result. EDIT2: I resolved the issue for now by disabling impersonation in the web.config file while debugging locally, and adding the line to the release transform for deployment on the server.
Are you running the app pool under a dedicated account? That is, something other than Network Service? If so you need to add permissions to the asp.net temporary files directory.