Showing posts with label Visual Studio. Show all posts
Showing posts with label Visual Studio. Show all posts

Wednesday, July 15, 2020

xUnit Tests Not Running in Visual Studio IDE

You may have encountered that Test projects are not running or not showing in the Test Explore pane in visual studio. I also have faced similar issue while creating a new xUnit Test Project for my application. Here are the changes I did to solve the issue. Once installed the following packages, I was able to run the tests in test explore as expected.

  • Microsoft.NET.Test.Sdk
  • Microsoft.TestPlatform.TestHost
  • xunit.runner.visualstudio
  • xunit

Friday, June 24, 2016

Disk usage always at 100% in Windows 10

This usually happens me when I open visual studio 2013/2015.

After searching over the internet it was told to disable and stop running the Windows Services called "Superfetch" and "Windows Search" while it seems to have worked perfectly for many, it hasn't for me when I'm working with Visual Studio.

Disabling System Notification also perfectly worked for some people.  going to settings, system, notifications, and turning off "show me tips about Windows. This also makes disk usage 100% to 0%  as I have seen on many forms and threads.

Finally I found a solution which perfectly worked for me when working with Visual Studio. You can try this if non of the above mentioned fixes did not work for you.

Simply Try disabling Code Lens in Visual Studio IDE until a fix arrives.

Tools --> Options --> Text Editor --> All Languages --> Code Lens

Or just kill the ALM shared Remoting task. if it is very high CPU.

Monday, September 2, 2013

Create Database project with Visual Studio 2012

Introduction
You can use database projects to create new databases, new data-tier applications (DACs), and to update existing databases and data-tier applications by database Project templates in visual studio. This will enable the development team to manage databases changes and database servers by creating a DAC project, database project, or a server project via version control. Team Members can check out files to do changes, build, create and test changes in an isolated development environment, or sandbox, before check in to the version control for sharing them with the team. Once the team finishes and test all changes for a particular release of the database in a staging environment, Database Administrator can deploy the changes into production server.

Note: The database projects can be created in Visual Studio Premium & Ultimate versions only. 

Create a database project with VS 2012 
In this example, I will use the AdventureWorks2008R2 database to create, manage, and deploy changes to LocalDB database. Following steps will ensure you to create database project successfully.
 
Step 01 : Setup SQL Server database Tools 

Install latest database tools for Visual Studio 2012. Once its done, you can see SQL Server Object Explorer under View menu then click on it. It will display SQL Server Instances and a folder called Projects. Click Here to download Visual Studio 2012 Data Tools.  


Step 02 : Connect to the SQL Server instanaces
Right-Click on SQL Server –> Add SQL Server( connect via windows/server authentication) –> Expand the connected instance –> Right Click on AdventureWorks2008R2 –> Create New Project

Step 03 : Create database project using AdventureWorks2008R2 Database 



  • Connected instance (schema will be created based on this)
  • Database project name
  • Project Path
  • If this is checked, Unchecked this option (add to the version control once the after you build the project)
  • This will create sub folders for the db schema based on this(recommended 2-1000) eg: If you have 2000+ SPs, this will create proc1, proc2 ..etc. Then Click “Start”. This will create database schema project. 
Note: Based on the database schema, it will organize the project folders, sub folders as follows; 

Security folder contains the connected database's login users, roles..etc.

You may remove this folder from the the project solution since most of the time the production database has different user logins and roles we might not deploy the user logins that are using in development environment. But this may changed based on the project. 
Step 04 - Configure database project
  • Right-Click on the Project –> Properties –> this will show the database project configuration window.
  • Go to –> Project Settings tab –> Select the target platform: either Sql Server 2005/2008/2012
  • Go to –> Debug tab –> target connection string (default it will set to LocalDB). If you do not planned to create database schema into local, change it to eg: perseus/CropDBDev database. For more information about LocalDB click  here.
NOTE: The target connection string will be the place where the database project gets debugged.