Bug 23638 - Microsoft.Common.targets doesn't support special characters
Summary: Microsoft.Common.targets doesn't support special characters
Status: CONFIRMED
Alias: None
Product: Tools
Classification: Mono
Component: xbuild ()
Version: master
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-10-06 05:33 UTC by peter
Modified: 2017-09-04 21:25 UTC (History)
8 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and 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 Links.

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 for Bug 23638 on GitHub or Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: GitHub Markdown or Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
CONFIRMED

Description peter 2014-10-06 05:33:53 UTC
/Library/Frameworks/Mono.framework/Versions/3.10.0/lib/mono/4.5/Microsoft.Common.targets: Error: Error executing task GenerateResource: Access to the path '/Users/someuser/Development' is denied. (somereference)

I'm using '/Users/someuser/Development#/' as a root developer directory, which worked with the previous versions.
Comment 1 Ram Chandra 2014-10-06 06:45:12 UTC
I have checked this issue but I am unable to reproduce this issue.

Steps I followed:

1. Create a folder with the "Development#" name in following location
      "/Users/{User-Name}/"

2. Create a "Console Application" in Xamarin Studio above location i.e. "/Users/{User-Name}/"
3. Build and debug the application.

Screencast: http://www.screencast.com/t/HqwqqG6V
 
Could you please provide build output and build information. So that we can reproduce this issue at our end. You can get build output and build information from following locations:

1. Build Output:  View=> Pads => Errors (copy full build output and paste in any text file and attached with your comment).

2. Build Information:  Xamarin Studio => About Xamarin Studio => Show Details => Copy Informations.

Please let me know If I am missing something?

Environment Info

=== Xamarin Studio ===

