How to speed up an Electron/Blazor Build on Visual Studio 2022 - build

I have a blazor web assembly project programmed in Visual Studio 2022 Community. I am also using electron with this application. When I build the application this is always happening and it is slowing down my build to like 10 minutes every time I build it. Unacceptable.
Start Electron Desktop Application...
Arguments:
dotnet publish -r win-x64 -c "Debug" --output "F:\AutoHarp3_Server\AutoHarp_Server\obj\Host\bin" /p:PublishReadyToRun=true /p:PublishSingleFile=true --no-self-contained
MSBuild version 17.3.0+92e077650 for .NET
Determining projects to restore...
F:\AutoHarp3_Server\AutoHarp_Server\AutoHarp3_Server.csproj : warning NU1701: Package 'OpenHtmlToPdf 1.12.0' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8, .NETFramework,Version=v4.8.1' instead of the project target framework 'net6.0'. This package may not be fully compatible with your project.
Restored F:\AutoHarp3_Server\AutoHarp_Server\AutoHarp3_Server.csproj (in 2.46 sec).
1 file(s) moved.
F:\AutoHarp3_Server\AutoHarp_Server\AutoHarp3_Server.csproj : warning NU1701: Package 'OpenHtmlToPdf 1.12.0' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8, .NETFramework,Version=v4.8.1' instead of the project target framework 'net6.0'. This package may not be fully compatible with your project.
AutoHarp3_Server -> F:\AutoHarp3_Server\AutoHarp_Server\bin\Debug\net6.0\win-x64\AutoHarp3_Server.dll
node_modules missing in: F:\AutoHarp3_Server\AutoHarp_Server\obj\Host\node_modules
Start npm install...
npm install
npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion#1, but package-lock.json was generated for lockfileVersion#2. I'll try to do my best with it!
Any way to fix this so that it will go faster? I'm not even sure why the last line is even happening. This is where the slow down happens.
Edit to show the whole application message from the beginning.

Related

Visual Studio 2017 and npm. Exclamation mark near the npm references in Solution Explorer

What does it mean:
"Resotore Packages.." doesn't help. Still exclamation, still empty.
I should say that npm from console works well: all packages are in place. packages.json and packages.lock are ok.
How Visual Studio determine the "problem"? which file it uses?
wipe out folder for npm, probably hidden node_modules in your asp.net core project
from command line use npm init or PMC (from within VS).
If you are absolutely sure the package.json is fine then anything that was off will now get restored. Any bangout that occurs now is a result of either a bad restore from npm (automagic btw, on change). Or your package.json has something missing like a , (a comma).
-mv

Visual Studio 2017 Deployment Error on Windows 10 IoT

I've been developing my Windows Store App for over a month, and all of a sudden I get this error when I try to run it in Visual Studio 2017 on my developer machine:
Visual Studio Errors
(DEP0600 Deployment Failed. Failed to deploy through new deployment pipeline)
(DEP8000 Unexpected deployment failure: AggregateException : One or more errors occurred)
This error only occurs at my current project, not at a standard template for example.
I already cleaned and rebuild my solution but still no success.
At the moment I run
Target Version : Windows 10 Anniversary Edition(10.0; Build 14393)
and
Min Version : Windows 10(10.0; Build 10586).
For me the problem was that my app was already running. I set it as the startup app and after that I couldn't redeploy the newer version. Stopping the app solved the problem.
DEP8000 just means that an agregated thread encountered an error and is thrown to the parent thread.
The real issue here is DEP0600.
I encountered a solution on MSDN.
Basicaly it can occur if any of your filenames has accented characters (á, ô. õ, é) ect.
Rename all your files to remove these and you're good to go.
You need to change the Universal Window Target Version as Windows 10 Fall Creators Update(10.0;Build 16299).
If you can not find this version option,you need to install the WDK for 16299, this is the download link.Please try it,and feel free to let me know if there is any problem.
I encountered the same problems when working with Deploying UWP app to HoloLens.
Here are few steps that can help:
Clean & Rebuild solution
Deleting .vs folder can help
Else you can just rename the package name under project settings.

