We help IT Professionals succeed at work.

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.

I have an Excel VB.net add in that I built in a previous version of Visual Studio. In Visual Studio 2019 where do I reference
Microsoft.Office.Interop.Word.Application?

Thanks
0
I have a project on Visual Studio 2019 and using C/C++ open mp (Parallel) and openCV for image processing , When I tried to compile the project on Visual Studio 2019, I got two error messages
4.jpg
1.jpg
2.jpg
3.jpg
0
Hello, i'm trying to learn the basics of VB.
I have installed Visual Studio 2019
I have installed MySQL server and created a test db with a table and column.
I have connected the studio to MySQL successfully
I'd like to master creating a form and inserting, updating and displaying the contents of the db table.

I'm struggling to find a decent video tutorial of this. like how to program the save button and insert it into the db.

All the videos i find are either in very bad English or they describe very different methods from each other so i'm not sure which one i should be following.

can someone point me towards some good material please?
thanks
zac
0
Dear Experts
Based on the business processes we have identified solution development to be done in .NET Core framework with  Visual Studio using C# and MSSQL we have decided power BI for reporting and analytics( on-premise power BI report server) but customer have asked if possible to consider PostgreSQL, please help to understand on following
1.Application developing using .NET Core framework with Visual Studio using C# instead of MSSQL for database going for PostgreSQL will there be any complications, limitations and some thing that we have to comprise.
2.If we chose PostgreSQL as database server and front end application .NET Core framework with Visual Studio using C# and develop application but using power BI for reporting and analytics is there going to be any challenges, does power BI has connector to interface with PostgreSQL please let us know ,
Please help on above 1 and 2
0
My References.cs file (generated by my recent addition of a third party WSDL reference) is very large.  664,293 lines.  Often when I open the file, the Visual Studio 2019 IDE crashes and re-opens.

I guess I am taxing my Windos 10 OS by opening the file?

In Task Manager, CPU % usage jumps when I scroll the file.  So does RAM usage.  I can clearly see that the file is impacting my system.

But my question is not IF the file is large, but what to do about it?

Can the file be compiled somehow, so I still have access to the web methods in the WSDL without having to actually OPEN the References.cs file?  I mean, I know I don't have to OPEN the References.cs file in order to reference the methods, but I can't just delete the file, right?  I want to compress it or compile it or do something so it reduces the impact on my system.
0
Hello All
(Designed in Visual Studio 2017/2019)

It seems I have run into a snag.
This only happens when I am running the site LIVE and NOT from VS.
Running it through VS, it works as it supposed to.

Type 'AudioFileReader' is not defined

Open in new window

On this line
Dim reader As New AudioFileReader(filename) 

Open in new window


Now, I tried to register the NAudio.dll using.
gacutil -i NAudio.dll

Open in new window

However, I get the following line
Failure adding assembly to the cache: Attempt to install an assembly without a strong name

Open in new window


I followed the steps in this article here How to add Strong Name to an existing DLL and install to the GAC
But I get a FAILURE when trying to create the DLL file. (Maybe I am doing it wrong because I am not the owner of the file. Not really sure, this is the first time I have ever done anything like this and was trying everything I could find online)

Any assistance on this would be mighty grateful.

Wayne
0
This is probably an easy one for some, but I am not an expert in this, and I cannot find how to do this.
Short version:  I want to do a "Runas" cmd but pull the user name and password from text files.

Detailed version:  In a domain, we use "Security Groups" to control folder securities within the domain network.  When someone needs to have permissions to a folder, and they are already logged in, I add the user to the proper security group and then tell them they need to log off, and back on again.  As a work around to that, I have created a batch file that has the users user name in it and it will "Kill" the Explorer.exe and then start it up again, asking them to enter their password.  This does work, but having some simple minded users, they do not understand that when you enter your password, it will not show you any movement of the curser, so they will often mess it up. (I have had people who think turning off the monitor, and turning it back on again is the same as rebooting the computer).  This is the script I use for that.  It does work, but the normal user does not understand what to do. (User Name and Folder Name are replaced by me for each user.)

TaskKill /F /IM Explorer.exe
Timeout 5
Runas /user:mgl\{user name} Explorer.exe
Net Use U: \\mglfs01\{Folder Name}$

So, I thought I would 'try' to come up with something a little more "user friendly".  
Using Visual Studio 2107, I have created a "Windows App" that will show the windows for a User Name and …
0
Hi Experts,

I'm using Visual Studio Code.

I saw this cool extension:

Copy With Line Numbers
https://marketplace.visualstudio.com/items?itemName=yassh.copy-with-line-numbers&ssr=false#qna

The extension website menu shows that i will see a menu like this.

p1.PNG
But after I installed the extension, When I open up a C# or VB file I don't see that menu circled in red.

When I select all the code and right click the mouse button I just see this menu.
This copy, on this menu just a regular copy, it doesn't copy the line numbers.

p2.PNG



How do I launch that menu circled in red in the screenshot above, so I can copy code with line numbers using this extension?
Is their some keyboard shortcut keys I can use to copy?
0
I have a Linq query that looks like:
int[] state = ...;

                var rowsIndices = state
                    .Select((value, index) => new
                    {
                        Discriminator = index / 9,
                        Description = $"row #{index / 9 + 1}",
                        Index = index,
                        Row = index / 9,
                        Column = index % 9
                    })
                    .GroupBy(tuple => tuple.Discriminator);

Open in new window

And I would like to put this in a method which returns rowsIndices:
public ??? GetRowIndicies(int[] state)
{
            return state
                .Select((value, index) => new
                {
                    Discriminator = index / 9,
                    Description = $"row #{index / 9 + 1}",
                    Index = index,
                    Row = index / 9,
                    Column = index % 9
                })
                .GroupBy(tuple => tuple.Discriminator);
}

Open in new window

Except I don't know what to put for ???
Is it possible to return this Linq query as a method result?

Visual Studio gives the following:
Visual Studio rowsindicies
0
Need to configure IIS Express - localhost

I installed Visual Studio onto Windows 10. Then, I created a .NET MVC application, which compiles okay, but fails when I try and run it.

I have not configured IIS Express and am not even sure it is there.

LocalHost not reachable
How do I open IIS Express on Windows 10?

I need to configure the Virtual Directory, etc.


Here are my settings...
{
  "iisSettings": {
    "windowsAuthentication": false, 
    "anonymousAuthentication": true, 
    "iisExpress": {
      "applicationUrl": "http://localhost:61938",
      "sslPort": 44364
    }
  },
  "profiles": {
    "IIS Express": {
      "commandName": "IISExpress",
      "launchBrowser": true,
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    },
    "SampleWebApplication1": {
      "commandName": "Project",
      "launchBrowser": true,
      "applicationUrl": "https://localhost:5001;http://localhost:5000",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    }
  }
}

Open in new window


Thanks.
0
Using Windows 10: Is it possible to Edit Visual Studio Crystal Reports 2005.
0
I am using visual studio 2019; ASP.Net and VB.Net.  I am trying to open an older project (Web Site) that was developed on an earlier version of Visual Studio (2010).  I have several projects on this and they work.  However, I am trying to use this older version project in this VS 2019 environment and it contains Report Viewer.

Although the Report Viewer has been installed I cannot see the reference for it and I can't see it in the Toolbox nor is it available I the choose items list.

When loading the old folder into the vs environment I get errors - Could not load file and assembly 'Microsoft.ReportViewer.WebForms, Version:15.0.0....

How can I get this to work.  Below is my web config code snippet and you can see the report viewer is installed.

<system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <handlers>
      <add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    </handlers>
  
    <httpHandlers>
      
      <add verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    </httpHandlers>
    <compilation debug="true" strict="false" explicit="true" 

Open in new window

0
Some projects migrated from TFS to GIT repos.

The project in and of itself is set to use NuGet feeds (public and private) for some of the DLL's. So, the projects haves the packages.config and all.

In TFS, when we built the project it restored the Nuget items from the feeds and the build was no problem.

However, after we migrated to GIT and clone the repo. When we try to build it fails. It even says it restores the NuGet items from the feeds.

We do to the NuGet Packager Manager and it shows they are all installed yet the build still fails.

The only solution that we have found uninstalling the Nuget feed package items and then reinstall. Once we do all of them in the package then it will build and work.

Again, when it was in TFS we had no problem.  The NuGet Feed was still the same one as what we have in the GIT repo (which of course it should be.)

We shouldn't have to uninstall and reinstall ever time we clone.

Anybody have any ideas on this?

VS 2017 15.9.20. C# is used in the Projects.
0
Hi,

   I develop web application with Microsoft Visual Studio and ran it locally.When I deploy the web app to website,
it will interrupt all of online users.So I must deploy the web app to website at midnight.
I want to deploy the web app to website anytime and don't interrupt all of online users.Is it possible? Thanks a lot.
0
Need .NET Framework VDI / VM Preconfigured

Are there VDI's where Visual Studio / SQL Server / Source Code Management

come pre-installed? That would save me some potential aggravation...

Thanks
0
I am testing some web parts in SharePoint 2019 that were developed for SharePoint 2010. I have installed Visual Studio 2019 on my dev server, and the projects have been upgraded when Visual Studio offered to do so.When I try to deploy a web part, I get the error: "Error occurred in deployment step 'Recycle IIS Application Pool': Cannot connect to the SharePoint site: http://ehnordic/default.aspx/. Make sure that this is a valid URL and the SharePoint site is running on the local computer. If you moved this project..."
I have double-checked the URL (it is an internal URL) and it is correct. Then why do I get this error?
0
Hi Experts,

I'm trying to map my Source Control Folder to my Local Folder.

I have set this up in the Edit Workspace dialog:

Edit Workspace dialog

So the Local Folder is D:\Dev-Ver7.0\VB.NET\VB.NET

But when I open the Source Control Explorer, the Local Path is shown as Not Mapped.

Clicking the Not Mapped hyperlink opens the Create a workspace mapping dialog:

