0

Hello I am getting an error the Project file Not getting If Project File written in Japanese. Like Here is my File Path "C:\Users\rmrud\source\Workspaces\Workspace2\HAL9\v3_07\指示せん印刷\指示せん印刷\指示せん印刷.csproj" In this location, csproj file exists. I run a batch file to build this csproj a C# project but I got this error "error MSB1009: Project file does not exist"......

And in the console, I got that C:\Users\rmrud\source\Workspaces\Workspace2\HAL9\v3_07\謖・、コ縺帙s蜊ー蛻キ\謖・、コ縺帙s蜊ー蛻キ\謖・、コ縺帙s蜊ー蛻キ.csproj Here you can see in the batch file what I wrote the file path changed The text has been changed. Here is my batch file code

  set rootPath=C:\Users\rmrud\source\Workspaces\Workspace2
  set basePath3=%rootPath%\HAL9
  set filename=%rootPath%\buildLog\%yyyy%%mm%%dd%%hh%%mm%%ss%.log
  set csproj指示せん印刷=%basePath3%\v3_07\指示せん印刷\指示せん印刷\指示せん印刷.csproj
  set msbuild_new="C:\Program Files (x86)\Microsoft Visual 
  Studio\2019\Enterprise\MSBuild\Current\Bin\MSBuild.exe"

  mkdir %rootPath%\buildLog
  @echo %csproj指示せん印刷%
  C:
  cd C:\
  cd %basePath3%
  tf get
  if errorlevel 1 goto ON_EXIT

 dotnet build %csproj指示せん印刷% /t:%buildCmd% /p:Configuration=Release /fl 
  /flp:logfile=%filename%;verbosity=diagnostic
 if errorlevel 1 goto ON_EXIT

I used this batch file code to run this and the main problem is in the varible and line of Batch file "set csproj指示せん印刷=%basePath3%\v3_07\指示せん印刷\指示せん印刷\指示せん印刷.csproj" in the file it changes in runtime as I console it "C:\Users\rmrud\source\Workspaces\Workspace2\HAL9\v3_07\謖・、コ縺帙s蜊ー蛻キ\謖・、コ縺帙s蜊ー蛻キ\謖・、コ縺帙s蜊ー蛻キ.csproj" 2 are different . What operation and settings I have to change. I think it is a unicode related problem . Thanks in advance.

Rifat Murtuza
  • 1,151
  • 2
  • 7
  • 15
  • Actually, the project is C# based project and as you can see set msbuild_new="C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\MSBuild.exe" – Rifat Murtuza Mar 04 '21 at 01:19
  • okay I remove C# tag – Rifat Murtuza Mar 04 '21 at 01:20
  • You can use the `CHCP` command to change the Active Code Page at the top of your script. – Squashman Mar 04 '21 at 01:31
  • @Squashman can you show and write where and how and what should I write I am not so good in batch file . Your help is highly appreciatable . Thanks in advance – Rifat Murtuza Mar 04 '21 at 01:34
  • Did you perhaps look at the help file for the command? I don't know what code page you need to use. You have to figure that out on your own. Here is a list of [Code Pages](https://learn.microsoft.com/en-us/windows/win32/intl/code-page-identifiers) you can use. – Squashman Mar 04 '21 at 01:36
  • about the CHCP I heard it the first from you . Yes I have searched and found (https://stackoverflow.com/questions/32182619/chcp-65001-and-a-bat-file) if you help me in the top what i will write in my bat file . – Rifat Murtuza Mar 04 '21 at 01:41
  • There are 22 usage example of `CHCP` in that link. What is stopping you from putting `CHCP #####` at the top of your script? Where `#####` equals the code page number you need to use. – Squashman Mar 04 '21 at 01:47
  • yes I m asking you the format like I write @echo off :ON_INPUT cls chcp 10001 set buildCmd=rebuild Is it Okay – Rifat Murtuza Mar 04 '21 at 01:50
  • Personally, I'd avoid the use of non-ansi characters in variablenames (eg `csproj指示せん印刷` ) - just call it `csproj` , use the `set` syntax `set "var=value"`, avoid assigning `"` as part of the value and insert `"` as required (`"%msbuild_new%"` with no `"` in the value instead of `%msbuild_new%`). I'd then try `for %%v in (%csproj%) do set "shortname=%%~sdpnxv"` and use `%shortname% ` in place of `%csproj%` for the remainder of the batch. – Magoo Mar 04 '21 at 06:47
  • you mean this set msbuild_new=C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\MSBuild.exe to set %msbuild_new%=C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\MSBuild.exe but the last point I dont understand – Rifat Murtuza Mar 04 '21 at 07:25
  • In the future, post an [mcve]. You probably want `dotnet build` to be `dotnet msbuild`. Also, [edit] your post to include the full build error. If you have a solution file, specify that on your build command line. – jwdonahue Mar 04 '21 at 07:41
  • See also: https://superuser.com/questions/269818/change-default-code-page-of-windows-console-to-utf-8 – jwdonahue Mar 04 '21 at 07:44

0 Answers0