build solution from command line - visual-studio-2012

I'm trying to build a number of solutions from a cmd file using command lines to handle the whole build
this is the line that builds the solution:
for /f %%i in (%CFG%\bld.lst) do set OUT= %%i Release %REBUILD%& call :out & C:\"Program Files (x86)"\"Microsoft Visual Studio 12.0"\Common7\IDE\devenv.exe %%i %REBUILD% Release >>%LOG%
the solutions are in (%CFG%\bld.lst)
if I add error catching as in:
if errorlevel 1 set OUT= Failed to build %%i Release & goto :error_term at the end of the line the build crashes
if I don't then the eventviewer shows me this error:
The description for Event ID 0 from source VSTTExecution
cannot be found. Either the component that raises this event is not
installed on your local computer or the installation is corrupted. You
can install or repair the component on the local computer.
If the event originated on another computer, the display information
had to be saved with the event.
The following information was included with the event:
(devenv.exe, PID 2004, Thread 1) UIContextHelper.SetUIContext: The call to IVsAggregatableProject.GetCmdUIContextCookie failed. Error code: -2147467259
the message resource is present but the message is not found in the string/message table
if I build each of the solutions from VisualStudio the solution builds correctly
I should mention some of the projects where written in VS 2010 and some in VS 2013
it's turning my hair grey. HELP!
Danieli

Related

npm.cmd opens in notepad instead of being executed (ASP.NET Web API + Angular)

I have a problem very similar to this one, but instead of a command line application, I have a ASP.NET Web API project with an Angular project inside of it, created using a dotnet template 'angular' (dotnet new angular --name something. .NET 6.0.401).
When I run the application with dotnet run and open localhost:5097 I get a blank page with a message "Launching the SPA proxy...
This page will automatically redirect to https://localhost:44415 when the SPA proxy is ready." The console constantly prints info: Microsoft.AspNetCore.SpaProxy.SpaProxyMiddleware[0]
SPA proxy is not ready. Returning temporary landing page.
over and over again.
When I enter localhost:44415 I get an error in the console that says
fail: Microsoft.AspNetCore.SpaProxy.SpaProxyLaunchManager[0]
Couldn't start the SPA development server with command 'npm start'.
and a notepad window is opened with content
:: Created by npm, please don't edit manually.
#ECHO OFF
SETLOCAL
SET "NODE_EXE=%~dp0\node.exe"
IF NOT EXIST "%NODE_EXE%" (
SET "NODE_EXE=node"
)
SET "NPM_CLI_JS=%~dp0\node_modules\npm\bin\npm-cli.js"
FOR /F "delims=" %%F IN ('CALL "%NODE_EXE%" "%NPM_CLI_JS%" prefix -g') DO (
SET "NPM_PREFIX_NPM_CLI_JS=%%F\node_modules\npm\bin\npm-cli.js"
)
IF EXIST "%NPM_PREFIX_NPM_CLI_JS%" (
SET "NPM_CLI_JS=%NPM_PREFIX_NPM_CLI_JS%"
)
"%NODE_EXE%" "%NPM_CLI_JS%" %*
which is understandably the same as the npm.cmd's content in my node.js directory. The window name is also "npm.cmd".
As mentioned in the thread I attached previously, I removed a file association for .js in windows settings, but it hasn't changed anything. The last comment there says something about changing the contents of "lb-discover.cmd" file. I don't think an ASP.NET + Angular project has an analogical file to it.
I suspect it might have something to do with file association in windows, but I can't change it for .cmd files.
Thanks in advance.
As suggested by #Yitz - this thing worked
Open your .csproj file for editing, find the following property:
<SpaProxyLaunchCommand>npm start</SpaProxyLaunchCommand>
and change it as follows:
<SpaProxyLaunchCommand>cmd.exe /c npm start</SpaProxyLaunchCommand>
This should work around possible issues with file association for .cmd

Robocopy fail to create directories on local hard drive Error 1 Incorrect Function

