[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More


Microsoft Visual Studio





Microsoft Visual Studio is an integrated development environment (IDE) from Microsoft. It is used to develop computer programs for Microsoft Windows, as well as web sites, web applications and web services. Visual Studio uses Microsoft software development platforms such as Windows API, Windows Forms, Windows Presentation Foundation, Windows Store and Microsoft Silverlight. It can produce both native code and managed code.

Share tech news, updates, or what's on your mind.

Sign up to Post

After converting my .NET website from VS 2015 on the server to a .NET Application in VS 2017 on my client, it seems that the events are no longer "wired up." AutEventWireup="true".

We have tried deleting the designer and rebuilding it.

None of the control events are working as before.

How can I fix this?
Acronis True Image 2019 just released!
Acronis True Image 2019 just released!

Create a reliable backup. Make sure you always have dependable copies of your data so you can restore your entire system or individual files.

Unable to install SSDT for 2017, SSMS for 2017 or SSRS for  2017 due to language mismatch.  I have a W10 Professional with SQL2017 and VS Community 2017 installed. In the log files there are messages about language mismatch and on the screen there are messages about unknown registry key. The language is English and I have been using the English version of the OS and the tools. Does anyone have any ideas on how to get past this? The few notes I have been able to find say it cannot be done.
Teaching myself Visual Studio C#
Creating a program born of necessity.

I have a form with a webBrowser control which opens a webpage.

On the webpage is a form which has 4 radio buttons
when  i open the webpage with the webbrowser i want it to automatically select this radio button(see below)

<input type="radio" name="SearchBy" onclick="SwitchCaseSearch(this.value, true)" value="0" id="Case" labelname="Search By:" labelvalue="Case">

I can make it work with a button with this code webBrowser1.Document.GetElementById("Case").InvokeMember("Click");
How do I make it work without a button after webpage is loaded.

Please be explain in detail.

Thank you in advance.
I've got a SSRS report which currently filters a dataset on "[ProgramID] = @ProgramID" and the report parameter is set to only allow a single selection.  This is currently done in the dataset which looks something like:

SELECT * FROM myTable WHERE ProgramID = @ProgramID

My client wants to change this to allow the user to select multiple Programs from the Program dropdown.

How do I modify the SQL query in my data set to accommodate this multi-select parameter?  I've tried a number of things and cannot seem to get it to work by modifying the SQL or by removing the criteria from the query and adding a filter to the tablix which uses the dataset.  I've searched and tried a number of "solutions" from here in EE and other web-sites and just cannot get this right.

Hello all!

I have a programs with 15 combo boxes that are populated with the following code:

public void Form1_Load(object sender, EventArgs e)
            //Create OleDB connection
                OleDbConnection connection = new OleDbConnection();
                connection.ConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\sccalla\Desktop\accessdb.accdb;
                Persist Security Info=False;";
                //Select all information from TaskNames Table
                OleDbCommand command = new OleDbCommand();
                command.Connection = connection;
                string query = "Select * From TaskNames";
                command.CommandText = query;

                //Display Tasks in Comboboxes
                OleDbDataReader reader = command.ExecuteReader();
                while (reader.Read())

Open in new window

Hi, in my Visual studio I have very annoyed property to highlight everything I type after I used search tool. Please see the attached screen shot.
How do I remove this.Capture.PNG
HI Team,

Project :

I am looking for chart control which full fill below requirement.

I have to generate chart control with binding data from ms sql server database tables and with this generated chart need to save in database table with good quality of image so i can use in some annual reports pdf documents.

i have used Kendo UI line chart control have the option to save as either SVG or canvas. I switched it to canvas, which may have improved performance but the image, when retrieved from the database, was of lower quality and performance is very slow to generate for all my 700 companies chart.so i have chosen 50 companies per page to render then save in db and repeating same process until it reaches end of all companies but still performance and quality is not as good and sometime we observed some charts are drawn with empty data or half of data loaded and saving in db, this happens randomly and unable to figureout what problem is......

control i used as below:

and The ASP.NET MVC version is just a wrapper around Kendo UI for jQuery

so i am looking for any other chart control which can do my job as draw chart from binding data from tables and save chart images into table with good quality and good performance or how can i improve here

Please,I need your suggestion on this.
I have  a MFC console application created using Visual Studio 2017,
Log.h file
class CLog


	static	void Log(LPCTSTR str, BOOL bError = FALSE); 
	static	void Log(LPCTSTR str, BOOL bError, LPCTSTR szFileName);
	static void SetPathName(CString& strName);
	static CString m_strLogPathName;

Open in new window

#include <afxwin.h>
#include "Log.h"

using namespace std;


void CLog::Log(LPCTSTR szMsg, BOOL bError)

void CLog::Log(LPCTSTR szMsg, BOOL bError, LPCTSTR szFileName)
void CLog::SetPathName(CString& strName)
	CLog::m_strLogPathName = strName;

Open in new window

The above code is giving the compilation error:

Error      LNK2001      unresolved external symbol "public: static class ATL::CStringT<wchar_t,class StrTraitMFC_DLL<wchar_t,class ATL::ChTraitsCRT<wchar_t> > > CLog::m_strLogPathName" (?m_strLogPathName@CLog@@2V?$CStringT@_WV?$StrTraitMFC_DLL@_WV?$ChTraitsCRT@_W@ATL@@@@@ATL@@A)      TestH1      D:\Test\TestH1\TestH1\Log.obj      1      
Error      LNK1120      1 unresolved externals      TestH1      D:\Test\TestH1\Debug\TestH1.exe      1

Thanks for your help
I am writing unit test cases using xunit, moq and c# in visual studio core. my methods get results from database and returns employee object. I would like to write unit test cases without hitting DB. Please find attached class and interfaces.
i have multiple ms accounts and I always use visual studio community 2015 IDE as well as TFS Online.
My issue is: sometime MS Visual Studio keeps remember my first ms account for e.g. client A. When I try to sign out and sign in another MS account for client B - TFS online
It does not allow me to connect client B - TFS online. Seem like the cache issue but have no idea how to fix it
Creating Active Directory Users from a Text File
Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

I tried to install Visual Studio 2017 Professional but it failed due to lack of disk space.

So when I opened my Visual Studio 2008 SSIS project, I get this error:

Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)) (System.Windows.Forms)
In Visual Studio, Integration Services, I have a SQL source and an Excel destination.  Is it possible to create an initial step that deletes the contents of the Excel file, except for the column headings.
I am trying to create SSAS tabular model. I have a stored procedure which i can pass parameters which is suppose to pull in some result set.

