Migrating windows 8 store app to 8.1 sqlite issue - sqlite

Currently, I am trying to retarget my windows store app to windows 8.1 preview. The problem is, that I used sqlite-net package in one of my project. I followed steps described here:
http://www.lyalin.com/2013/07/09/sqlite-for-windows-runtime-for-windows-8-1-apps/ and downloaded pre-release version of sqlite visual studio extension from this link:
http://www.lyalin.com/2013/07/09/sqlite-for-windows-runtime-for-windows-8-1-apps/.
I have added a reference to a newly installed sqlite for windows runtime in my project, but I got an error while building:
Error 2 Windows Runtime type 'Windows.Foundation.Point' was found in
multiple referenced winmd files. Please remove either 'C:\Program Files (x86)\Microsoft
SDKs\Windows\v8.1\ExtensionSDKs\Microsoft.VCLibs\12.0\References\CommonConfiguration\neutral\platform.winmd'
or 'C:\Program Files (x86)\WindowsKits\8.1\References\CommonConfiguration\Neutral\Windows.winmd'
from the list of referenced files. C:\Users\Jarosław\Desktop\BCM\Win8Client\MetriceModel\WINMDEXP
MetriceModel (Windows 8.1)
Somewhere, on one of the forums somebody hinted, that if you remove reference to microsoft visual c++ runtime package from the project, it will solve the problem. After I did that whole solution compiled fine, but I got a following exception at runtime:
Unable to load DLL 'sqlite3': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
Exception is thrown at a line:
#if NETFX_CORE
SQLite3.SetDirectory(/*temp directory type*/2, Windows.Storage.ApplicationData.Current.TemporaryFolder.Path);
#endif
of SQLite.cs file (file is from mentioned earlier sqlite-net package).
Project's folder bin/Debug/AppX contains file sqlite3.dll. Every project in my solution has x86 as a platform target. How do I fix this issue? Before migrating the project everything worked fine.

You must install the official version of vsix package on sqlite download page (v3.8.0.2).
In the Visual Studio Add-in manager, this package version is 3.7.1.17 and it's not correct.
After, i think it is a bug, you have to select the good processor (platform target).
I had the same error because I deployed a migrated winrt application (8.1) compiled in x86 on a x64 machine...
=> in windows 8.0 it works, but not in windows 8.1.
If you have a x64 machine you have to select the x64 target compilation. I hope it will be fixed in futur...

can you please re-install the preview of SQLite for WinRT 8.1? There was an issue with the initial package, but we worked with them to update. http://sqlite.org/download.html

If you have an exception with
SQLite3.SetDirectory(/*temp directory type*/2,windows.Storage.ApplicationData.Current.TemporaryFolder.Path);
Check if your project uses x86 and not any CPU

Related

QT Creator cannot find "objbase.h" when invoking nmake

When attempting to build my Qt project with MSVC2015 64bit for Windows 10, I get this error:
C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\Ole2.h:37: error: C1083: Cannot open include file: 'objbase.h': No such file or directory
...
NMAKE:-1: error: U1077: '"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\bin\HostX64\x64\cl.EXE"' : return code '0x2'
NMAKE:-1: error: U1077: '"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\bin\HostX64\x64\nmake.exe"' : return code '0x2'
-- when nmake is invoked during the build process.
This exact same error also occurs for the example project "addressbook".
It appears to be some kind of toolchain issue, but I can compile a Qt Widget project in Microsoft Visual Studio 2022 if I point VS at my Qt installation.
I'm not sure what I need to do from here, since I already tried a reinstall of Qt. I have seen that putting things in Program Files is generally a bad idea, but that doesn't seem to be the issue in this specific case.
It appears to be part of the Windows SDK, if Google leads me right. However, I did not have to download the Windows SDK separately in order to compile my project and run it successfully before. (For context, the project's been developed for a few months and this problem only emerged a week or so ago).
My QT Installation:
Kit: Desktop Qt 5.15.2 MSVC2015 64bit
Version: Qt 5.15.2 MSVC2015 64bit
Compiler: Microsoft Visual C++ Compiler 17.3.32811.315 (amd64)
Things That Have Happened Before My Build Attempt:
I recently reinstalled Qt 5.15.2 in an effort to resolve a similar missing file issue.
The company's recently had issues with Microsoft Intune deleting applications. Maybe it hit the Windows SDK too.
Attempts at Solving the Issue
Reinstallation of Qt 5.15.2
Expected: My project building without errors. Result: This error.
Search of file system for objbase.h
Expected: Finding the file. Result: I did not find the file.
I'm newish at Qt, so I didn't want to try anything more esoteric lest I made things worse than before.
Update: MinGW 64 bit works for the example Qt projects, but I'd still like to use MSVC2015 if possible. It doesn't work for my project because I use some MSVC specific pre-processor flags in my source.
Update 2: I attempted to re-download MSVC 2015 from Visual Studio's website, using their Build Tools installer. While the installation successfully finished, I got no change from before -- it still can't find that "objbase.h" file. It's supposed to be in the Windows Kits directory under Include//um , I think.
It appears that, in my case, the objbase.h file was deleted due to the issue with Windows Defender deleting random files. I was able to reinstall the version of Windows SDK that was using and this fixed the issue for me.
I figured it out. I'm posting the solution here for others.
My issue was that, for reasons that are unclear to me, VS Studio Build Tools would not actually remove the SDK in question if I unchecked its box in the Modify screen. You can tell if this is happening by checking the disk size difference of the upcoming installation in the lower right of the screen -- if it won't remove the SDK, that size will be +0 bytes (assuming you don't check or uncheck any other box).
In order to properly reinstall the SDK version, I had to go to "Add or remove programs" and find the SDK there, uninstall it, restart my computer just for safety, and then go to VS Build Tools and install that SDK version. I had to do a "fake" uninstall with VS Build Tools (basically, uncheck the now-deleted SDK and click "Modify", allowing it to do the installation and download steps) before I could actually install the SDK again.