I'm having an issue with robocopy in which every call to create a new directory on the destination fails. I get outputs such as:
2019/03/19 16:59:11 ERROR 1 (0x00000001) Creating Destination Directory T:\tmp\MIDCAS_SSP\Documents\Customer Reviews\MASPS 1 review\Received Comments\
The copy operation I am attempting is from a sharepoint list mapped to drive X: onto a subdirectory of a physical hard drive T:
OS Name Microsoft Windows 10 Home,
Version 10.0.17134 Build 17134
I have tried several variants, run command as both user and admin. Below is the commands and printout of one of many attempts.
PS T:\tmp\MIDCAS_SSP> .\Sync_XNet.bat
T:\tmp\MIDCAS_SSP>SET Target=T:\tmp\MIDCAS_SSP\Documents
T:\tmp\MIDCAS_SSP>ECHO T:\tmp\MIDCAS_SSP\Documents
T:\tmp\MIDCAS_SSP\Documents
T:\tmp\MIDCAS_SSP>Set XNetSource=X:
T:\tmp\MIDCAS_SSP>net use X: "\\site.name.domain#SSL\DavWWWRoot\sites\MidcasSSP\Shared Documents"
T:\tmp\MIDCAS_SSP>robocopy /XJ /ZB /MIR /FFT /NDL /TS /R:1 /W:2 "X: " "T:\tmp\MIDCAS_SSP\Documents "
-------------------------------------------------------------------------------
ROBOCOPY :: Robust File Copy for Windows :: Version XP010
-------------------------------------------------------------------------------
Started : Tue Mar 19 16:59:11 2019
Source = X:\
Dest : T:\tmp\MIDCAS_SSP\Documents\
Files : *.*
Options : *.* /FFT /TS /NDL /S /E /COPY:DAT /PURGE /MIR /ZB /XJ /R:1 /W:2
------------------------------------------------------------------------------
2019/03/19 16:59:11 ERROR 1 (0x00000001) Creating Destination Directory T:\tmp\MIDCAS_SSP\Documents\Customer Reviews\MASPS 1 review\Received Comments\
Incorrect function.
Waiting 2 seconds... Retrying...
2019/03/19 16:59:13 ERROR 1 (0x00000001) Creating Destination Directory T:\tmp\MIDCAS_SSP\Documents\Customer Reviews\MASPS 1 review\Received Comments\
Incorrect function.
ERROR: RETRY LIMIT EXCEEDED.
I've checked user and admin rights to the disk.
If I manually create the missing directories, any files therein are copied as intended until a new subdirectory is found but that's a lot of work to get through...
The above listing is using Windows 10 robocopy, but also using the Windows Server 2003 Resource Kit version I have the same problem.
I've also attempted to connect using https:// syntax for the net use command. After I post this I'll reboot as a last ditch attempt.
Ideas where I went wrong? Alternative approaches to back up a remote SharePoint sites' files to off-site disk?
I ran into the same problem, and googling brought me here. Ultimately I didn't find why it doesn't work, but a workaround that did the job for me was to copy the directory structure first using xcopy.
Example:
xcopy /t /e "\\intranet.companyname.com\departments\deptname\Procedures\" "z:\backup\"
robocopy.exe "\\intranet.companyname.com\departments\deptname\Procedures\" "z:\backup" /mir /R:0

When building a lightswitch app I got " Error 11 Could not copy <path to lightswitch dlls> Exceeded retry count of 10

While building a lightswitch app I kept getting this error:
Error 11 Could not copy "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\LightSwitch\Client\Microsoft.LightSwitch.dll" to "Bin\Debug\bin\Microsoft.LightSwitch.dll". Exceeded retry count of 10. Failed. C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\LightSwitch\v2.0\Microsoft.LightSwitch.targets 150 10
It did not make sense to me so I tried copying the files manually, it did not work.
I changed the application name on the "General Properties" page to something shorter and that did the trick!
open task manager then choose "Processes" tab then you will find your project actually running , press on end process button then re-run your project
have fun ;)

signtool fail with inno setup : 0x80070003 - "Store IsDiskFile() failed"

