Microsoft Visual Studio

661

Solutions

709

Contributors

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

Hi All,
Advance thanks for the great solution!
Am using Visual studio 2017 ,c#, MVC. I need to use electronic signature in the .csthml page. I was given strict protocol to follow like not to adapt any third party. i need to capture the signature and display at end of the .cstml page.Please help me or guide me how to do that please...

Kind regards,
Pooja
0
Firewall Management 201 with Professor Wool
Firewall Management 201 with Professor Wool

In this whiteboard video, Professor Wool highlights the challenges, benefits and trade-offs of utilizing zero-touch automation for security policy change management. Watch and Learn!

The goal is to get a 64 bit ODBC connection to an Oracle DB. I have to install Oracle Instantclient_11_2 on a fresh install of Windows Server 2012 nothing else. I am getting an error when trying to setup an 64 bit ODBC connection to a database not on this server but the DB is on a different one.  
In order to get Oracle Instantclient_11_2 installed I came across a message that said to install Microsoft Visual C++ 2005 Redistributable Package (x64)  in order to get it working. So I installed it from this link. MSVisualC++2005RedistibutablePackage
I do not know if that is conflicting with this process and I should get an application that is more recent to the Win Server 2012 ??? Does anyone know if I should or could be using a more recent that would not conflict with the Oracle_11_2?
I read and read and found this. So I understand some of it from this link. Side-By-SideConfigurationError
I looked at the event log and get the following.
Activation context generation failed for "C:\Oracle\Instantclient_11_2\SQORAS32.DLL". Dependent Assembly Microsoft.VC80.MFC,processorArchitecture="amd64",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="8.0.50727.762" could not be found. Please use sxstrace.exe for detailed diagnosis.
Then the Error:
- System

  - Provider

   [ Name]  SideBySide
 
  - …
0
Have aa SSRS report which has a table near the top with case information.  In SSRS, this table is formatted to be 7.5" wide, and displays like:
SSRS formatBut when my users export this report to Word, that same section of the report is shrunk (horizontally) so that it displays in about 5.25" and looks like:
Word outputWhile the rest of the tables all retain their 7.5" width and the proper appearance.

Although this table is editable in Word, and the client can widen columns to get it to fit appropriately, they would prefer to focus on content, not layout (my job).

Any ideas what is causing this and how to fix it?
0
When I compile someone c# code, I got the following warning.  What do I need to resolve this? Any idea?

The primary reference "xxxConfiguration" could not be resolved because it has an indirect dependency on the assembly "xxxAsync, Version=7.05.101.0, Culture=neutral, PublicKeyToken=58aa7495915e0000" which was built against the ".NETFramework,Version=v4.6" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.5".
0
My ASP.Net MVC web application have the following Javascript errors:
Uncaught SyntaxError: Unexpected token <
Uncaught ReferenceError: Sys is not defined
Uncaught ReferenceError: WebForm_AutoFocus is not defined

Open in new window


This is how it looks like in Firefox console:
Error
And these are the source code view of the relevant references and javascript.
Source
Source - javascript 1
Source - Javascript 2
How do the errors happen and how to fix them?
0
I have noticed after the latest rounds of W10 updates that I can no longer deploy any of my class libraries unless I start VS as Administrator.
I am trying to deploy class libraries into folders of programs that are located in the C:\Program Files (x86) folder. The message when I try to deploy is "Access Denied" and it is referring to the folder I am tying to drop the dll into for the program. I am using VS Community 2017. I know one fix is to no longer install programs into the C:\Program Files (x86) folder but that is counter intuitive as to why that folder is there. What is best practice in a situation like this?
0
Need a Visual Studio VB script to modify SAPI (5.4) to recognize words such as 'gimmie' in place of 'give me', or 'myname' in place of 'my name'.
I know SAPI provides for this capability; however I am a tcl\tk programmer.

Please advise.
0
I'm using visual studio 2017 command prompt to build the project, with following command

msbuild myproject.csproj /p:configuration=Release /p:outputpath="C:\publishfolder", and it fails. and the I have multiple similar errors

"C:\repos\myproject.csproj" (default target) (1) -> (_CopyWebApplicationLegacy target) ->  
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Microsoft\VisualStudio\v15.0\WebApplications\Microsoft.WebApplication.targets(182,5):
error MSB3030: Could not copy the file "Scripts\jPlugin\blank.gif" because
it was not found. [C:\repos\myproject.csproj]

I had deleted the plugin I was using, in this path "Scripts\jPlugin", and looks like during build it is trying to copy the file , which is not there.
I also made sure Microsoft.WebApplication.targets existed in C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Microsoft\VisualStudio\v15.0\WebApplications\.

I tried to publish directly from visual studio as well, in the error list, I can see the same error, the error is the same but the source in the error list in visual studio is IntelliSense.