Could not locate deviceQuery on my installation Cuda toolkit v7.5 on Windows 10

As I was going through installing Cuda v7.5 following this link http://docs.nvidia.com/cuda/cuda-installation-guide-microsoft-windows/#compiling-examples
I was not able to verify the installation as described in section 2.5. Verify the Installation. The reason was because I could not find deviceQuery program that should have been located in
C:\ProgramData\NVIDIA Corporation\CUDA Samples\v7.5\bin\win64\Release
Therefore, I could not run the deviceQuery for Cuda to be verified. Where is deviceQuery program located ? Is it still precompiled and deployed by the installation ?
Okay, so if you are a complete noob like me in using Visual Studio then you might be thrown off by the instruction "build the application first". Just watch this video to get an idea of how to build and run a project/program using VS.
https://www.youtube.com/watch?v=cL05xtTocmY
As soon as you open VS (I am using 15.6), you will be prompted to upgrade the SDK. Make sure to do so. If you've misclicked or skipped upgrading, you can go to the Project pull down menu and click "Retarget Solution" and click ok on the menu that appears. Then build and debug as shown in the video.
Creating the deviceQuery.exe file:
Go to the (default) directory C:\ProgramData\NVIDIA Corporation\CUDA Samples\v9.2\1_Utilities\deviceQuery. Just follow the procedure of running the MatMul file but this time build the deviceQuery_vs2017.sln file and debug it. Remember to retarget the solution.
No, it's not precompiled any more.
You have to compile (build) the application first, before you can run it.
That is true for all the CUDA samples now.
OK, I've had this problem with CUDA Toolkit 10 under Windows 10. In my case, I do never use the admin account, and the installation was done from the user account, entering the admin password when necessary. After repeated trials, here's what worked for me:
Make sure to uninstall any old version of CUDA and Visual Studio
(just to have a clean start)
Restart the computer
Install Microsoft Visual Studio Community Edition. During the
install, make sure to select the C++ Development tools
Restart
Install the Cuda Toolkit
Restart
With this, I had all the files. But the deviceQuery still would not compile because it was targeted to an older version of Windows. To compile it, one needs to 'Retarget' the project to the current windows SDK. However, this doesn't work out-of-the-box because the 'deviceQuery_vs2017.vcxproj' file is read-only for regular users.
So, there are two possible solutions:
Copy the folder to some place where you have write permission, or
(This is what I used, for convenience) Using Windows Explorer, navigate to the C:\ProgramData\NVIDIA Corporation directory. Right click on the 'CUDA Samples' directory, select 'Properties'. Under the 'Security' tab, click 'Edit' and add your user to it.
This way you can Retarget the solution in place. After that, I could open the solution in MS Visual Studio, Retarget it, build it and test it, and all worked fine.
Hope that helps.

Building UWP app from command line

I need to create kind of builder for my Universal Windows App (UWP) application, that would load some configuration into it, build it and create app store package. Is there any way to build UWP app from command line, without associating it with the store and using Visual Studio at all?
There is WinAppDeployCmd, but it can be used to install builded appx package on device and I need tool like that to generate that package.
UPDATE
I've managed to build it and create app packages with command line, here is command I used:
msbuild "path to .csproj file" /p:OutDir=output_dir /p:AppxBundle=Always;AppxBundlePlatforms="x86|x64|ARM" /p:BuildAppxUploadPackageForUap=true
It's working but not as it should apparently. I can not install generated appx package on my phone (and emulator). I just get error
Failure reason: Failed to start deployment. Failure text: Install failed. Please contact your software vendor. (0x80073cf9)
I found many solutions for Windows 10 PC version, but there is only one solution I found for Windows 10 Mobile and this "solution" is to hard reset the phone, but I do not want to do that. Is there any other way?
And there is one more problem. This command doesn't work with parameter /p:Configuration=Release; and it only builds with Debug configuration, but I believe this is not related to previous error, because it doesn't work with Visual Studio either.
UPDATE
I could not find another solution, so I did the 'hard reset' of my phone and now it is working. It's sad, but I hope the reason is the Windows 10 Mobile OS is still in beta version.
Step 1 : See, you need to install .NET Framework installer from the below link. https://www.microsoft.com/en-us/download/details.aspx?id=30653
Step 2 : Go to C: drive and find where msbuild.exe is. You will find more msbuild. But mostly it will be in the location like C:\Windows\Microsoft.NET\Framework\v4.0.30319.
Step 3: Open the CMD in administrator and point to the location which is mentioned in Step 2.
Step 4 : Paste this. msbuild.exe "YourCompleteProjectPath.sln" /t:rebuild
See this for reference : https://msdn.microsoft.com/en-us/library/ms164311%28v=vs.85%29.aspx