VSCode Omnisharp server A .NET 6 SDK for x86_64 was not found

Omnisharp does not seem to recognize my installed .NET sdk (version 6.0.408).
I have tried manually adding this path via settings to Omnisharp: SDK path i.e.:
C:\Program Files\dotnet\sdk\6.0.403
I have also tried reinstalling the SDK and even VSCode.
This does not seem to solve the issue however, and I am unable to run my asp.net application on VSCode. Running dotnet run from the terminal is fine.
TLDR: Both .NET SDK versions and Visual Studion versions needed to be x64.
Here was the exact error I was seeing in the Output Window:
[ERROR] A .NET 6 SDK for x86_64 was not found. Please install the
latest x86_64 SDK from
https://dotnet.microsoft.com/en-us/download/dotnet/6.0.
[ERROR] Error: OmniSharp server load timed out. Use the
'omnisharp.projectLoadTimeout' setting to override the default delay
(one minute).
When I realized there was a mismatch between my .NET SDKs and Visual Studio Code in terms of being x86 and x64, I did the following:
Deleted the bin/obj folders and .vscode folders in my VS Code project.
Uninstalled my .NET SDKs via Windows (Setings > Apps).
Uninstalled Visual Studio Code via Windows (Setings > Apps).
Installed .NET 7.0 x64 and .NET 6.0 x64.
Opened PowerShell and ran dotnet --info to make sure my .NET runtime and SDK were appearing correctly.
Installed Visual Studio Code x64.
Used PowerShell and cd'd to my project folder. Did a dotnet restore. Then launched Visual Studio Code using code . command.
I could then use the most current version of the VS Code extension (v1.25.2).
Uninstalling and then installing the VSCode extension C# for Visual Studio Code solved the issue for me.
I had the same problem and just solved it. Copy and pasting this from a Youtube comment I just finished writing, so it might sound funny out of context, but the good bits are in there. Hope it helps.
Installed dotnet 7.0, but then it said dotnet 6 was missing...
So I deleted the script asset, exited Unity, went back to their website and installed Net 6.0.403
Error still happened.
I'll note this seemed to push a script compiling error out to Unity in the inspector window, as well.
Deleted the script asset again, exited Unity again, then uninstalled both dotnet 7 and dotnet 6.
Then I reinstalled dotnet 6.
Into unity, made a new script, opened it, and this time no error message about missing net 6.
I just started yesterday. Literally. So if my solution is trash, I'll laugh with you lol. Best of luck.

Qt The application was unable to start correctly (0xc000007b)

Am trying to compile project found at uconfig, I managed to compile the application successfully using 32bit version mingw, yet when I run the .exe I get this error The application was unable to start correctly (0xc000007b), I moved all the required DLLs required to exe path but still getting same error,
on the other hand, the application starts in debug mode in Qt creator normally
After searching ... the reason was I had another verion x64 of Qt installed and /bin was added to system path. this resulted in conflict between DLLs generated from Qt and ones found in the System path
I fixed the same problem by running them as adminstrator (properties/compatability/Run as Admin)

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.

Using Visual Studio 2008 Web Deployment projects - getting an error finding aspnet_merge.exe

I recently upgraded a VS2005 web deployment project to VS2008 - and now I get the following error when building:
The specified task executable location "bin\aspnet_merge.exe" is invalid.
Here is the source of the error (from the web deployment targets file):
<Target Name="AspNetMerge" Condition="'$(UseMerge)' == 'true'" DependsOnTargets="$(MergeDependsOn)">
<AspNetMerge
ExePath="$(FrameworkSDKDir)bin"
ApplicationPath="$(TempBuildDir)"
KeyFile="$(_FullKeyFile)"
DelaySign="$(DelaySign)"
Prefix="$(AssemblyPrefixName)"
SingleAssemblyName="$(SingleAssemblyName)"
Debug="$(DebugSymbols)"
Nologo="$(NoLogo)"
ContentAssemblyName="$(ContentAssemblyName)"
ErrorStack="$(ErrorStack)"
RemoveCompiledFiles="$(DeleteAppCodeCompiledFiles)"
CopyAttributes="$(CopyAssemblyAttributes)"
AssemblyInfo="$(AssemblyInfoDll)"
MergeXmlDocs="$(MergeXmlDocs)"
ErrorLogFile="$(MergeErrorLogFile)"
/>
What is the solution to this problem?
Note - I also created a web deployment project from scratch in VS2008 and got the same error.
Apparently aspnet_merge.exe (and all the other SDK tools) are NOT packaged in Visual Studio 2008. Visual Studio 2005 packaged these tools as part of its installation.
The place to get this is an installation of the Windows 2008 SDK (latest download).
Windows 7/Windows 2008 R2 SDK: here
The solution is to install the Windows SDK and make sure you set FrameworkSDKDir as an environment variable before starting the IDE. Batch command to set this variable:
SET FrameworkSDKDir="C:\Program Files\Microsoft SDKs\Windows\v6.1"
NOTE: You will need to modify to point to where you installed the SDK if not in the default location.
Now VS2008 will know where to find aspnet_merge.exe.
I just ran into this same problem trying to use MSBuild to build my web application on a server. I downloaded the "web" version of the SDK because the setup is only 500KB and it prompts you for which components to install and only downloads and installs the ones you choose. I unchecked everything except for ".NET Development Tools". It then downloaded and installed about 250MB worth of stuff, including aspnet_merge.exe and sgen.exe
You can download the winsdk_web.exe setup for Win 7 and .NET 3.5 SP1 here.

Resources