aspnet / vsweb-publish

Web publish support for ASP.NET 5 in Visual Studio 2015
Other
33 stars 22 forks source link

Problem with cyrillic symbols in SourceManifest.xml #66

Open Igmat opened 8 years ago

Igmat commented 8 years ago

I'm using Win 10, and VS 2015 Community and have problems with publishing my ASP Core RC2 app to Azure, because my Windows username contains cyrillic symbols. Steps to reproduce:

  1. Login in windows using account with cyrillic symbols in username.
  2. Try to publish into Azure ASP Core RC2 app using built-in WebDeploy for VS 2015.
  3. If VS won't crash (I don't sure that this crash problem is linked to encoding, but it really often crashes in publish dialogue), you'll retrieve error like: C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Publishing.targets(406,5): Ошибка : ЋиЁЎЄ : ЌҐ¤®ЇгбвЁ¬л© §­ Є ¤«п гЄ § ­­®© Є®¤Ёа®ўЄЁ., бва®Є  1, Ї®§ЁжЁп 76. My small investigation:
  4. VS has problems with encoding, even in error messages and azure console.
  5. This error message could be translated in this way: Error: Invalid sign for the specified encoding, line 1 position 76.
  6. After hours of searching I've figured out that this error is about SourceManifest.xml
  7. My windows username contains cyrillic symbols, so path to local publish looks like C:\Users\Игорь\AppData\Local\Temp\PublishTemp\MyAwesomeProject70, but in SourceManifest.xml it looks like: C:\Users\�����\AppData\Local\Temp\PublishTemp\MyAwesomeProject70 and xml encoding is set to utf-8 which causes this error.
  8. I've tried to edit SourceManifest.xml manually, but it is regenerated each time I'm using publish dialogue from VS.
  9. I've tried to find option where I can set path for local output. I did not succeed - I guess I'm not to familiar with this tool.
  10. I've changed permission for publish-module.psm1 and applied small fix: From $xmlDocument = [xml]'<?xml version="1.0" encoding="utf-8"?><sitemanifest></sitemanifest>' To $xmlDocument = [xml]'<?xml version="1.0" encoding="windows-1251"?><sitemanifest></sitemanifest>' In line with number: 370 (as for last commits it is 607). And this small fix works for me, but I understand that it likely will cause problems for others. I hope this info will help you to fix this annoying bug.
vijayrkn commented 8 years ago

@Igmat Thanks for reporting this issue. Until this issue is fixed, you can set the publishOutputpath by setting this property in the pubxml.

In pubxml, you can add this and this should redirect the output to the specified folder <PublishOutputPathNoTrailingSlash>c:\PathtoOutputFolder</PublishOutputPathNoTrailingSlash>