Hi guys
I think I may have found a corner case in your build system.
I have an scons based build system that dynamically outputs msbuild files
based on project dependencies and then fires them at msbuild to do its
magic.
Since updating to the v4.1 alpha, I get a crash when trying to build an app
(build output below).
I think this is because some of my project references are resolved using a
modified AssemblySearchPaths variable rather than a project reference, which
is probably what ResolveLibraryProjectImports is expecting.
In this case, OssToolkitDroid.dll is in fact built to
Z:\oss\Main\install\Android\release\lib\Linn, not
Z:\oss\Main\build\Android\release\Topology which is where the msbuild file
that fails is run from.
Slightly unusual scenario, to be fair, as I'd imagine most projects out
there would use project references or manually add a reference in visual
studio and thus specify a hint path for the reference in the csproj file.
Injecting a hintpath for that reference does in fact fix the problem, albeit
at the cost of adding complexity to our build files.
However, I believe that extending AssemblySearchPaths is a valid way of
referencing assemblies and therefore the task should support this way of
doing things too.
What are your thoughts?
Cheers
Iain
Snippet of msbuild file:
<Import
Project="$(MSBuildExtensionsPath)\Novell\Novell.MonoDroid.CSharp.targets" />
<Target Name="BeforeResolveReferences">
<CreateProperty
Value="Z:\oss\Main\install\Android\release\lib\Linn;Z:\oss\Main\install\Android\release\lib;$(AssemblySearchPaths)">
<Output TaskParameter="Value" PropertyName="AssemblySearchPaths" />
</CreateProperty>
</Target>
<ItemGroup>
<Reference Include="System"/>
<Reference Include="System.Xml"/>
<Reference Include="System.Core"/>
<Reference Include="OssControl"/>
<Reference Include="OssCore"/>
<Reference Include="OssDidlLite"/>
<Reference Include="OssServices"/>
<Reference Include="OssSysLib"/>
<Reference Include="OssTopology"/>
<Reference Include="OssToolkitDroid"/>
<Reference Include="Mono.Android"/>
</ItemGroup>
Stacktrace from msbuild as follows:
"Z:\oss\Main\build\Android\release\Topology\LinnTopology.csproj" (default
target) (1) ->
(_ExtractLibraryProjectImports target) ->
C:\Program Files
(x86)\MSBuild\Novell\Novell.MonoDroid.Common.targets(378,2): error MSB4018:
The "ResolveLibraryProjectImports" task failed unexpectedly.\r
[Z:\oss\Main\build\Android\release\Topology\LinnTopology.csproj]
C:\Program Files
(x86)\MSBuild\Novell\Novell.MonoDroid.Common.targets(378,2): error MSB4018:
System.IO.FileNotFoundException: Could not find file
'Z:\oss\Main\build\Android\release\Topology\OssToolkitDroid.dll'.\r
[Z:\oss\Main\build\Andro
id\release\Topology\LinnTopology.csproj]
C:\Program Files
(x86)\MSBuild\Novell\Novell.MonoDroid.Common.targets(378,2): error MSB4018:
File name:
'Z:\oss\Main\build\Android\release\Topology\OssToolkitDroid.dll'\r
[Z:\oss\Main\build\Android\release\Topology\LinnTopology.csproj]
C:\Program Files
(x86)\MSBuild\Novell\Novell.MonoDroid.Common.targets(378,2): error MSB4018:
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)\r
[Z:\oss\Main\build\Android\release\Topology\LinnTopology.csproj]
C:\Program Files
(x86)\MSBuild\Novell\Novell.MonoDroid.Common.targets(378,2): error MSB4018:
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)\r
[Z:\oss\Main\build\Android\release\Topology\LinnTopology.csproj]
C:\Program Files
(x86)\MSBuild\Novell\Novell.MonoDroid.Common.targets(378,2): error MSB4018:
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access,
FileShare share)\r [Z:\oss\Main\build\Android\release\Topology\Li
nnTopology.csproj]
C:\Program Files
(x86)\MSBuild\Novell\Novell.MonoDroid.Common.targets(378,2): error MSB4018:
at Mono.Cecil.ModuleDefinition.GetFileStream(String fileName, FileMode mode,
FileAccess access, FileShare share)\r [Z:\oss\Main\build\Android\
release\Topology\LinnTopology.csproj]
C:\Program Files
(x86)\MSBuild\Novell\Novell.MonoDroid.Common.targets(378,2): error MSB4018:
at Mono.Cecil.ModuleDefinition.ReadModule(String fileName, ReaderParameters
parameters)\r [Z:\oss\Main\build\Android\release\Topology\LinnTopo
logy.csproj]
C:\Program Files
(x86)\MSBuild\Novell\Novell.MonoDroid.Common.targets(378,2): error MSB4018:
at Xamarin.Android.Tasks.ResolveLibraryProjectImports.Execute()\r
[Z:\oss\Main\build\Android\release\Topology\LinnTopology.csproj]
C:\Program Files
(x86)\MSBuild\Novell\Novell.MonoDroid.Common.targets(378,2): error MSB4018:
at
Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()\r
[Z:\oss\Main\build\Android\release\Topolog
y\LinnTopology.csproj]
C:\Program Files
(x86)\MSBuild\Novell\Novell.MonoDroid.Common.targets(378,2): error MSB4018:
at Microsoft.Build.Back
End.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost
taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost,
ItemBucket bucket, TaskExecutionMode howToExecuteTask, Boolean& taskResult)
[Z:\oss\Main\build\Android
\release\Topology\LinnTopology.csproj]
Stacktrace from visual studio if I open and try to build the generated
project:
Error 3 The "ResolveLibraryProjectImports" task failed unexpectedly.
System.IO.FileNotFoundException: Could not find file
'Z:\oss\Main\build\Android\release\Topology\OssToolkitDroid.dll'.
File name: 'Z:\oss\Main\build\Android\release\Topology\OssToolkitDroid.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)
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.Android.Tasks.ResolveLibraryProjectImports.Execute()
at
Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at
Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost
taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost,
ItemBucket bucket, TaskExecutionMode howToExecuteTask, Boolean& taskResult)
LinnTopology
--
View this message in context:
http://mono-for-android.1047100.n5.nabble.com/msbuild-crash-in-ResolveLibraryProjectImports-task-in-MFA-v4-1-tp5635151p5635151.html
Sent from the Mono for Android mailing list archive at Nabble.com.
_______________________________________________
Monodroid mailing list
Monodroid@lists.ximian.com
UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid