0

Hello I am getting a build error I tried a lot and I tried this

and also but did not work can you help me this Here is my bat 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

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

As you see I add \ this in line break still have this problem and error.

Microsoft (R) Build Engine version 16.8.3+39993bd9d for .NET Copyright (C) Microsoft Corporation. All rights reserved.

MSBUILD : error MSB1008: Only one project can be specified. Switch: 554/185513.log;verbosity=diagnostic\

I still have this error. How can I get rid of this? Thanks in advance

Rifat Murtuza
  • 1,151
  • 2
  • 7
  • 15
  • 2
    In order for this to be a [mcve], you should provide the code which generated the variables, you've included above, i.e. `%yyyy%`, `%mm%`, `%dd%`, `%hh%`, `%mm%`, `%ss%`, and `%buildCmd%`. Your error seems to mention a log file named, `554/185513.log`, but as your code clearly shows that is not what you're supposed to be naming it, I'd suggest that you're trying to generate those using the wrong locale/user//PC settings. There are hundreds of examples on this site showing how to create a date independent of User, PC, or locale settings, please use the search facility, if you aren't using one. – Compo Mar 04 '21 at 12:00
  • still got this and I deleted previos log file MSBUILD : error MSB1008: Only one project can be specified. Switch: 154/211548.log;verbosity=diagnostic – Rifat Murtuza Mar 04 '21 at 12:16
  • and I provide this set buildCmd=rebuild set yyyy=%date:~0,4% set mm=%date:~5,2% set dd=%date:~8,2% – Rifat Murtuza Mar 04 '21 at 12:17
  • 2
    Clearly you are not setting your date variables correctly. Your log file contains a forward slash, which directly comes from your `date` variable which you are trying to extract the date variables from. `554/185513` I would just dump the variables (unless you are getting them from somewhere else as you do not show how you get them) and use something like `for /f %%i in ('powershell Get-Date -Format "yyyymmddhhmmss"') do set "filename=%%i"` – Gerhard Mar 04 '21 at 12:53
  • 1
    @RifatMurtuza, of course you got the same error. If you didn't make a code change you are going to get the same error regardless of deleting the previous log. You are not understanding how to get the date assigned to a variable independent of the `%date%` variable format. – Squashman Mar 04 '21 at 15:16

0 Answers0