urasandesu / Prig

Prig is a lightweight framework for test indirections in .NET Framework.
Other
117 stars 21 forks source link

Error when clicking Add Prig Assembly #78

Open gorgsenegger opened 8 years ago

gorgsenegger commented 8 years ago

I get the following error on a German Windows 7 Professional with an English edition of Visual Studio 2013 Premium Update 5 when I right click on a referenced assembly and choose Add Prig Assembly:


Ausnahme beim Festlegen von "CurrentDirectory": "Die Syntax für den Dateinamen, Verzeichnisnamen oder die Datenträgerbezeichnung ist falsch. " In C:\ProgramData\chocolatey\lib\Prig\tools\Import-PrigSetupSession.ps1:149 Zeichen:17


The English translation of the error message is something like Exception when setting CurrentDirectory: The syntax for the file name, directory name or the volume label is wrong.

I also get the same error when I then right click on a prig file and choose Edit Prig Indirection Settings.

urasandesu commented 8 years ago

I have never tested in German Windows, sorry :fearful: It seems that the error message indicates the problem that depends on the locale. I'll try checking.

urasandesu commented 7 years ago

Please accept my apology for the delay in reporting.

I have prepared German Windows and tried it(I could not get Windows 7 and Visual Studio 2013, so I tried the step in Windows 10 and Visual Studio 2015). However, I could not reproduce the issue. Could you give me additional information? For example,

By the way, I guess that the problem depends on the file path, but I cannot believe that $PWD returns invalid path, because the API is one of standard in PowerShell. If it is true, we probably should report that to MS PowerShell team, shouldn't we? :sweat_smile:

iforapsy commented 7 years ago

I have gotten this error when $PWD is set to a network path. In those cases, $PWD will be of the form Microsoft.PowerShell.Core\FileSystem::\\file-system-server\file-system. I moved forward by changing the line from

[System.Environment]::CurrentDirectory = $PWD

to

[System.Environment]::CurrentDirectory = Convert-Path $PWD

However, later in the script, it attempts to load a DLL from this path. This will fail because Windows prevents loading DLLs from network paths for security reasons.