Skip to content

Conversation

@jonathanpeppers
Copy link
Member

The idea is that you can run this tool while having a device/emulator
connected:

tools\msbuild-fuzzer\bin\Debug\msbuild-fuzzer.exe

When running the output looks something like:

DesignTimeBuild
RenameResource
RemoveClass
ChangePackageName
Install
Clean
RemoveClass
Install
Starting: Intent { cmp=com.foo.a82008ffe87dd442d92c47658b392fd55/md52d9cf6333b8e95e8683a477bc589eda5.MainActivity }
TouchRandomFile
Build

The process will stop if an MSBuild error occurs, you should get a
stacktrace and find MSBuild binlogs in:

bin\TestDebug\temp\Fuzzer

So far I have not found problems running this for a while on Mac.

I have found what appears to be Windows Defender locking a file on
Windows:

Xamarin.Forms.targets(91,3): error MSB4018: The "XamlCTask" task failed unexpectedly.
    System.IO.IOException: The process cannot access the file 'obj\Release\90\HelloForms.Android.dll' because it is being used by another process.

Server stack trace:
    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.ReadModule(String fileName, ReaderParameters parameters)
    at Mono.Cecil.AssemblyDefinition.ReadAssembly(String fileName, ReaderParameters parameters)
    at Xamarin.Forms.Build.Tasks.XamlCTask.Execute(IList`1& thrownExceptions)
    at Xamarin.Forms.Build.Tasks.XamlTask.Execute()
    at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
    at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [0]:
    at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
    at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
    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() [HelloForms.Android.csproj]

XamlCTask is part of Xamarin.Forms, so it isn't something we can
address in Xamarin.Android.

The idea is that you can run this tool while having a device/emulator
connected:

    tools\msbuild-fuzzer\bin\Debug\msbuild-fuzzer.exe

When running the output looks something like:

    DesignTimeBuild
    RenameResource
    RemoveClass
    ChangePackageName
    Install
    Clean
    RemoveClass
    Install
    Starting: Intent { cmp=com.foo.a82008ffe87dd442d92c47658b392fd55/md52d9cf6333b8e95e8683a477bc589eda5.MainActivity }
    TouchRandomFile
    Build

The process will stop if an MSBuild error occurs, you should get a
stacktrace and find MSBuild binlogs in:

    bin\TestDebug\temp\Fuzzer

So far I have not found problems running this for a while on Mac.

I have found what appears to be Windows Defender locking a file on
Windows:

    Xamarin.Forms.targets(91,3): error MSB4018: The "XamlCTask" task failed unexpectedly.
        System.IO.IOException: The process cannot access the file 'obj\Release\90\HelloForms.Android.dll' because it is being used by another process.

    Server stack trace:
        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.ReadModule(String fileName, ReaderParameters parameters)
        at Mono.Cecil.AssemblyDefinition.ReadAssembly(String fileName, ReaderParameters parameters)
        at Xamarin.Forms.Build.Tasks.XamlCTask.Execute(IList`1& thrownExceptions)
        at Xamarin.Forms.Build.Tasks.XamlTask.Execute()
        at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
        at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

    Exception rethrown at [0]:
        at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
        at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
        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() [HelloForms.Android.csproj]

`XamlCTask` is part of Xamarin.Forms, so it isn't something we can
address in Xamarin.Android.
aaaaaaaah, so nice
* alphabetize stuff
* System.Diagnostics.Process fixes
@jonpryor jonpryor merged commit 8e2c939 into dotnet:master Jun 21, 2019
jonpryor pushed a commit that referenced this pull request Aug 9, 2019
The idea is that you can run this tool while having a device/emulator
connected:

	tools\msbuild-fuzzer\bin\Debug\msbuild-fuzzer.exe

When running the output looks something like:

	DesignTimeBuild
	RenameResource
	RemoveClass
	ChangePackageName
	Install
	Clean
	RemoveClass
	Install
	Starting: Intent { cmp=com.foo.a82008ffe87dd442d92c47658b392fd55/md52d9cf6333b8e95e8683a477bc589eda5.MainActivity }
	TouchRandomFile
	Build

The process will stop if an MSBuild error occurs, and you should get
a stacktrace and find MSBuild binlogs in:

	bin\TestDebug\temp\Fuzzer

So far I have not found problems running this for a while on Mac.

I have found what appears to be Windows Defender locking a file on
Windows:

	Xamarin.Forms.targets(91,3): error MSB4018: The "XamlCTask" task failed unexpectedly.
	    System.IO.IOException: The process cannot access the file 'obj\Release\90\HelloForms.Android.dll' because it is being used by another process.

	Server stack trace:
	    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.ReadModule(String fileName, ReaderParameters parameters)
	    at Mono.Cecil.AssemblyDefinition.ReadAssembly(String fileName, ReaderParameters parameters)
	    at Xamarin.Forms.Build.Tasks.XamlCTask.Execute(IList`1& thrownExceptions)
	    at Xamarin.Forms.Build.Tasks.XamlTask.Execute()
	    at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
	    at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

	Exception rethrown at [0]:
	    at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
	    at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
	    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() [HelloForms.Android.csproj]

`<XamlCTask/>` is part of Xamarin.Forms, so it isn't something we can
address in Xamarin.Android.
@github-actions github-actions bot locked and limited conversation to collaborators Jan 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants