How do I fix this incorrect emulator command line run by VS 2013 MDA when I target Android Emulator - visual-studio-cordova

When I try to use "Android Emulator" as the target in Visual Studio for my Cordova app (running VS Tools for Cordova latest in VS 2013), I get about 6 or 7 errors. I noticed that the command line that VS tries to launch is missing quotes around the path to node.exe and uses double quotes around the path to emulator.js.
If I paste this into a cmd prompt and correct the quote problem, the emulator starts correctly. How can I fix this?
Here is the command line VS tries to run:
Starting launch process C:\Program Files (x86)\nodejs\node.exe ""C:\Users\Jason Learmouth\AppData\Roaming\npm\node_modules\vs-mda\emulator.js"" --platform android --path "c:\code..."

This is a known issue which will be fixed in next update. Workaround is to use user name without any spaces. Visual Studio is putting double double quotes because of space in emulator.js path like C:\Users\**Jason Learmouth**\AppData\Roaming\npm\node_modules\vs-mda\emulator.js

Related

"dotnet" command does nothing

I'm trying to install a global package through dotnet cli but the command dotnet does nothing. I don't get an error message that says the command is not found etc. but it also doesn't run.
Between each line, cursor inside the powershell (or command prompt) turns into Working In Background ( ) mode but after just a few seconds, it just gets into the new line without doing anything. During these few seconds, if I move the cursor outside the prompt, it goes back to regular mode. So it's doing something I guess.
What is happening here, and how can I solve this issue?
What have I already tried:
1-) Since my network is behind a proxy, I've added the proxy credentials through NPM configuration commands. (as can be seen here)
(I also set the strict-ssl to false).
2-) Since it didn't do anything, I also used this method and edited the global nuget.config file. But didn't solve any problem.
3-) I tried this too, but setting the environment variable MSBuildSDKsPath seems to do nothing about my problem.
My PATH variable has these:
C:\Program Files\dotnet,
%USERPROFILE%\.dotnet\tools
I also downloaded the latest Dotnet 5.0 SDK and installed it, but nothing.
Only command that works with dotnet is the --list-sdks command which shows this result:
I uninstalled all the .NET SDKs and runtimes, I also removed all the installed modules on both VS 2019 and VS 2022 Preview using the Visual Studio Installer, then restarted my computer.
While installing the SDKs and runtimes from Microsoft's website I checked the .NET version using the command line and command dotnet --version after every installation to see when exactly it starts not working. After installing all the SDK's up to .NET 5, there was no issue. And since I did not really need the .NET 6 SDK I didn't specifically download it thinking VS 2022 Preview would automatically install it anyways.
Using Visual Studio Installer, I installed the necessary components for the dotnet development on the VS 2019 and the previously mentioned command was working on point. Then I proceeded to install the necessary components on the VS 2022 Preview but after installing it, the command started to not work. So there it was, the source of the problem. Something about VS 2022 Preview's installment process just corrupts dotnet cli, but I'm not sure if it's just me.
You also need a restart after all the installments or dotnet cli might show some errors.

dotnet build stopped working after VS 2022 upgrade

I upgraded Visual Studio Community to the final release, and it stopped working. Specifically, I could generate a new project, but when I try to load it, it gave me an error
Critical Project 'SdkTest' load failed| [MSB4236] The SDK 'Microsoft.NET.Sdk.Web' specified could not be found. ...\SdkTest.csproj
Even though build and run worked fine
I ran "repair" on VS2022, and it seems to be working now from Visual Studio. However, dotnet --info doesn't show any SDKs; only runtime; and dotnet build or dotnet new give an error:
C:\Code>dotnet new console -o myapp
Could not execute because the application was not found or a compatible .NET SDK is not installed.
Possible reasons for this include:
* You intended to execute a .NET program:
The application 'new' does not exist.
* You intended to execute a .NET SDK command:
It was not possible to find any installed .NET SDKs.
Install a .NET SDK from:
https://aka.ms/dotnet-download
I even reinstalled .NET 6 and I see it in the list of applications (along with older SDKs). I checked the path, and I see everything that I expect to see:
C:\Program Files (x86)\dotnet\
C:\Program Files\dotnet\
C:\Users\me\.dotnet\tools
I am running Windows 11.
It's known bug in VS2022 installation.
Problem is that dotnet you access is located inside Program Files(x86)/dotnet, but all sdk's are located in Program Files/dotnet. You simply need to edit PATH environment variable so Program Files/dotnet goes before Program Files(x86)/dotnet. If you don't see Program Files(x86)/dotnet in user environment variable (which is likely to happen) then edit system environment variable (located below)
Example with screenshots: https://stackoverflow.com/a/44272417/10339675

'{{FSharpCoreShippedPackageVersion}}' is not a valid version string

I just upgraded to Visual Studio 2019 version 16.5.0 Preview 2.0. It seems to have broken building and running .NET Core projects in F# with the dotnet command line tool.
Previously dotnet build and dotnet run worked fine. Now either one produces this error message (wrapped for readability):
C:\Program Files\dotnet\sdk\3.1.200-preview-014883\NuGet.targets(124,5):
error : '{{FSharpCoreShippedPackageVersion}}' is not a valid version string.
My projects don't have the string FSharpCoreShippedPackageVersion anywhere in them that I can see (including in the .fsproj files). I also looked in the referenced NuGet.targets file and couldn't find FSharpCoreShippedPackageVersion in it either.
Using dotnet new console --language=F# also fails, telling me to restore NuGet packages, but attempting dotnet restore gives the same error message.
What can I do to fix this?
UPDATE: This issue appears to be fixed in the current version of the preview:
3.1.200-preview-014977
If you update Visual Studio 2019 Preview, you shouldn't need this workaround anymore.
I found a workaround:
Run dotnet new globaljson in the project root folder
Edit the global.json to use .NET Core 3.1.101 instead of 3.1.200-preview-014883.
It appears that the combination of VS 2019 Version 16.5.0 Preview 2.0 and .NET Core 3.1.200-preview-014883 causes this problem.

