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

x

Microsoft Visual Studio

743

Solutions

790

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

We Published our first MVC 5 application to our IIS 8 development server using Web Deploy.  The deploy was successful however when viewing the website in a browser we noticed that many of the CSS styles were not working.

To troubleshoot, we looked at the files that Web Deploy moved to our server and compared them to what was in our Solution.  We noticed several folders (obj, controller, models and others) were missing on the server directory.  My assumption was, as part of the deployment those files were "bundled up" and now lived in the bin directory or something to that nature.  Honestly, this is beyond my scope of knowledge.  Here's what I knew:

- When I built the application locally and ran it... the CSS was fine.
- When I deployed the application to my server and viewed it... the CSS was messy?

How I got it to work (The wrong way, I'm assuming)

- I deleted all the files from the site folder
- I FTP'ed ALL FILES found in my root folder to the server
- I hit refresh

BINGO!  Everything is working.

So, I'm assuming that is not the right way to do it.  So...

What can I do to fix Web Deploy so it works and loads my pages correctly without have to FTP all the site file.
0
I'm re-writing a few SSRS reports that were on a 2008 SSRS server and deploying those to a 2017 SSRS server.

I have visual studio 2008 on my local pc I write/modify reports and deploy to the 2008 SSRS server. I also have Visual Studio 2017 on my local PC to write/deploy SSRS reports 2017 reports to the 2017 SSRS server.

My 2008 works fine, no issues. My issues are in SSRS 2017. I can write, preview and deploy basic reports to the 2017 server except those using custom assemblies.

I have several 2008 reports using a custom dll. I have that custom dll deployed and running on the destination SSRS 2017 server. I have it configured correctly so they I can deploy a report that uses the dll and I can successfully run the report on the server.

My problem is that I can't preview it on my local machine. I get the following error:

An error occurred during local processing.
Failed to load expression host assembly. Details: Could not load file or assembly 'Zen.Barcode.Core, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b5ae55aa76d2d9de' or one of its dependencies. Failed to grant permission to execute. (Exception from HRESULT: 0x80131418)

I'm almost positive some config on my local PC is preventing the preview. Has anyone seen this before?
0
I am trying to generate layer for Postgres database using ADO.net, Entity Framework and Postgres Database.
After I select Postgres provider and establishes the connection with the database, the wizard "To choose database object and setting" (Table, view, stored proc, function) doesn't appear and model doesn't get created.
Hence I am unable to select tables and generate layers.
 
Followings are the version used in my project
npgsql (Installed in Visual Studio from NuGet) - 4.0.2
EntityFramework6.npgsql (Installed in Visual Studio from NuGet) - 3.1.1
pgAdmin4
PostgreSQL 9.6
I have included provider name for npgsql in webconfig and appconfig, but still unable to generate layer.
0
All of sudden, I receive this error when running my asp.net app from Visual Studio 2013 and IIS Express - http://localhost:7943/

ERR_CONNECTION_REFUSED

This happens on all browsers and was working fine up until today.

Very strange.

Anyone experience this

*** Found a similar issue on internet, but no solution.
0
Im creating a form. Trying to test buttons on it with the code ive written.

I run debug, form loads for 2 seconds, then it goes back to design mode.

How can I keep it from reverting to design mode, I need to test my buttons.
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
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 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
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
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
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
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
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
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
I am integrating into a webservice, it returns json, here are 2 types of results from it
{"numFound":1,"QTime":77,"attributions":"http://www.gisgraphy.com/attributions.html","result":[{"id":100004730,"lng":36.710459425750635,"lat":-1.336961662155654,"streetName":"Marula Lane","city":"Bulbul","state":"Kajiado","countryCode":"KE","geocodingLevel":"STREET","distance":300.4280656229352,"adm1Name":"Kajiado","formatedFull":"Marula Lane, Bulbul, Kajiado, Kenya","formatedPostal":"Marula Lane, Bulbul","speedMode":"OSM","maxSpeed":"30 mph","azimuthStart":267,"azimuthEnd":251,"length":1161.411457366,"sourceId":33136013}]}



{"numFound":1,"QTime":2537,"attributions":"http://www.gisgraphy.com/attributions.html","result":[{"id":22523950,"lng":36.81669998168945,"lat":-1.2833000421524048,"zipCode":"09831","city":"APO AE","countryCode":"US","geocodingLevel":"CITY","distance":13413.984061400277,"formatedFull":"APO AE,  (09831), United States","formatedPostal":"APO AE, 09831"}]}

Open in new window


I've used the visual studio paste special as JSON class on the first result as that seems to have more info
I'm using the 2nd result as the  test scenario

I then use this code
Result json1 = JsonConvert.DeserializeObject<Result>(jResult);

Open in new window


But all the objects are empty or null

What am I doing wrong?
0
I have a C# project written in Visual Studio 2017.

After creating the project and testing it, I created a installer package using Advanced Installer Software. The package found all the dependencies ok and the installer works fine when I test on my local machine. However, I am concerned whether I should be adding prerequisites and how to determine Which ones I need.
In particular I am not sure about Windows Framework (the installer lets X86 and X64 be selected, my project was compiled for "Any CPU)
Another one is the DotNet Framework. Shoudl I just select the same one I used when compiling my VS project?
Finally, the C++ re-distributable. I have seen programs not install in the past when this is not installed but I am not sure whether I really need to add as pre-requisite and how I determine which version is needed for my application?

Thanks
0
Experts,

I have an asp.net application that has a reportviewer embedded in an aspx page. When I run it locally through visual studio it works fine. When I deploy the application to my app server and run it, the reportviewer gives me the following error:

The permissions granted to user 'domain\appservername$' are insufficient for performing this operation. (rsAccessDenied)

The report viewer isn't picking up my credentials and instead is getting those of the app server. I'm using windows authentication on my site.

Anyone help getting to the bottom of this will be much appreciated.

Regards,
0
I'm in the process of creating a Web page which links to our company database and display data into 2 GridViews. I intend for both of them to be displayed side by side.

I'm using Microsoft Visual Web Developer 2010 Express for this project.

Therefore, I added a table and separated it into 3 columns:

<asp:Table ID="Table3" runat="server" Width = "100%" Font-Bold="True" 
                Font-Names="Arial" Font-Size="Large" BackColor="#B9FFFF" CellPadding="0" 
                CellSpacing="0" Height="18px">

                <asp:TableRow>
                    <asp:TableCell Width = "45%"> Status Time Collector</asp:TableCell>
                    <asp:TableCell Width = "10%"> &nbsp </asp:TableCell>
                    <asp:TableCell Width = "45%"> Actual Quantity Data Collector</asp:TableCell>
                </asp:TableRow>

Open in new window


The result is as follows, (the blue row is the table):
vb-table.JPG
I then try to insert the GridView into the table by dragging GridView into the design and move it within my <asp.table> code:

<asp:Table ID="Table3" runat="server" Width = "100%" Font-Bold="True" 
                Font-Names="Arial" Font-Size="Large" BackColor="#B9FFFF" CellPadding="0" 
                CellSpacing="0" Height="18px">

                <asp:TableRow>
                    <asp:TableCell Width = "45%"> Status Time Collector</asp:TableCell>
                    <asp:TableCell Width = "10%"> &nbsp </asp:TableCell>
                    

Open in new window

0
We use roaming profiles, yesterday I moved a developers profile from \\server1\users\username to \\server2\users\username.  Now Visual Studio 2015 isn't working for him.  When he tries to connect to our Team Foundation Server it is giving him the errors shown below  cipher.PNG
0
Hi Guys
I got someone to make me a hybrid app using "Ionic Framework" few weeks back. They supplied the source and the app. Now I am not able to track him down and was wounding how I could open this in Visual Studio 2017.

I have setup VS 2017 with Apache Cordova and Ionic Framework Template, but not sure how to import that source code and am not sure what it was made in. It has all the folders including the ""www" in the source zip file he provided.

I appreciate any help in advance.

Thanks

Ben
0
Hi.  I'm using VB.net and Visual Studio 2008 and Windows Forms.

QUESTION:  
1 WIth the datepicker object, I've blanked out the value initially then I let the user choose a date from the popup calendar.
After a user chooses a date from the popup calendar, then their date is populated into the form's field; however, if they change their mind and want it to go back to blank, it doesn't let them do that -- How do I allow a user to choose a blank option?

2. In a different datepicker field, I want it to be readonly so I've set the property to enabled=false.  Problem is it doesn't look greyed out (it's still white) so user thinks it's a field they're supposed to enter.   How do I make a disabled datepicker field greyed out?
0

Microsoft Visual Studio

743

Solutions

790

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.