Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
1. Create a new Windows user account that contains "@" such as "N@t".
2. Install Mono for Android.
3. Try to compile application and get error
Error CS0103: The name 'Resource' does not exist in the current context (CS0103)
and the Resource.Designer.cs file is empty bar the namespace.
Previous to 4.0, the error looked like the follow;
C:\Program Files\MSBuild\Novell\Novell.MonoDroid.Common.targets(2,2): Error MSB4018: The "GenerateResourceDesigner" task failed unexpectedly.
System.IO.FileNotFoundException: Could not find file 'C:\Users\m@l@k\AppData\Local\Temp\ikmkclxv.g1f\R.java'.
File name: 'C:\Users\m@l@k\AppData\Local\Temp\ikmkclxv.g1f\R.java'
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, Int32 bufferSize, FileOptions options)
at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize)
at System.IO.StreamReader..ctor(String path)
at System.IO.File.OpenText(String path)
at Xamarin.Android.Tasks.JavaResourceParser.Parse(String file, Dictionary`2 resourceMap)
at Microsoft.Build.BuildEngine.TaskEngine.ExecuteInstantiatedTask(EngineProxy engineProxy, ItemBucket bucket, TaskExecutionMode howToExecuteTask, ITask task, Boolean& taskResult) (MSB4018) (Andy)
My guess is if you turn on verbose logging, you will find an error earlier where the error is that aapt.exe errors out. If so, I don't know if we'll be able to coerce Google's aapt.exe to accept a path with a @ in it.
Chris, does this have to be a user? or is it just a file path with an @ in it?
i've tried the latter and it works without any problems.
Do we know which version of Windows the issue was reported on? I've tried on Windows 7.
Fixed in master/ebedf0a505
This turned out to be an issue with the way Visual Studio creates
projects if the user name contains a @ character. Rather than
creating correct relative paths for files such as
It creates paths like
..\..\..\n@n\Documents\Visual Studio 2010\Projects\Test\Resources\Values\Strings.xml
This in turn caused the Resources to be copied into a directory which is not obj/$(Configuration)/res which results in them not being included in the build.
The fix is to expand the resource path to be the full path and then
turn it back into the expected local relative path using the Project
Directory value from MSBuild.