sqllite3.dll issues with UWP app development for Mobile

I am trying to learn how to develop apps for UWP for both Desktop and Mobile. I have been currently working on getting the Entity Framework working in my app to store application state and followed the following link:
https://learn.microsoft.com/en-us/ef/core/get-started/uwp/getting-started
It worked well for Desktop, the issue however is that when I try to run it on the Windows Mobile emulator I get the following error in debug mode when the code reaches the db.Database.Migrate() step:
Unable to load DLL 'sqlite3': The specified module could not be found
In the link I pasted above, someone else had the same issue and in the comments they recommended to try the following:
Step 1: Install SQLite VSIX pacakge for Universal Windows Platform development using Visual Studio 2015
https://www.sqlite.org/2016/sqlite-uwp-3130000.vsix
Step 2: Install NuGet package SQLite.NET-PCL
Install-Package SQLite.NET-PCL
Step 3: Add references
Add Reference -> Universal Windows ->Extensions -> Make sure the following packages have been checked: "SQLite for Universal Windows Platform" "Visual C++ 2015 Runtime for Universal Windows Platform Apps"
After that, if you get the error "Payload contains two or more files with the same destination path 'sqlite3.dll', do the following:
copy sqlite3.dll from
C:\Program Files (x86)\Microsoft SDKs\UAP\v0.8.0.0\ExtensionSDKs\SQLite.UAP.2015\3.8.11.1\Redist\Debug\ARM\sqlite3.dll
past to (override it)
C:\Users\%USERNAME%\.nuget\packages\SQLitePCL.raw_basic\0.7.1\build\native\sqlite3_dynamic\winrt81\arm\sqlite3.dll
The problem after doing those steps is that I am now seeing the issue when doing a build for "Payload contains two or more files" however not in the SQLitePCL.raw_basic directory (I don't even seem that have that). Instead my error is the following:
Payload contains two or more files with the same destination path 'sqlite3.dll'. Source files:
C:\Users\admin\.nuget\packages\SQLite\3.13.0\runtimes\win7-x86\native\sqlite3.dll
C:\Program Files (x86)\Microsoft SDKs\UAP\v0.8.0.0\ExtensionSDKs\SQLite.UWP.2015\3.13.0\Redist\Debug\x86\sqlite3.dll
I have been searching everywhere and am truly stumped as to how to get my UWP program working on Mobile. Thanks a lot for your help!
It seems like you got the solution for resolving the exception The specified module could not be found from #Leandro_Medeiros_Machado 's comment on this document. If you got the Payload contains two or more files with the same destination path 'sqlite3.dll' exception after you done the above three steps you may be also found the next solution from the comment.
After that, if you get the error "Payload contains two or more files with the same destination path 'sqlite3.dll', do the following:copy sqlite3.dll from
C:\Program Files (x86)\Microsoft SDKs\UAP\v0.8.0.0\ExtensionSDKs\SQLite.UAP.2015\3.8.11.1\Redist\Debug\ARM\sqlite3.dll
past to (override it)
C:\Users\%USERNAME%\.nuget\packages\SQLitePCL.raw_basic\0.7.1\build\native\sqlite3_dynamic\winrt81\arm\sqlite3.dll
For you, you may need to copy from
C:\Program Files (x86)\Microsoft SDKs\UAP\v0.8.0.0\ExtensionSDKs\SQLite.UWP.2015\3.13.0\Redist\Debug\x86\sqlite3.dll to(override) C:\Users\admin\.nuget\packages\SQLite\3.13.0\runtimes\win7-x86\native\sqlite3.dll.
But actually, for using EF core you don't need the above steps and I recommend you check your environment instead of using the above workaround. I created a simple EF project by following the document and without install the VSIX I can run successfully on the emulator (build 10586). My VS build is 2015 update 3, my OS version is build 14393 and the EF core version is Microsoft.EntityFrameworkCore.Sqlite 1.1.0. So please firstly check if your environment met the following requirements:
Windows 10
Visual Studio 2015 Update 3
The latest version of Windows 10 Developer Tools
And if your EF core and EF core tools versions are right.

"One or more error occurred" When right clicking form elements

When working with either a Custom or Standard Form in AX 7, right-clicking on the Design Node, Grid Container, Group Control etc. Visual Studio freezes for a couple of seconds then displays this error message: "One or more error occurred".
This is not isolated on my development VM, coworkers also experiencing the same issue.
Anyone ran into this problem?
I think I remember running into this and you can follow these steps to clear the cache.
Delete the contents from the following folders
C:\Users\<>\AppData\Local\Microsoft\Team Foundation
C:\Users\<>\AppData\Local\Microsoft\VisualStudio
C:\Users\<>\AppData\Local\Microsoft\VSCommon
Go to the Visual Studio IDE folder in command prompt and Run the following command “devenv /resetuserdata” from the Visual Studio IDE folder.
Typical location for 64 bit: C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE
Typical location for 32 bit: C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE
Per:
https://blogs.msdn.microsoft.com/willy-peter_schaub/2010/09/15/if-you-have-problems-with-tfs-or-visual-studio-flush-the-user-cache-or-not/

Resources