I'm getting a weird error whiles signing my software. I'm using inno setup 4.5.2.
Running Sign Tool command: signtool.exe sign /a /f cert.pfx /v /t "http://timestamp.verisign.com/scripts/timstamp.dll" /p pwd /d "Setup Label" "out\uninst.e32.tmp"
SignTool Error: An unexpected internal error has occurred.
Error information: "Error: Store IsDiskFile() failed." (-2147024893/0x80070003)
Error in W:\path\installer.iss: Sign Tool failed with exit code 0x1.
Compile aborted.
Command line seems pretty ok, it even work outside the inno setup compile. While setting the SignedUninstaller=no get me farther, it still make this error while trying to sign the output setup file.
Now i've looked pretty much everywhere for that error code (0x80070003) and/or the message "Store IsDiskFile() failed". I have also tried with multiple version of signtool.
I figured out the problem, the path to the certificate must be relative to the installer output path, not the current working folder. In this case, it would be "..\cert.pfx".
I had the same problem. My problem was I have used " in the signTool command, while I needed to use $q instead. Surprisingly it was successfully signed the executable but it failed to sign the result setup.exe file.
In my case I had the wrong Path for the certificate file. A message like "pfx not found" would much be better than just "IsDiskFile() failed."....
My problem was having the .pfx file on a network drive (G:). Moving it to a lokal drive (C:) solved the problem.

How to silently/automatically install Desktop Experience in Azure?

I need to install Desktop Experience in Azure Worker Role. Installing DE via the command line can be done with:
c:\servermanagercmd -install Desktop-Experience
And then a reboot is required.
How can I best make this work in Azure Worker Role?
UPDATE:
1) Make sure to use OS Family 2 and SDK >=1.3
2) Use elevated startup task to call included batchfile with this command:
3) servermanagercmd -install Desktop-Experience -restart -resultPath results.xml
I have tried
a) to put that commandline in a batch/.cmd file and run it via an elevated startup task. Result: The worker role keeps Aborting and restarts in a neverending loop.
b) I have tried to create a new Process() in OnStart(), under elevated runtime, something like this:
ServiceDefinition.csdef:
Runtime executionContext="elevated"
WorkerRole.cs:
public override bool OnStart()
{
if (!System.IO.File.Exists("Startup\\InstallationFinished.txt"))
{
Process startup = new Process();
startup.StartInfo.FileName = "Startup\\InstallDesktopExperience.cmd";
startup.StartInfo.CreateNoWindow = true;
startup.EnableRaisingEvents = true;
startup.Start();
startup.WaitForExit();
System.IO.File.WriteAllText("Startup\\InstallationFinished.txt",
"Installation is complete.");
startup.StartInfo.FileName = "Startup\\Reboot.cmd";
startup.Start();
}
base.OnStart();
}
InstallDesktopExperience.cmd:
servermanagercmd -install Desktop-Experience
Reboot.cmd:
shutdown /r
The result is that the Event Viewer in the Azure Worker Role shows an exception from TrustedInstaller (0xc0000005). After this error is shown in the event log, DE cannot be installed manually by opening a command line window and typing the command either. I get the error:
Error: Installation of [Desktop Experience] failed. Attempt to install Desktop Experience failed with error code 0x80080005. Server execution failed (Exception from HRESULT: 0x80080005 (CO_E_SERVER_EXEC_FAILURE))
(but it works by doing it manually in a command line window if I haven't run the code in OnStart)
I'm lost. Thanks in advance for any and all suggestions.
You should reference this guide from Wage Wegner. It deals with Expression Encoder, but the prereq of Desktop Experience is exactly the same:
http://www.wadewegner.com/2011/01/using-expression-encoder-4-in-a-windows-azure-worker-role/
Snippet from the same, but you should take the time to read his explanation on some of these concepts
REM : Install the Desktop Experience
ServerManagerCMD.exe -install Desktop-Experience -restart -resultPath results.xml
REM : Make a folder for the AppData
md "%~dp0appdata"
REM : Change the location of the Local AppData
reg add "hku\.default\software\microsoft\windows\currentversion\explorer\user shell folders" /v "Local AppData" /t REG_EXPAND_SZ /d "%~dp0appdata" /f
REM : Install Encoder
"%~dp0\webpicmd\WebPICmdLine.exe" /accepteula /Products: ExpressionEncoder4 /log:encoder.txt
REM : Change the location of the Local AppData back to default
reg add "hku\.default\software\microsoft\windows\currentversion\explorer\user shell folders" /v "Local AppData" /t REG_EXPAND_SZ /d %%USERPROFILE%%\AppData\Local /f
REM : Exit gracefully
exit /b 0

Resources