Author Topic: Building Visual Studio project failure -- This operation should only take place  (Read 589 times)

jporkkahtc

  • Senior Community Member
  • Posts: 1825
  • Hero Points: 177
  • Text
Notice the error text near the bottom.

C: & cd C:\Users\joe\Documents\Programming\PuzzleSolverHex
C:\Users\joe\Documents\Programming\PuzzleSolverHex>echo VSLICKERRORPATH="C:\Users\joe\Documents\Programming\PuzzleSolverHex"
VSLICKERRORPATH="C:\Users\joe\Documents\Programming\PuzzleSolverHex"

C:\Users\joe\Documents\Programming\PuzzleSolverHex>"C:\Program Files\SlickEdit Pro 23.0.0 Beta5\win\vsbuild" -signal 51173 -command devenv "C:\Users\joe\Documents\Programming\PuzzleSolverHex\PuzzleSolverHex.sln" /build "Debug" /project "C:\Users\joe\Documents\Programming\PuzzleSolverHex\PuzzleSolverHex.vcxproj" /projectconfig "Debug|x64"
 VSLICKERRORPATH="C:\Users\joe\Documents\Programming\PuzzleSolverHex"
devenv C:\Users\joe\Documents\Programming\PuzzleSolverHex\PuzzleSolverHex.sln /build Debug /project C:\Users\joe\Documents\Programming\PuzzleSolverHex\PuzzleSolverHex.vcxproj /projectconfig "Debug|x64"

Microsoft Visual Studio 2017 Version 15.0.27703.2035.
Copyright (C) Microsoft Corp. All rights reserved.
1>------ Build started: Project: PuzzleSolverHex, Configuration: Debug x64 ------
1>This operation should only take place on the UI thread.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

C:\Users\joe\Documents\Programming\PuzzleSolverHex>

Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1299
  • Hero Points: 130
This one comes up from time to time.  Sometimes it is not possible to build a Visual Studio project on the command-line with devenv until it is first built in Visual Studio product.  We do have new project templates for more recent versions of Visual Studio that use msbuild instead, for example new command-line looks like this:
msbuild "%w" /t:"%sf" /p:Configuration="%bn" /p:Platform="%bpms" /nologo /v:m

It looks like you are using Visual Studio 2017, is this a project you opened previously with an older version of SlickEdit?  v22/23 should be using the new templates to generate project files based on that.  You could try deleting .vpj/.vpw and have SlickEdit regenerate them, should be using msbuild at that point.  If not I need to find out why your setup isn't detecting that.

jporkkahtc

  • Senior Community Member
  • Posts: 1825
  • Hero Points: 177
  • Text
OK, I removed all of the existing vpj/vpw files and opened the *.sln from Slickedit.\
Now, Build->SetActiveConfiguration has only one option "Release"
No way to select debug, x86/x64

Also, when I try to build, it still fails:
C: & cd C:\Users\joe\Documents\Programming\PuzzleSolverHex

C:\Users\joe\Documents\Programming\PuzzleSolverHex>echo VSLICKERRORPATH="C:\Users\joe\Documents\Programming\PuzzleSolverHex"
VSLICKERRORPATH="C:\Users\joe\Documents\Programming\PuzzleSolverHex"

C:\Users\joe\Documents\Programming\PuzzleSolverHex>"C:\Program Files\SlickEdit Pro 23.0.0 Beta5\win\vsbuild" -signal 51173 -command devenv "C:\Users\joe\Documents\Programming\PuzzleSolverHex\PuzzleSolverHex.sln" /build "Release" /project "C:\Users\joe\Documents\Programming\PuzzleSolverHex\PuzzleSolverHex.vcxproj" /projectconfig "Release"
 VSLICKERRORPATH="C:\Users\joe\Documents\Programming\PuzzleSolverHex"
devenv C:\Users\joe\Documents\Programming\PuzzleSolverHex\PuzzleSolverHex.sln /build Release /project C:\Users\joe\Documents\Programming\PuzzleSolverHex\PuzzleSolverHex.vcxproj /projectconfig Release

Microsoft Visual Studio 2017 Version 15.0.27703.2035.
Copyright (C) Microsoft Corp. All rights reserved.
C:\Users\joe\Documents\Programming\PuzzleSolverHex\PuzzleSolverHex.vcxproj : error  : Project "C:\Users\joe\Documents\Programming\PuzzleSolverHex\PuzzleSolverHex.vcxproj" could not be found.


One or more projects in the solution were not loaded correctly.
Please see the Output Window for details.
Invalid project configuration

Use:
devenv  [solutionfile | projectfile | anyfile.ext]  [switches]

The first argument for devenv is usually a solution file or project file.
You can also use any other file as the first argument if you want to have the
file open automatically in an editor. When you enter a project file, the IDE
looks for an .sln file with the same base name as the project file in the
parent directory for the project file. If no such .sln file exists, then the
IDE looks for a single .sln file that references the project. If no such single
.sln file exists, then the IDE creates an unsaved solution with a default .sln
file name that has the same base name as the project file.

Command line builds:
devenv solutionfile.sln /build [ solutionconfig ] [ /project projectnameorfile [ /projectconfig name ] ]
Available command line switches:

/Build      Builds the solution or project with the specified solution
      configuration. For example "Debug". If multiple platforms
      are possible, the configuration name must be enclosed in quotes
      and contain platform name. For example: "Debug|Win32".
/Clean      Deletes build outputs.
/Command   Starts the IDE and executes the command.
/Deploy      Builds and then deploys the specified build configuration.
/Edit      Opens the specified files in a running instance of this
      application. If there are no running instances, it will
      start a new instance with a simplified window layout.
/LCID      Sets the default language in the IDE for the UI.
/Log      Logs IDE activity to the specified file for troubleshooting.
/NoVSIP      Disables the VSIP developer's license key for VSIP testing.
/Out      Appends the build log to a specified file.
/Project   Specifies the project to build, clean, or deploy.
      Must be used with /Build, /Rebuild, /Clean, or /Deploy.
/ProjectConfig   Overrides the project configuration specified in the solution
      configuration. For example "Debug". If multiple platforms are
      possible, the configuration name must be enclosed in quotes
      and contain platform name. For example: "Debug|Win32".
      Must be used with /Project.
/Rebuild   Cleans and then builds the solution or project with the
      specified configuration.
/ResetSettings   Restores the IDE's default settings, optionally resets to
      the specified VSSettings file.
/ResetSkipPkgs   Clears all SkipLoading tags added to VSPackages.
/Run      Compiles and runs the specified solution.
/RunExit   Compiles and runs the specified solution then closes the IDE.
/SafeMode   Launches the IDE in safe mode loading minimal windows.
/Upgrade   Upgrades the project or the solution and all projects in it.
      A backup of these files will be created as appropriate.  Please
      see Help on 'Visual Studio Conversion Wizard' for more
      information on the backup process.

Product-specific switches:

/debugexe   Open the specified executable to be debugged. The remainder of
      the command line is passed to this executable as its arguments.
/diff      Compares two files.  Takes four parameters:
      SourceFile, TargetFile, SourceDisplayName(optional),
      TargetDisplayName(optional)
/sqldbaction    Start SQL Server Data Tools and perform the action specified in the argument string.
/TfsLink   Opens Team Explorer and launches a viewer for the
      provided artifact URI if one is registered.
/useenv      Use PATH, INCLUDE, LIBPATH, and LIB environment variables
      instead of IDE paths for VC++ builds.

To attach the debugger from the command line, use:
   VsJITDebugger.exe -p <pid>

C:\Users\joe\Documents\Programming\PuzzleSolverHex>

jporkkahtc

  • Senior Community Member
  • Posts: 1825
  • Hero Points: 177
  • Text
Oh - the project doesn't seem to work at all.
No files, errors in the Project tool, etc.

jporkkahtc

  • Senior Community Member
  • Posts: 1825
  • Hero Points: 177
  • Text
OOps -- I had removed the *vcxproj file!\


Restoring that, now the project basically works, but I still get that error
This operation should only take place on the UI thread

Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1299
  • Hero Points: 130
Is it still using devenv or using msbuild on the command-line?

jporkkahtc

  • Senior Community Member
  • Posts: 1825
  • Hero Points: 177
  • Text
devenv.

I uploaded the project files to support.


C: & cd C:\Users\joe\Documents\Programming\PuzzleSolverHex

C:\Users\joe\Documents\Programming\PuzzleSolverHex>echo VSLICKERRORPATH="C:\Users\joe\Documents\Programming\PuzzleSolverHex"
VSLICKERRORPATH="C:\Users\joe\Documents\Programming\PuzzleSolverHex"

C:\Users\joe\Documents\Programming\PuzzleSolverHex>"C:\Program Files\SlickEdit Pro 23.0.0 Beta5\win\vsbuild" -signal 51667 -command devenv "C:\Users\joe\Documents\Programming\PuzzleSolverHex\PuzzleSolverHex.sln" /build "Debug" /project "C:\Users\joe\Documents\Programming\PuzzleSolverHex\PuzzleSolverHex.vcxproj" /projectconfig "Debug|Win32"
 VSLICKERRORPATH="C:\Users\joe\Documents\Programming\PuzzleSolverHex"
devenv C:\Users\joe\Documents\Programming\PuzzleSolverHex\PuzzleSolverHex.sln /build Debug /project C:\Users\joe\Documents\Programming\PuzzleSolverHex\PuzzleSolverHex.vcxproj /projectconfig "Debug|Win32"

Microsoft Visual Studio 2017 Version 15.0.27703.2035.
Copyright (C) Microsoft Corp. All rights reserved.
1>------ Build started: Project: PuzzleSolverHex, Configuration: Debug Win32 ------
1>This operation should only take place on the UI thread.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

C:\Users\joe\Documents\Programming\PuzzleSolverHex>

Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1299
  • Hero Points: 130
Thanks for the upload.  I tried several different things, and I could not get this to build in SlickEdit despite trying several different workarounds that worked in the past. It works just fine a normal Command Prompt shell, but not in our embedded one.   

Looks like I will need to update the project templates for next beta to use msbuild for Visual Studio 2015 solutions/projects as well.