How to set alias .\ for LocalDb? - localdb

I have installed LocalDb 15.0.4153.1 on my new development machine. It has been installed with Visual Studio 2022 on the fly. The setup created a default instance being called "MSSQLLocalDB". It works. I can connect with "(localdb)\MSSQLLocalDB" successfully.
However, on my other development machines I am able to access the instance with ".\" instead of "(localdb)\MSSQLLocalDB".
How can I access LocalDb with ".\" on my new development machine as well? I need the same behaviour on all of my machines.

Related

Windows Server 2016 on Virtual machine, Kiosk mode

I am trying to set up Kiosk Mode on a Windows Server 2016 set-up on a Hyper-V VM.
I have used Windows Imaging and Configuration Designer to create a Kiosk package but cannot apply it. When I use the Powershell cmdlet Add-ProvisioningPackage
I get an error saying:
'Add-ProvisioningPackage is not recognized as the name of a cmdlet'
Has anyone else had similar issues?
EDIT: Here is the full error, I tried both the folder path and also the .ppkg
EDIT2: It appears to not be possible on Windows Server 2016 to utilize provisioning packages.

Connect-ServiceFabricCluster : Argument 'Connect-ServiceFabricCluster' is not recognized as a cmdlet: Unable to load DLL 'FabricCommon.dll'

I installed Service Fabric by using the Install the Service Fabric runtime, SDK, and tools for Visual Studio 2015 Update 2 link from Prepare your development environment.
Trying to publish a Service Fabric Application fails with:
2>Connect-ServiceFabricCluster : Argument 'Connect-ServiceFabricCluster' is not recognized as a cmdlet: Unable to load
2>DLL 'FabricCommon.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
Same error described in Troubleshoot your local development cluster setup, but it does not matter what PowerShell version I use, 64 or 32.
The Service Fabric SDK version I got is 2.1.163.
I am running Windows 10 10586 with Visual Studio 2015 Update 3.
FabricCommon.dll is located at c:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code\FabricCommon.dll
What am I missing?
I will focus on this error first:
DLL 'FabricCommon.dll': The specified module could not be found
You can fix this by re-installing the service fabric SDK. This happens to me before during installation and I thought it was fixed but you never know.
Also make sure you are using the same version of the SDK and nuget package that you referenced in your Service Fabric application.
A workaround for this issue (which does not include reinstall of the Service Fabric SDK) is to add the following to your path environment variable and restart the application which is throwing error (Visual Studio or PowerShell so that it can access the new environment variable):
C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code
You do not need to restart your computer, just restart the application after you have update the path environment variable. The dll fabricCommon.dll lives in this folder.
This workaround is inspired by (but is not identical to) the solution to a somewhat related issue presented here: https://social.msdn.microsoft.com/Forums/azure/en-US/6c8cc261-6c84-4097-be03-e8073cbc9397/unable-to-load-dll-fabricruntimedll?forum=AzureServiceFabric&prof=required
All I had to do is restart Visual Studio and it worked. This happens time to time.
Please Run Windows PowerShell as Administrator and then try.
I have experienced the same problem on my Win10 box, and even adding the relevant powershell module that contained necessary cmdlets didn't work. The solution that worked for me was: Control Panel -> "Programs and Features", uninstall Service Fabric SDK, then click "Turn Windows features on or off" link and uninstall PowerShell. Next, reboot Windows, back to Control Panel -> "Programs and Features" -> "Turn Windows features on or off", install PowerShell, after which download/install Service Fabric SDK. Again, restart the PC, start the Service Fabric Cluster Manager (if it doesn't auto-start), right-click its icon on the task-bar and try creating 1-node or 5-node cluster.
I was facing same issue on vs2017 and window server 2016. I reinstalled service fabric sdk and issue fixed.
I had similar issue after creating a cluster on windows server 2016.
In my scenario all I had to do was log out/in again and issue was fixed.
You could try restarting VM too - only if it still fails would I try re-installing the SDK.