How to build a VS2010 C++ Project on a BuildServer

I've a .NET Solution with a managed C++ assemlby Targeting .NET 3.5 created with VS2010. The command:
%windir%\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe MyProject.sln
compiles the solution on my dev machine.
On my BuildServer I get this error:
Build FAILED.
"F:\CruiseControl.NET\Projects\MyProject\MyProject.sln"
(default target) (1) ->
"F:\CruiseControl.NET\Projects\MyProject\MyProject\MyProject.csproj"
(default target) (2) ->
"F:\CruiseControl.NET\Projects\MyProject\MyProjectMAPIHelper\MyProjectMAPIHelper.vcxproj"
(default target) (3) ->
F:\CruiseControl.NET\Projects\MyProject\MyProjectMAPIHelper\MyProjectMAPIHelper.vcxproj(23,3):
error MSB4019: The imported project
"C:\Program
Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.Cpp.Default.props"
was not found. Confirm that the path
in the <Import> declaration is
correct, and that the file exists on
disk.
0 Warning(s)
1 Error(s)
On my dev machine the claimed file
"C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.Cpp.Default.props"
exists. On my build server not.
When I try to copy this files (and all others in the same directory) other errors occurred. So this is the wrong way.
EDIT: other errors means: When I copy the file "Microsoft.Cpp.Default.props" on the build server, MSBuild is claiming other files. That shows me, that just doing a copy of missing files is not what the build environment is expecting. I am looking for an MSI/whatever package that I could install on my build server and any C++ Project will build. Installing the SDK did not the trick. Or I did something wrong during SDK installation. Or it is not possible to compile Managed C++ VS2010 Solutions just with the SDK.
I believe that "other errors" has nothing to do with my problem. My Problem is: "How do I setup my build environment correctly". /EDIT
What I've done till now:
I have installed the latest Win7 SDK (Link)
I am targeting .net 3.5
I've tried playing with the Platform Toolset Property - but it was just playing
In my solution there is a managed C++ Assembly (my Problem)
I am using MSBuild 4.0 because the new VS2010 project files cannot be compiled with MSBuild 3.5
I am using CC.NET. compilation fails in CC.NET and on the command line. So it should not be a CC.NET issue.
Are there any tips and tricks how to configure my project properly to compile on my dev machine with VS2010 and on my build server? Is there anything more to install (except VS2010)?
Thanks, Arthur
For now, installing VS 2010 is your only safe option. The Windows SDK will be updated to enable your scenario, but I don't have a specific release date. Until then, you'll need to install VS 2010 with the C++ tools in order to build your 2010 solution with C++ projects. Make sure you let the C++ team know about how dissatisfaction with this situation via their team blog and/or MSDN Forum.
Even after installing VS 2010, you may need to invoke the appropriate vcvars*.bat file to setup your environment variables correctly.
Why don't you want to install VS2010 on your build server? If it's licencing, it's licenced per developer head not per install so I'm reasonably sure you are allowed to without buying another copy - or, at worst, you can install the express version which ought to at least install the config bits you're missing so you can use the platform SDK compiler.
If you're still having problems with msbuild you can then use devenv.com /build which exactly replicate the VS build env.
You may try those links:
http://social.msdn.microsoft.com/Forums/en-US/tfsbuild/thread/9055ca52-586b-459f-9dd1-a9d052d076b9/
or
http://msdn.microsoft.com/en-us/library/ee662426.aspx