Copying file Scripts\jPlugin\blank.gif to obj\DEV\Package\PackageTmp\Scripts\jPlugin\blank.gif failed.
Could not find a part of the path 'Scripts\jPlugin\blank.gif'.            

I'm not sure, why it is trying to copy the gif file which is not there. is there a cache , that visual studio maintains that i'm not clearing.


any thoughts on this?
0
I am new to Xamarin and MvvmCross learning with an online tutorial, https://visualstudiomagazine.com/Articles/2018/05/08/Build-a-Xamarin.Forms-Application.aspx which comes with a github code sample at https://github.com/nickrandolph/VisualStudioMagazineMobileCorner 
 
This is clearly a simple application with just a few lines of code, but I ran into a namespace error that prevents the code from compiling. I also tried a different tutorial, the tipcalc tutorial provided by MvvmCross at https://www.mvvmcross.com/documentation/tutorials/tipcalc/the-tip-calc-tutorial but got the exact same namespace error.

Hoping someone can help identify what I am doing wrong. I have used the nuget packages for MvvmCross 6.1.2 and  MvvmCross.Forms 6.1.2 together with Visual Studio 2017 15.7.2. I also installed the Android 8.1 Oreo (SDK Platform 27) since both tutorials mention Android 8.1. No luck getting rid of the namespace issue.

The compilation error is in two parts:
(1) Missing Namespace: "The type or namespace name 'Platforms' does not exist in the namespace 'MvvmCross.Forms' (are you missing an assembly reference?)" on the using statement, "using MvvmCross.Forms.Platforms.Android.Views;"
(2)Missing class:  "The Type or Namespace Name MvxFormsAppCompatActivity Could Not be Found"

Both errors are in ...\XFwMvx.Android\MainActivity.cs
0
Is it possible to open a terminal (integrated terminal) in visual studio code once a powershell terminal and after that a command line terminal (dosbox) without changing the default terminal, via shortcuts ?
0
Simplify Active Directory Administration
LVL 8
Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

I am an Access programmer. I posted a question to convert access application to web based.  Now I am planning to move to web development. I came to know there is no way you can convert or move directly to web based programs.
I appreciate if you show some guidelines to start a web program (as if I am new to development).
Appreciate your help.
0
I am trying to open an excel  file using C# and visual studio 2017  without success. The excel is from office 2016 and the code which i used is:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;
using Microsoft.Office.Interop.Excel;
using Excel = Microsoft.Office.Interop.Excel;



namespace WindowsFormsControlLibrary1
{
    public partial class UserControl1: UserControl
    {
        public UserControl1()
        {
            InitializeComponent();
        }

        static void openfile()
        {
            string fileTest = @"C:\\try.xlsx";
            
             var excelApp = new Excel.Appication();
            excelApp.Visible = true;

            Excel.Workbooks books = excelApp.workbooks;
            Excel.Workbooks sheet = books.Open(fileTest);
        }

        private void UserControl1_Load(object sender, EventArgs e)
        {
            
        
           
          
    }

        private void button1_Click(object sender, EventArgs e)
        {
            openfile();
        }
    }
}

Open in new window


When i try to build the solution i receive the error below :

Severity      Code      Description      Project      File      Line      Suppression State
Error      CS0234      The type or namespace name 'Appication' does not exist in the namespace 'Microsoft.Office.Interop.Excel' (are you missing an assembly reference?)      WindowsFormsControlLibrary1      C:\Users\Administrator\Desktop\Read_excell_file\WindowsFormsControlLibrary1\WindowsFormsControlLibrary1\UserControl1.cs      29      Active

Severity      Code      Description      Project      File      Line      Suppression State
Error      CS0266      Cannot implicitly convert type 'Microsoft.Office.Interop.Excel.Workbook' to 'Microsoft.Office.Interop.Excel.Workbooks'. An explicit conversion exists (are you missing a cast?)      WindowsFormsControlLibrary1      C:\Users\Administrator\Desktop\Read_excell_file\WindowsFormsControlLibrary1\WindowsFormsControlLibrary1\UserControl1.cs      33      Active


Also i add reference in the project  as you can see at the attached file.




What is going wrong with the code?
reference1.png
0
Xamarin question:
I must be missing something simple and cannot seem to find the right words to get a Google response that is relevant.
I have been working on my Android app in an emulator and a device that is connected via cable.  When I disconnect the device from the computer, the program fails to function.
How do I push the app from Visual Studio, to a device and have it work without being connected via cable?
Thank you for any guidance you can provide.
0
I just installed Visual Studio Community 2017 with the SSDT tool kit, connected to my SQL server opened a table  but Diagram, Criteria and Results panes are grayed out. In "Tools" | "Options" | "Database Tools" | "Query and View Designers" all the checkboxes for the Diagram Pane, Criteria Pane, SQL Pane and Results Pane are checked. I am extremely new to VS I normally do all my work in SSMS.
0
I have to support a Visual Studio 6 C++ file. I've extracted the code which has two projects. One is the code for a DLL and the other for a LIB file. In trying to compile as is, I get an error that says Link.exe couldn't load the LIB file.