Create a workspace mapping
The local folder is blank.  I pasted in the Local folder.
Clicking Map give this error:

The path D:\Dev-Ver7.0\VB.NET\VB.NET is already mapped in workspace SURFACE5_CIRCLY_7.0.

I have tried deleting the workspace and re-creating it, but still get the same error.

Regards,
Leigh
0
Hello Gents
I am working for a MS partner i have a customer who is asking me to provide Azure devops Server
I dont know about the licensing of this product

is it a Server and client licences product?
He did ask me about Visual Studio in the same request how are these related
0
original error causing showing upHello,

A strange problem popped up on Visual Studio 2019 today.  Both Projects were created recently in VS2019 vb.net

1) Project A built and working no problem on my machine and everyone else's machines.  It includes a reportview v 15.0.
2) Project B needed a new report made but I wanted to make it a local report (populated with data that was already queried and brought down from the server and residing in a dataset).  I couldn't remember how to do this so I was fiddling with some of the settings in VS 2019 for THAT project and THAT report.  So I thought...

3) When I return to Project A I get a "required privilege is not held by the client" error when executing the reportviewer1.refresh command.  Everything else in the program seems to be working fine.  Earlier versions of Project A produce the same error BUT ONLY ON MY COMPUTER.  Everybody elses works just fine.  I broke something somewhere but I have no idea where to start looking.

Any ideas are welcome.  I've already flushed out the bin, reset VS settings, Reloaded the reportviewer references, and now the project won't build at all.  Got worse as I tried to fix it....

Thanks
0
To Whom it may concerns,

I notice that when I copy paste a script into the thread, recently it does HTML formatting and breaks all of the indentings. See the below for example.

$ListOfServers = Get-ADComputer -Filter {Enabled -eq $True -and OperatingSystem -like "*Server*"} -SearchBase "DC=Domain,DC=com"
# If you want in in a text files containing server list or names    
#$ListOfServers = Get-Content "c:\temp\serv.txt"

Foreach ($Server in $ListOfServers) {
    Invoke-Command -ComputerName $Server -ScriptBlock {
        # Get Certificate list and assign to a variable
        $Certs = Get-ChildItem "Cert:\LocalMachine\My" -Recurse

        #To get a list of all cert storage locations.
        #(Get-ChildItem -Path "Cert:" -Recurse | Where-Object {($_).GetType().Name -eq 'X509Store'}).Name        

        # Loop through each object in $Certs
        Foreach ($Cert in $Certs) {
            # If The objects property "NotAfter" is older than the current time, delete
            If ($Cert.NotAfter -lt (Get-Date)) {
                $Cert | Remove-Item -WhatIf # Remove the -WhatIf to make it run for real.
            }
        }
    }
}

Open in new window


Can anyone please suggest if this is a known issue in the new EE website or this is an issue in the Visual Studio code?
0
Hi, is there anyway to Stop SSRS from Building ALL reports when Previewing in Visual Studio ?

Many Thanks
0
If using price in vb in visual studio what would you assign the variable? I did not see currency listed would I use int? Thanks
0
WRiting code in visual studio vb to declare a variable that will store the cost of bananas per pound
0
Hi,
I'm pulling a list of customers from a MySQL(MariaDB) Database, and putting them into a combo box.  this part works fine.
However I need the associated ID once someone goes through the list and selects from the list.

I'm using c# and Visual Studio 2019.

Here is my method:



private void load_Customer_ComboBox()
        {

            con.Open();
            MySqlCommand sc = new MySqlCommand("SELECT CustomerName from bbb.Customers", con);
            MySqlDataReader reader;

            reader = sc.ExecuteReader();
            DataTable dt = new DataTable();
            dt.Columns.Add("CustomerName", typeof(string));
            dt.Load(reader);
            comboBox1.ValueMember = "Id";
            comboBox1.DisplayMember = "CustomerName";  
           
            comboBox1.DataSource = dt;
           
           
            con.Close();

           

            comboBox1.SelectedIndex = -1;
}

So when someone picks a value from the combo box, I need a way to get the Id that goes along with it.  I've looked on the net and there are many conflicting ways to do it, but not alot of solutions.

I think I have to pull the value out of 'SelectedItemChanged' property of the ComboBox, but not sure how to do it.

Any help would be appreciated.

Thank you!
0
I'm super flustered.  I have excel 365 and I have a column of numbers that absolutely wont convert to numbers.  I know datatype  = text because TYPE(F2) = 2.

The following approaches fail:
1.  I select the cells, right click format cells, try Number....it just doesn't work (why?)
2.  I try the following:  VALUE(F2) and I get an error:  "a value used is the wrong data type"

I don't understand why the VALUE(text) doesn't work?   I program in Visual Studio and I can insert any string into a value command and get back a number.  For example, a=VAL("Hello World") will get 0.  But in excel, this command results in an error:  =VALUE("d")    This would not result in an error in visual basic programming.    

I just can't seem to extract a number from text.

Please, any help would be appreciated.  I can't believe something so basic is so unintuitive.
0

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.