I go to visual studio>Model>Import from Data Source>Microsoft SQL Server. I put in the servername where the database is and use windows authentication and provider the credentials. Then i select "Write a query that will specify the data to import" and i put the stored procedure with the parameter. It validates fine but at the table import wizard i get the error which i have attatched.

Its wierd because if i just use a test proc where i pass in a parameter(integer) and it returns a date. This works and i get the data set.

So i am not sure if it is this proc related. I read somewhere it may be because of the use of CTEs. So i changed the proc to use physical tables instead of CTEs, still i am getting the error. I also used set no count on. This also did not help.
I am using visual studio 2010 for a  web application with gridview populated by dataview source of which is a datatable.
One of the fields diffimt is numeric field defined as follows:
 DataColumn diffimt = new DataColumn("diffimt", typeof(int));
I wanted the dataview and hence the gridview to be sorted in the ascending order of the field
dView.Sort = "diffimt ASC";
After the sort command, gridview is source to dataview and then databound with the following commands
dView.Sort = "diffimt ASC";

                GridViewVa.DataSource = dView;

But it is sorting as if it is a text field.  Screeshot is depicted in the attached file.  As for my requirement, the sorting should be
12,13,102,102,107…….. Not 102,102, 107 …
Can anyone help in fixing the problem
I have googled this one and despite numerous suggestions I have not succeeded and yet it seems so simple.
In visual studio community 2017 edition, I have a vb web application which includes an XML file of program settings which I do not want to embed, I want it to stay as an .xml file so the site's behavior can be altered without recompilation.
When I run the web application in debug , the output folder shows the web app DLL of the compiled web app and no XML file and the program fails to locate it.
The file is set to Copy to Output directory and I have tried Content, Additional Files, None, to no avail, it never copies.  If I copy the XML file to the output folder whilst in debug mode it works so the question is why does my XML file not copy to the output directory.
I have included the xml file at the top level of the project.  
What needs to happen for the web app to copy the XML file to the temporary debug iis express folder so my website can find it and work?
Thank you,
I cannot get HttpContext to work in ASP.NET Core.

 public string GetCartId()
            if (HttpContext.Current.Session[CartSessionKey] == null)
                if (!string.IsNullOrWhiteSpace(HttpContext.Current.User.Identity.Name))
                    HttpContext.Current.Session[CartSessionKey] = HttpContext.Current.User.Identity.Name;
                    // Generate a new random GUID using System.Guid class.     
                    Guid tempCartId = Guid.NewGuid();
                    HttpContext.Current.Session[CartSessionKey] = tempCartId.ToString();
            return HttpContext.Current.Session[CartSessionKey].ToString();

Open in new window

 Visual Studio keeps coming back with red squiggly lines under the words HttpContext and the Error message "The name 'HttpContext' does not exist in the current context."

As a bit of background, I'm making two big leaps at once: (a) trying ASP.NET Core for the first time and (b) trying to use C# for the first time after years of just VB/asp.net.  I like a challenge!  To help get me there, I'm using a few online guides:
Getting Started with EF Core on ASP.NET Core with an Existing Database
ASP.NET Shopping Cart