Setup a cluster on a remote machine without visual studio installed

I have a dedicated machine with Windows Server 2012.
When I debug service fabric in local environment, I only need to click Run in Visual Studio and the cluster creation and all the setups a performed automatically. I don't have to call any scripts or configure the cluster.
Is there a way to have such easy creation of a cluster on a remote machine without any manual config editing and without VS installed on the remote machine?
I have read how to install a cluster on-premises, but I don't want to configure anything. Guess if Visual Studio can figure out the right configuration, there could be a way to simplify the process for a developer.
Assuming that you're looking to set up a one-box configuration on the remote machine, you can do that as follows:
On the remote machine, set up a dev environment using the runtime and SDK only (no VS tools).
In an Admin PowerShell, run c:\Program Files\Microsoft SDKs\Service Fabric\ClusterSetup\DevClusterSetup.ps1.
This will set up a local cluster using the same configuration used by Visual Studio. In fact, all Visual Studio does is trigger this setup script.
Figured out that there are predefined templates for cluster's manifest. They are located inside Service Fabric SDK, \Microsoft SDKs\Service Fabric\ClusterSetup\NonSecure. Visual Studio use them to create a new cluster for development.
Not sure if we are able to obtain these configs without VS installed, but at least we can copy them from another development machine.

Sql Server 2008 R2 Web setup throws application error when starting FixSqlRegistryKey_x86.exe

I have Windows 7 64bit. I had Sql Server 2008 R2 Express installed. I unistalled it and then I tried to install Sql Server 2008 R2 Web. Unfortunatelly on the Setup Support Rules page for 'Consistency validation for SQL Server registry keys' I got 'Failed'. I spent half of a day trying to solve it, but then I assumed that there must be realy something wrong with registry keys and it will be faster just to reinstall Windows.
After formatting the disk and reinstalling Windows 7, rebooting dozen of times I installed all Windows upadtes as well. I also did install some programs like Skype, Thundirbird etc. which has no influence on Sql Server setup.
And then I tried again to install Sql Server 2008 R2 Web. And again an error. A bit different one. Now when the setup is on the Setup Support Rules page I get an error message box with the title "FixSqlRegistryKey_x86 - Application Error" and content: The application was unable to start correctly (0xc000007b). Click OK to close the application. 'Consistency validation for SQL Server registry keys' gets 'Failed' status as well.
My team mate has exactly the same machine as mine. He had no problem with installation (he didnt even need to reinstall Windows).
I run the setup as administrator, from a local folder. I even tried to use the setup files copied from my team mate, for a case if my copy is corrupted. In the setup options I have chosen the 'x64' version.
Any ideas what can be the reason of the problem?
Problem solved.
Someone suggested to me that Web edition should not be installed on Win 7 (just on Windows Server). So perhaps installing a different version would work. My team mate perhaps succeeded acidentially - due to having sql server installed already in express edition... but it is just a guess.
Before I tried to install another edition of SqlServer, I downloaded 2008 Express version and I started the install. From the temporary folder created by the express edition I copied FixSqlRegistryKey_x86.exe file and I had overwritten the problematic file in the Web setup with this file.
I started the setup again. It passed the verification this time. But has crashed on a later point - setup unpacks the installation files to C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\SQLServer2008R2 and runs from it. So I needed to again overwrite the problematic file in this location. Now the installation succeeded.

MSBuild deployment to machine outside of company network

Is it possible to deploy code (asp.net mvc application and Windows Service) to machine in public hosting (for example VM on Godaddy) using TFS MSBuild from internal network (company network)
All than I have is IP address of destination server, username and password. But I am not sure than TFS can deploy code at such machine.
When I doing it on local server, normally I specify path like this:
\machine-name\c$\deployment-folder\
But it is not working with remote machine.
Thanks.
Use a tool like InstallShield or Windows Installer XML to develop a Windows Installer database (.msi). Use TFS Team Build to build the MSI. Then use PsExec to copy the MSI to the remote machine and execute it.