Since c++ is not a language I've worked with before, what are the steps to compile. Is there a "make" process first? When I look at the dsp file, it says that it is not a valid file and to make and run.

I'm missing something pretty simple I'm sure. The program was written in the late 90's. I just want to convert it to Visual Studio 2010 or 2015.

I tried converting it to Visual Studio 10 but most of it is not translated. I've attached one .7z which contains two 7z project to expand into a c++ workspace.
0
Hello Guys
Visual Studio 2013
DevExpress for WInform 18.1

I have created a user control with search lookup edit with some setting which are to be used in whole software.
now i need this user control to be shown in grid as repository item.
Following is the code for User Control
Imports DevExpress.XtraEditors
Imports System.ComponentModel

Public Class UxSLECity
    Private Sub UCSLECity_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Call Sb_Control_Settings()
    End Sub

    Private Sub Sb_Control_Settings()
        Dim l_MaxSize As Size
        l_MaxSize.Height = 22
        l_MaxSize.Width = 0
        Me.MaximumSize = l_MaxSize

        Dim l_MinSize As Size
        l_MinSize.Height = 22
        l_MinSize.Width = 50
        Me.MinimumSize = l_MinSize

        Me.BorderStyle = Windows.Forms.BorderStyle.None

        SLECity.Dock = DockStyle.Fill

        With SLECity
            .Properties.DisplayMember = "Medication"
            .Properties.ValueMember = "ID"
            .Properties.View.Columns.AddField("ID").Visible = False
            .Properties.View.Columns.AddField("Medication").Visible = True
            .Properties.DataSource = Fnc_CreateDT()
        End With

    End Sub

    Private Function Fnc_CreateDT() As DataTable
        Dim l_DT As DataTable = New DataTable("medications")
        With l_DT
            .Columns.Add("ID")
            .Columns.Add("Medication")
            .Rows.Add(1, "atenolol")
            .Rows.Add(2, 

Open in new window

0
Hello Experts,
I am trying to run a SSIS package using Visual Studio 2015.  When execute it with Start Debugging mode, the package runs just fine.  But when run in Start Without Debugging it fails with the below error message.  Any idea what is going on?  Please try to help.  Thank you in advance.

Error Message:  The task has failed to load. The contact information for this task is ""

Thank you!
0
I created a windows forms application using visual studio 2015.  My app connects to a SQLSERVER (SQLEXPRESS).
I Publish the app by creating a shortcut to the release bin directory on a network drive.  All was working well but recently I started
getting the following error on some computers.

 A network-related or instance-specific error occurred while establishing a connection to SQL Server.
The Server was not found or was not accessible. Verify that the instance name is correct and  tat SQL Server is configured to allow remote connections.
(provider: TCP Provider, error: 0 - An invalid argument was supplied.)

I use a static connection string, and it is working on some computers.  I Published the app to a network drive, and it ran ok.  I am not sure what the publishing does,
but I would rather just run it from the bin directory.
0
Hi,

I am working on the Visual Studio Code editor, I want to achieve is that whenever i make changes to my code and save the file the date, time and a variable string(to be used to summarize what changes done) should be automatically created in the header section of my file where my comments are already inserted. A sample is provided below.

/***************************************************************************************************
Procedure:          dbo.usp_DoSomeStuff
Create Date:        2018-01-25
Author:             Joe Expert
Description:        Verbose description of what the query does goes here. Be specific and don't be
                    afraid to say too much. More is better, than less, every single time. Think about
                    "what, when, where, how and why" when authoring a description.
Call by:            [schema.usp_ProcThatCallsThis]
                    [Application Name]
                    [Job]
                    [PLC/Interface]
Affected table(s):  [schema.TableModifiedByProc1]
                    [schema.TableModifiedByProc2]
Used By:            Functional Area this is use in, for example, Payroll, Accounting, Finance
Parameter(s):       @param1 - description and usage
                    @param2 - description and usage
Usage:              EXEC dbo.usp_DoSomeStuff
                        @param1 = 1,
                        @param2 = 3,
                        @param3 = 2
                    Additional notes or caveats about

Open in new window

0
Cloud Class® Course: Microsoft Exchange Server
LVL 12
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

Hello,I have a project in winforms which takes care of the attendance of the students.In my project I have a form called AttendanceList which has the following:
-a textbox for the Serial number on the NFC tag( the attendance will be based on every student swiping the card over the card reader).
-a combobox where the teacher selects the Course and based on the course,when the teacher clicks a button,the list with all the students should appear.
- a datagridview which displays,updates and deletes the students.
The problem that i'm facing is that when a student registers,he will appear in table RegisterStudent(which is the table for all the registered students).I want to take the values from RegisterStudent(sNr,SN,fName and lName) and insert it in AttendanceList table.This is my method in doing so:
  private void LoadStudents()
        {
            using (SqlConnection conn = new SqlConnection(connstr))
            {
                try
                {
                    using (SqlCommand cmd = new SqlCommand())
                    {
                        string query = "insert into AttendanceList(SN,sNr,fName,lName) select SN, sNr, fName,lName from RegisterStudent p inner join StudentCourses c on p.SN=c.StudentId WHERE  c.CourseId = '" + cmbClassId.SelectedValue.ToString() + "'";
                      // cmd.Parameters.AddWithValue("@CourseId", cmbClassId.Text);
                        cmd.Parameters.AddWithValue("@SN", txtStudentId.Text);
               …
0
Hi,

I've got an SSIS package that looks in a folder for zip files and if it finds them it unzips all of them using C# using a reference to system.io.compression.

This is the example I've used:  example

Here is my code:
using Microsoft.SqlServer.Dts.Runtime;
using System.Runtime.InteropServices;
#region Namespaces
using System;
using System.Data;
using System.Windows.Forms;
#endregion
using System.IO.Compression;
using System.IO;
[assembly: ComVisible(false)]
namespace ST_51121ce851f54f58bb7a111e9711bfb7
{
  
    [Microsoft.SqlServer.Dts.Tasks.ScriptTask.SSISScriptTaskEntryPointAttribute]

    public partial class ScriptMain : Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTARTScriptObjectModelBase
	{
     
		public void Main()
		{
          
            string zipfullpath = Dts.Variables["User::ZipFullPath"].Value.ToString();
            string inputfolder = Dts.Variables["$Package::InputFolder"].Value.ToString();

            using (ZipArchive arch = ZipFile.OpenRead(zipfullpath))
            { foreach(ZipArchiveEntry entry in arch.Entries)
                {

                    try
                    {
                        entry.ExtractToFile(Path.Combine(inputfolder, entry.FullName));
                    }
                    catch (Exception ex)
                    {
                        //local variable to update error description
                        

Open in new window

0
ASP.NET C#
Visual Studio 2017

Description:
example of form
I am creating a form where the user clicks an image (image has runat='server' attribute), and then uploads a new image that replaces the old image.
( Note: that when the user uploads a new image it is renamed to exactly the same name as the old image. )

I'm using a hidden Fileupload control for uploading images.

Problem:
Initially ( when I upload the first version of the image ) everything works fine, but once I start uploading new images ( to replace the old ones ) I start getting the error:

System.IO.IOException: The process cannot access the file 'filename' because it is being used by another process.

Code Sample:
I do some validation checks and then something like:

try
{
    fileUpload.PostedFile.SaveAs(path);
}
catch (Exception ex)
{
     lblMessage.InnerText = ex.ToString();
}
finally
{
    fileUpload.Dispose();
}

Open in new window



I tried adding this to see if it works but I still have the same issue:
private void SaveFile(FileUpload fileupload, string path)
        {
            fileupload.PostedFile.SaveAs(path);
            const int numberOfRetries = 10;
            const int delayOnRetry = 1000;

            for (int i = 1; i <= numberOfRetries; ++i)
            {
                try
                {
                    fileupload.PostedFile.SaveAs(path);
                    break; 
                }
                catch (IOException e) when (i <= numberOfRetries)
                {
                    Thread.Sleep(delayOnRetry);
                }
            }
        }

Open in new window


I've also tried toggling images to see if that helps.  For example: If the current image is xxxxa.jpg then save as xxxxb.jpg.  But I still get the same error message.

Final Notes:
I am able to upload images but it seems to be random, sometimes it works and sometimes ( often ) I get the error message.  I've tested the same code on my desktop and everything works great but when I put it on the live server I start seeing the error message.
0
I decommissioned a database analysis server and need to move a tabular  model to a new server. I open the project in Visual Studio, change the workspace server yet when I try to compile I get "cannot build projects that contain more than one .bim file". There is only one .bim file in this project. Where is 2nd one?
0
I am using crystal reports version 13 and Visual Studio 2010. I have exported read only report version of all my crystal report i.e. rptr extension.

Now I am loading report (rptr) in asp.net page and exporting it to pdf. But it says 'unable to load report'
Please help me out.

Regards
0
Hi,
I am using VISUAL SOUCE SAFE 2005.
I got the error while creating the projects.
I send the screenshot of the my desktop.
Please find the solution.
Thanking you sir.
0

Microsoft Visual Studio

661

Solutions

709

Contributors

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.