In effect, I've followed the first link through from starting a blank project to setting up database CRUD pages and tested - all good.  However, when I insert the shopping basket page from the second link, it errors on anything HttpContext related.

In an attempt to fix this, I've followed the suggestions on  ASP.Net Core Session State, added the relevant code hightighted in yellow for the startup.cs page - but to no avail.
I'm trying to investigate a problem with resource files generated by Google Omaha. These resource files contain a place-holder token (%1!s!), which is substituted with branding details during the build process. There are numerous language resource files that contains string tables and this

Here is an example string: "%1!s! some arbitrary text"

Where %1!s! is a place-holder for some substitution text?

My question: is this place-holder substitution mechanism a standard part of the Windows resource file mechanism? If so, can someone please either explain how it works? Where does it get the text used to substitute the place holder? I'm assuming the place-holder works similar to place-holders in printf? If so, how does it know which text token to replace this with? If this is not a standard resource file mechanism, does anyone have a clue as to how Omaha does this during the build process?

Many thanks.

Note: I'm not looking for suggestions to use a different approach. This is how Omaha does it and I just need to understand how this works. Thank you.

Installed : Visual Studio 2017 Community

When I go to "Source Control Explorer" I cannot add folders or files - "New Folder" and "Add Items To Folder" are both greyed.

I have The correct plug-in selected and The TFS database is created.

Anyone know what I need to do please?
Having bought a new machine (running Windows 10 professional) I Have installed the following:

MS Visual Studio 2017 community
MS SQLServer express 2017
Team Foundation Server express 2015

I find that I do the have the option in VS to "Connect to Team Foundation Server"

I have "Visual Studio Team Foundation Server" set as the Source-Control Plug-in.

I can see my server in Source Control Explorer but cannot add folders or items.

If I go into Team Explorer I can see GIT repos   (dunno how to use these) and I can sometimes add a solution to Source control whereby it is visible in Source Control Explorer temporarily.

How can I connect to TFS correctly in VS 2017 Community please?
OWASP: Forgery and Phishing
LVL 12
OWASP: Forgery and Phishing

Learn the techniques to avoid forgery and phishing attacks and the types of attacks an application or network may face.

Visual Studio 2005 crystal reports only shows half of print preview, The right half is faded out...
See attached.

Any ideas?
How would I call this subroutine from a button click.. passing parameters.

private void SelectionSort(long[] list, int min, int max)
I'm not successfully running my subroutine in visual studio code. How can I run this is Visual Studio code?
using System;

namespace SelectSort
    class Program
   static void Main(long[] list, int min, int max) {
  int ic;

    long best_value;
    int best_j;
    for (ic = min; ic <= max - 1; ic++)
        best_value = list[ic];
        best_j = ic;
        for (var ji = ic + 1; ji <= max; ji++)
            if (list[ji] < best_value)
                best_value = list[ji];
                best_j = ji;
        list[best_j] = list[ic];
        list[ic] = best_value;


Open in new window

I am new to UWP / XAML / WPF / Windows Store apps.  I am running Windows 10.

Is the ApplicationFrameHost a process that is responsible for running Universal Windows apps?  Does the debugger make use of it?

If there are no UWP apps running, in the debugger or otherwise, should this process still be running?

If I am running a UWP app in the Visual Studio 2015 Community debugger and I close the app - why does it take like ... 10 to 15 seconds for the debugger to stop?  Is that normal?
In an Xamarin Forms project under Visual Studio 2017, I can't get the FCM (Firebase Cloud Messaging) token for Android devices (.Droid project) to register it to FCM.

I created an application on the Firebase console, and retrieved the ApplicationId, ApiKey, ProjectId and GcmSenderId.

Here is the code I use in the .Droid project on Xamarin.Forms:

var options = new FirebaseOptions.Builder()

FirebaseApp app = FirebaseApp.InitializeApp(Android.App.Application.Context, options);
String token = FirebaseInstanceId.Instance.Token; // RETURNS NULL
String authorizedEntity = "xxxxxxxxxx";
String scope = "GCM";
String token2 = FirebaseInstanceId.Instance.GetToken(authorizedEntity, scope); // ALSO RETURNS NULL

Open in new window

I do not understand why the GetToken () function returns NULL.
Can you help me please ?

For the UWP project, I can recover it by the following method:
var channel = await PushNotificationChannelManager.CreatePushNotificationChannelForApplicationAsync ();
String Token = channel.Uri;

I followed this doc:

Microsoft Visual Studio





Microsoft Visual Studio is an integrated development environment (IDE) from Microsoft. It is used to develop computer programs for Microsoft Windows, as well as web sites, web applications and web services. Visual Studio uses Microsoft software development platforms such as Windows API, Windows Forms, Windows Presentation Foundation, Windows Store and Microsoft Silverlight. It can produce both native code and managed code.