Version 5.5 (build 227)
Installation UUID: 6ea47b0d-1852-4aaf-808d-373ff0a5002b
Runtime:
	Mono 3.10.0 ((detached/633e444)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 310000020

=== Apple Developer Tools ===

Xcode 6.0.1 (6528)
Build 6A317

=== Xamarin.Mac ===

Version: 1.10.0.18 (Business Edition)

=== Xamarin.Android ===

Version: 4.18.0 (Business Edition)
Android SDK: /Users/jatin66/Desktop/Backup/android-sdk-macosx
	Supported Android versions:
		1.6   (API level 4)
		2.1   (API level 7)
		2.2   (API level 8)
		2.3   (API level 10)
		3.0   (API level 11)
		3.1   (API level 12)
		3.2   (API level 13)
		4.0   (API level 14)
		4.0.3 (API level 15)
		4.1   (API level 16)
		4.2   (API level 17)
		4.3   (API level 18)
		4.4   (API level 19)
Java SDK: /usr
java version "1.7.0_65"
Java(TM) SE Runtime Environment (build 1.7.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)

=== Xamarin.iOS ===

Version: 8.2.0.196 (Business Edition)
Hash: c6bcfc8
Branch: 
Build date: 2014-10-05 21:42:57-0400

=== Build Information ===

Release ID: 505000227
Git revision: 7b721eeec7a2fa4c4f4de0ecd2aed4dc25edac95
Build date: 2014-10-02 15:53:38-04
Xamarin addins: 99ed56b428b31eba1efaace4d82188d6f334e6ca

=== Operating System ===

Mac OS X 10.9.5
Darwin Jatin66s-iMac.local 13.4.0 Darwin Kernel Version 13.4.0
    Sun Aug 17 19:50:11 PDT 2014
    root:xnu-2422.115.4~1/RELEASE_X86_64 x86_64
Comment 2 peter 2014-10-22 07:25:23 UTC
I think I know what's happening, it's seems only affects the resources with task 'PublicResXFileCodeGenerator'.

Can you try reproduce or should I attach a sample project?

Steps :

1. Open up any project.
2. Add a 'Resources.resx' with 'Resources.Designer.cs' inside it.
3. Set Resources.resx to 'EmbeddedResource'
4. Set Resources.resx task to 'PublicResXFileCodeGenerator'
5. Set Resources.resx to 'Do not copy'

6. After compile before deploy you will see 

'/Library/Frameworks/Mono.framework/Versions/3.10.0/lib/mono/4.5/Microsoft.Common.targets: Error: Error executing task GenerateResource: Access to the path '/Users/someuser/somepath' is denied. (someproject)'

( and this case somepath physically is /Users/someuser/somepath#/development )
Comment 3 peter 2014-10-30 08:15:32 UTC
I think the steps above are pretty accurate.
Comment 4 Ram Chandra 2014-10-30 13:20:44 UTC
Thanks for the steps Peter.

With the help of steps mentioned in comment 2, I am able to reproduce this issue. 

When I create "Android Application" in the directory which contains "#" symbol (in my case "Development#") I observed that I am getting following error when I try to build the solution.

"/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets: Error: Error executing task GetAndroidPackageName: Could not find file "/Users/jatin66/Desktop/Development". "

Screencast: http://www.screencast.com/t/XtBSlt5N

Build Info : https://gist.github.com/saurabh360/c5c80f8d45d3607211a6

Environment Info:

=== Xamarin Studio ===

Version 5.5.3 (build 6)
Installation UUID: 6ea47b0d-1852-4aaf-808d-373ff0a5002b
Runtime:
	Mono 3.10.0 ((detached/e204655)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 310000023

=== Apple Developer Tools ===

Xcode 6.0.1 (6528)
Build 6A317

=== Xamarin.Mac ===

Version: 1.10.0.18 (Business Edition)

=== Xamarin.Android ===

Version: 4.18.0 (Business Edition)
Android SDK: /Users/jatin66/Desktop/Backup/android-sdk-macosx
	Supported Android versions:
		1.6   (API level 4)
		2.1   (API level 7)
		2.2   (API level 8)
		2.3   (API level 10)
		3.0   (API level 11)
		3.1   (API level 12)
		3.2   (API level 13)
		4.0   (API level 14)
		4.0.3 (API level 15)
		4.1   (API level 16)
		4.2   (API level 17)
		4.3   (API level 18)
		4.4   (API level 19)
Java SDK: /usr
java version "1.7.0_65"
Java(TM) SE Runtime Environment (build 1.7.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)

=== Xamarin.iOS ===

Version: 8.4.0.15 (Business Edition)
Hash: 08968c4
Branch: 
Build date: 2014-10-20 21:48:06-0400

=== Build Information ===

Release ID: 505030006
Git revision: fbe3e9453daf6a3bb9a9709ed22bec35f7c9056b
Build date: 2014-10-23 13:08:38-04
Xamarin addins: e44add2b39de4dd57c0742bb2e620dfad84c64c6

=== Operating System ===

Mac OS X 10.10.0
Darwin Jatin66s-iMac.local 14.0.0 Darwin Kernel Version 14.0.0
    Fri Sep 19 00:26:44 PDT 2014
    root:xnu-2782.1.97~2/RELEASE_X86_64 x86_64
Comment 5 Kai-Mikael Jää-Aro 2015-08-30 08:00:50 UTC
I also ran into what seems to be the same issue.  I have the program below in my directory ~/src/C#/:

using System;
using System.Xml.XPath;

public class XMLRead
{
  public static void Main(String[] args)
  {
    
    XPathDocument document = new XPathDocument("books.xml");
    XPathNavigator navigator = document.CreateNavigator();
    XPathNodeIterator nodes = navigator.Select("/bookstore/book");

    while(nodes.MoveNext())
      {
        Console.WriteLine(nodes.Current.Name);
      }
  }
}



Running it results in the error below. 

Unhandled Exception:
System.IO.FileNotFoundException: Could not find file "/Users/shkljo14/src/C".
File name: '/Users/shkljo14/src/C'
  at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) [0x00000] in <filename unknown>:0 
  at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share) [0x00000] in <filename unknown>:0 
  at (wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare)
  at System.Xml.XmlUrlResolver.GetEntity (System.Uri absoluteUri, System.String role, System.Type ofObjectToReturn) [0x00000] in <filename unknown>:0 
  at Mono.Xml2.XmlTextReader.GetStreamFromUrl (System.String url, System.String& absoluteUriString) [0x00000] in <filename unknown>:0 
  at Mono.Xml2.XmlTextReader.ReadTextReader (Int32 remained) [0x00000] in <filename unknown>:0 
  at Mono.Xml2.XmlTextReader.PeekChar () [0x00000] in <filename unknown>:0 
  at Mono.Xml2.XmlTextReader.ReadContent () [0x00000] in <filename unknown>:0 
  at Mono.Xml2.XmlTextReader.Read () [0x00000] in <filename unknown>:0 
  at System.Xml.XmlTextReader.Read () [0x00000] in <filename unknown>:0 
  at Mono.Xml.EntityResolvingXmlReader.Read () [0x00000] in <filename unknown>:0 
  at Mono.Xml.DTDValidatingReader.ReadContent () [0x00000] in <filename unknown>:0 
  at Mono.Xml.DTDValidatingReader.Read () [0x00000] in <filename unknown>:0 
  at Mono.Xml.Schema.XsdValidatingReader.Read () [0x00000] in <filename unknown>:0 
  at System.Xml.XmlValidatingReader.Read () [0x00000] in <filename unknown>:0 
  at Mono.Xml.XPath.DTMXPathDocumentBuilder2.Compile () [0x00000] in <filename unknown>:0 
  at Mono.Xml.XPath.DTMXPathDocumentBuilder2.Init (System.Xml.XmlReader reader, XmlSpace space, Int32 defaultCapacity) [0x00000] in <filename unknown>:0 
  at Mono.Xml.XPath.DTMXPathDocumentBuilder2..ctor (System.Xml.XmlReader reader, XmlSpace space, Int32 defaultCapacity) [0x00000] in <filename unknown>:0 
  at Mono.Xml.XPath.DTMXPathDocumentBuilder2..ctor (System.Xml.XmlReader reader, XmlSpace space) [0x00000] in <filename unknown>:0 
  at System.Xml.XPath.XPathDocument.Initialize (System.Xml.XmlReader reader, XmlSpace space) [0x00000] in <filename unknown>:0 
  at System.Xml.XPath.XPathDocument..ctor (System.String uri, XmlSpace space) [0x00000] in <filename unknown>:0 
  at System.Xml.XPath.XPathDocument..ctor (System.String uri) [0x00000] in <filename unknown>:0 
  at XMLRead.Main (System.String[] args) [0x00000] in <filename unknown>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.IO.FileNotFoundException: Could not find file "/Users/shkljo14/src/C".
File name: '/Users/shkljo14/src/C'
  at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) [0x00000] in <filename unknown>:0 
  at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share) [0x00000] in <filename unknown>:0 
  at (wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare)
  at System.Xml.XmlUrlResolver.GetEntity (System.Uri absoluteUri, System.String role, System.Type ofObjectToReturn) [0x00000] in <filename unknown>:0 
  at Mono.Xml2.XmlTextReader.GetStreamFromUrl (System.String url, System.String& absoluteUriString) [0x00000] in <filename unknown>:0 
  at Mono.Xml2.XmlTextReader.ReadTextReader (Int32 remained) [0x00000] in <filename unknown>:0 
  at Mono.Xml2.XmlTextReader.PeekChar () [0x00000] in <filename unknown>:0 
  at Mono.Xml2.XmlTextReader.ReadContent () [0x00000] in <filename unknown>:0 
  at Mono.Xml2.XmlTextReader.Read () [0x00000] in <filename unknown>:0 
  at System.Xml.XmlTextReader.Read () [0x00000] in <filename unknown>:0 
  at Mono.Xml.EntityResolvingXmlReader.Read () [0x00000] in <filename unknown>:0 
  at Mono.Xml.DTDValidatingReader.ReadContent () [0x00000] in <filename unknown>:0 
  at Mono.Xml.DTDValidatingReader.Read () [0x00000] in <filename unknown>:0 
  at Mono.Xml.Schema.XsdValidatingReader.Read () [0x00000] in <filename unknown>:0 
  at System.Xml.XmlValidatingReader.Read () [0x00000] in <filename unknown>:0 
  at Mono.Xml.XPath.DTMXPathDocumentBuilder2.Compile () [0x00000] in <filename unknown>:0 
  at Mono.Xml.XPath.DTMXPathDocumentBuilder2.Init (System.Xml.XmlReader reader, XmlSpace space, Int32 defaultCapacity) [0x00000] in <filename unknown>:0 
  at Mono.Xml.XPath.DTMXPathDocumentBuilder2..ctor (System.Xml.XmlReader reader, XmlSpace space, Int32 defaultCapacity) [0x00000] in <filename unknown>:0 
  at Mono.Xml.XPath.DTMXPathDocumentBuilder2..ctor (System.Xml.XmlReader reader, XmlSpace space) [0x00000] in <filename unknown>:0 
  at System.Xml.XPath.XPathDocument.Initialize (System.Xml.XmlReader reader, XmlSpace space) [0x00000] in <filename unknown>:0 
  at System.Xml.XPath.XPathDocument..ctor (System.String uri, XmlSpace space) [0x00000] in <filename unknown>:0 
  at System.Xml.XPath.XPathDocument..ctor (System.String uri) [0x00000] in <filename unknown>:0 
  at XMLRead.Main (System.String[] args) [0x00000] in <filename unknown>:0 


Mono JIT compiler version 4.0.3 ((detached/d6946b4 Wed Jul 29 14:46:23 EDT 2015)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
	TLS:           normal
	SIGSEGV:       altstack
	Notification:  kqueue
	Architecture:  x86
	Disabled:      none
	Misc:          softdebug 
	LLVM:          yes(3.6.0svn-mono-(detached/a173357)
	GC:            sgen


Darwin KaisMBPro.lan 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64