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

x

Microsoft Visual Studio

802

Solutions

824

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

Hello Experts,

I'm trying to share my Visual Studio solution in a new VSTS or Team Foundation Server Git repo.

I have a VSTS account. I'm essentially trying to create a local Git repo for my project using the guide at the following link:

https://docs.microsoft.com/en-us/vsts/git/share-your-code-in-git-vs-2017

I'm trying to 'Add to Source Control' from my VS2017 as shown in the following image:
git
However, I'm not given that option in my VS2017. I also can't see the option when I select my solution in Solution Explorer

Can someone let me know how to select the option?

Thanks

Carlton
0
Hi Experts, i was recently asked to make a change to some code in a c#we based application. I decompiled the DLL with the code I need to change using software ILSPY and .NET reflector with filegen add on. I tried both these decompilers. i then saved the source code. changed the code that needed to change. I then opened the source code project file in Visual Studio 2017 to build the DLL file again. But getting like a 107 errors mostly reading identifier expected in parts of the code such as "public static readonly HomeController.<>c <>9 = new HomeController.<>c();" It shows that the "<>" in the code is the issue. Also more errors in the code read "Type or namespace definition, or end of file expected". Could this be due to encrypted code or obscurity? I urgently need to get this resolved.
0
Web config transform not happening when publishing to a drive letter mapped to a share on target server running windows 2012 R2/ IIS 8.5.

Using VS2012 Ultimate update 5, right click publish to local drive works fine.  Web.config transform performs the expected replace on the app settings section:

<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
  <appSettings xdt:Transform="Replace">

    <add key="magicNumber" value="14" /> etc. ...

Right click publish to drive letter works almost fine.  All files are copied as expected.  However, only the base version of the Web.config is copied.  The transform does not occur.

Note that the reason it works almost fine is I have already SetLinkedConnections = 1 in registry and modified the local policy UAC:BehaviourOfthePromptForAdministratorsInAdminApprovalMode to PromptForConsent   which apparently allows the drive letter to appear in the publish window as a valid target.

Again, all files are copied fine with the exception of the Web.config in which only the base version is copied instead of the transformed version.

Thanks!
0
I am using a FlowLayoutPanel to hold a series of picture boxes that act as thumbnails. I am good with loading the pictures in and handling the event of someone clicking on the thumbnail. Where I am having an issue is that the act of clicking on the thumbnail does not give the user any visual representation that the thumbnail has been clicked on. I've tried:

- Adding a border: Thumbnail is small so it is not noticable
- Disabling the picturebox/thumbnail: It has not visual indication of being disabled
- Turning the background of the picturebox/thumbnail red: since the photo takes up the whole picturebox, you can't see the red background

I know I could use a ListView but my thumbnail list is horizontal and a listview likes to be vertical. There is also a third party extension called "Better Thumbnail Viewer" which would give me a checkbox which would be perfect. But, before I go and change the layout of my form to use the ListView or pay for the third party extension, I wanted to throw it out here and see if anyone has an idea how an OnClick event on the picturebox within the FlowLayoutPanel could show a visual indication of being selected.
0
Visual Studio Pop ups are really annoying.   People are writing these add in's for visual studio and forgetting to deal with the intellisense pop ups.  The problem I have is the python add in / support...  Apparently there is a JSON attribute that can help with this  {"editor.parameterHints": false}  but I don't know where to put this parameter and I don't know much about visual studio add in development.

Can you tell 1) How to turn off pop-up's specifically for the python editor?  or 2) What file can i put this attribute in to turn this off?
The pop ups pop right in front of code that I have need to edit... It's crazy


---------------Below is a copy from my about box to show python editor version.---------------

Microsoft Visual Studio Community 2017
Version 15.2 (26430.12) Release
VisualStudio.15.Release/15.2.0+26430.12
Microsoft .NET Framework
Version 4.6.01055

Installed Version: Community

Visual Basic 2017   00369-60000-00001-AA166
Microsoft Visual Basic 2017

Visual C# 2017   00369-60000-00001-AA166
Microsoft Visual C# 2017

Visual C++ 2017   00369-60000-00001-AA166
Microsoft Visual C++ 2017

Application Insights Tools for Visual Studio Package   8.6.00404.2
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2017   15.0.30503.0
ASP.NET and Web Tools 2017

Azure App Service Tools v3.0.0   15.0.30209.0
Azure App Service Tools v3.0.0

Common Azure Tools   1.9
Provides common services for use by Azure Mobile Services …
0
Does any method exist in c# through which I can encrypt all the selected folder contents at the same time. I have developed an application that can encrypt and decrypt single file at a time..but to encrypt multiple files I have to select and encrypt file multiple times.
0
Hi, in File1 I have a list of file names, in File2 I have full directory and the file name.  What I am trying to achieve is to search each file name in File1 and compare it to File2 and if the filename exists then do further coding.  All the example I have been able to find so far compare line to line i.e the whole line must match, however in my scenario I’m comparing the file name to the full path so each line in each file wont be identical.   Any help is appreciated
0
Can someone suggest me the code that i must add to constantly poll for a paired device to check if it's in range or not ?
I have attached the text file containing the code for Bluetooth application.
This is the same code I had provided in my previous question of passing data between multiple forms and storing it in the database.
Bluettoth-app-source-code.txt
0
Dears ..
I need to make connection between visual studio 2013 and remote oracle database 10g by ado.net
my machine have  windows 8 ..
which tool i would use to make that ?? and which version ??
because i used multi tool without success ..  examble oracle client 11 .. oracle odac 12 and more 11
0
Hi,

I'm just wondering why I can't get specific error messages anymore in Visual Studio when an exception occurs.

For example, I know where this error occured because I'm working in that section of the application, but it used to highlight the line and tell me exactly what caused the problem, now I get a generic error like this:

An unhandled exception of type 'System.InvalidCastException' occurred in Microsoft.VisualBasic.dll
Additional information: Conversion from string "" to type 'Double' is not valid.

It no longer specifies the line number or highlight the error,

I attached a print screen

Thank you for the help!
printScreen.png
0
I'm trying to build a page so it has access to multiple models, doing this using a view model below. The errors happens on the line in the create method that generates a guid and tries to assigned it to ticket.id .. which the viewmodel has a ticket property so I'm think it should work but im clearly missing something.

This is my Controller:

        public async Task<ActionResult> Create([Bind(Include = "Id,StartTime,EndTime,Title,Description,SeverityType")] TicketViewModel model)
        {
            if (ModelState.IsValid)
            {
                model.Ticket.Id = Guid.NewGuid();
                Technician TechnPhone = db.Technician.Find(model.Technician.PhoneNumber);
                model.Technician.PhoneNumber = TechnPhone.PhoneNumber;
                db.Tickets.Add(model.Ticket);
                await db.SaveChangesAsync();
                return RedirectToAction("Index");
            }

            return View(model);
        }

Open in new window


This is my View:

@model Test.ViewModel.TicketViewModel

@{
    ViewBag.Title = "Create";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Create</h2>

@using (Html.BeginForm()) 
{
    @Html.AntiForgeryToken()
    
    <div class="form-horizontal">
        <h4>Ticket</h4>
        <hr />
        @Html.ValidationSummary(true, "", new { @class = "text-danger" })
        <div class="form-group">
            @Html.HiddenFor(m => m.Ticket.Id)
            
        </div>
        <div class="form-group">
        

Open in new window

0
while changing UAC settings in app.manifest  (using Visual Studio 2010)  from
<requestedExecutionLevel  level="asInvoker" uiAccess="false" />
to
<requestedExecutionLevel level="requireAdministrator" uiAccess="true" />
 we are asked to re-start under different credentials and then UAC devenv.exe asks permission to proceed. But the application gives error msg: Error while trying to run project. Unable to start Program .... Running an accessibility application requires following steps described in Help. On clicking Help button it takes us to
 http://127.0.0.1:47873/help/2-4044/ms.help?product=VS&productVersion=100&method=f1&query=vs.debug.error.launch_elevation_requirements&locale=en-US
 
What is the solution..
0
my C# asp.net solution support localization from database, when i call localization class ("Local Resources") its return the string correct in < placeholder>.
but if i call  localization class ("Local Resources") in text=" ". between double quotation. return no result
the code as shown in attached file
viber-image2.jpg
0
I'm creating a service website using visual studio 2015 and VB web form site, I need the user to select a date to book in for a service using calendar control and for that date to be put into car service date field in the database which is NULL at the moment,  how would I go about doing this, I'm struggling because I'm new to VB and many website tutorials cover c# for this particular question.
0
Hello Experts,

I kind expert wrote a the following C# script. I don't get any errors when I debug it with Visual Studio. However, I'm not sure how to test the script with input/output data. Can someone please show me how to add data to the script. For example, for hours I would like add 6, and for capacity I would like to add 7200

using System.Threading.Tasks;
using System.Net;
using System.Net.Http;

namespace ConsoleApp2
{
    class Program
    {
        static void Main(string[] args)
        {
        }

        public class test
        {

            const double revenuePerkW = 0.12;
            const double technicianCost = 250;
            const double turbineCost = 100;


            public static async Task<HttpResponseMessage> Run(HttpRequestMessage req, TraceWriter log)
            {

                //Get request body
                dynamic data = await req.Content.ReadAsAsync<object>();
                int hours = data.hours;
                int capacity = data.capacity;
                //Formulas to calculate revenue and cost
                double revenueOpportunity = capacity * revenuePerkW * 24;
                double costToFix = (hours * technicianCost) + turbineCost;
                string repairTurbine;
                if (revenueOpportunity > costToFix)
                {
                    repairTurbine = "Yes";
                }
                else
                {
                    repairTurbine = "No";
                }

            

Open in new window

0
Hello Experts,

Before you look at this question, I just want to point out that I'm an extreme newbie with C# when I debug the following c# program in Visual Studio I keep on getting the following errors

'a namespace cannot directly contain members such as fields or methods' at the following lines of code

using system.Net;

const double revenuePerkW = 0.12;
const double technicianCost = 250;
const double turbineCost = 100;

public static async Task<HttpResponseMessage> Run(HttpRequestMessage req, TraceWriter log)
{

The full c# program is as follows:

using System.Net;

const double revenuePerkW = 0.12;
const double technicianCost = 250;
const double turbineCost = 100;

public static async Task<HttpResponseMessage> Run(HttpRequestMessage req, TraceWriter log)
{

    //Get request body
    dynamic data = await req.Content.ReadAsAsync<object>();
    int hours = data.hours;
    int capacity = data.capacity;

    //Formulas to calculate revenue and cost
    double revenueOpportunity = capacity * revenuePerkW * 24;
    double costToFix = (hours * technicianCost) + turbineCost;
    string repairTurbine;

    if (revenueOpportunity > costToFix)
    {
        repairTurbine = "Yes";
    }
    else
    {
        repairTurbine = "No";
    }

    return req.CreateResponse(HttpStatusCode.OK, new
    {
        message = repairTurbine,
        revenueOpportunity = "$" + revenueOpportunity,
        costToFix = "$" + costToFix
    });
}

Open in new window


Can someone please let me know how to fix this problem.

Cheers

Carlton
0
I have made an application that detects,pairs and connect discoverable Bluetooth devices.Also I have made an application that encrypts and decrypts file. Now I want to check whether an already paired device is in range. If I select an already paired device and it is not in range then the function for encrypting the file must be activated and if that selected paired device comes in range then function for decryption must be activated. How can I implement it? Please suggest any solution.
I have also attached visual c# files for both applications as well.
BluetoothApplication2.sln
EncryptDecrypt.sln
0
We have a web application designed on Visual Studio 2008.
Can we move everything to VS2016?
Will there be any issues? Are they compatible?

Thanks in advance.
0
I upgraded my VS2005 to VS2013 and I'm now unable to access my Database schema (.XSD File).
When I double click it I get the following Screen Shot...how do I fix this?

Thanks,
Mark
Error.jpg
0
TITLE Program Template          (RevStr.asm)

; This program reverses a string.

.model flat, stdcall
.stack 4096
ExitProcess PROTO, dwExitCode:DWORD
Writestring PROTO
INCLUDE (where you have it stored)\Irvine32.inc

.data
aName BYTE "Abraham Lincoln",0
nameSize = ($ - aName) - 1

.code
main PROC

; Push the name on the stack.
      mov ecx,nameSize
      mov esi,0

L1:      movzx eax, aName[esi]      ; get character
      push eax                  ; push on stack
      inc esi
      Loop L1

; Pop the name from the stack, in reverse,
; and store in the aName array.
      mov ecx, nameSize
      mov esi, 0

L2:      pop eax                  ; get character
      mov aName[esi],  al            ; store in string
      inc esi
      Loop L2

; Display the name.
      mov edx,  OFFSET aName
      call Writestring
      call Crlf
INVOKE ExitProcess, 0
main ENDP
END main
0
Backing up Access Linked table to separate Access Db using VB.net and Visual Studio 2012.
I have tried code I found on Expert Exchange published 2010-03-30 by DDB. It uses ADODB which does not work well with Visual Studio 2012.
0
Hi,

I hope that someone is able to help. The web development team have changed the current website that we are using. We have an order download application that integrated into mageno.

The issue is that I try to change the endpoint address to the following and I receive an error:

https://old.filofax.co.uk/index.php/api/v2_soap/index/?wsdl=1

Error message is attached(error1)

I have also tried to generate a proxy class using the same error message.

My issue is that I can browse to this URL ok.

I would appreciate any help. I have contacted the hosting company and they don't have any iea.

Best Regards,

Ross
error1.png
0
I am making a student planner/grade report app for
Android Studio class in college. I was just wondering if anyone is experienced with using android Studio?
0
Due to account restrictions I have my own local account, and we have an "admin" account that we use to run specific applications, for example Visual Studio. We simply login with our regular account then Run as administrator the shortcut. TFS then used this admin account for our mappings etc.

Unfortunately due to a password change this no longer seems to be working, and all my mappings are not available! In Team Explorer if I hold the mouse cursor over the Team Project it says Connected as: MyLocalAccount, however when I've checked a colleagues it says their admin account.  So now in Team Explorer it's looking for me to configure my mappings, and when I try and use the existing project it says it's already mapped (presumably under my other account).

I've tried clearing the TFS cache on the C drive, I've added & removed the details under Credential Manager in Windows (several sources suggested this online) but nothing has worked. Using the Credential Manager various blogs suggested I'd be presented with a dialog box to login when I next tried connecting to TFS, however this has never appeared!

I've been working on a piece of code and I'd ideally like to not have to create a new mapping and start / copy over code.
0
We just purchased action pack and get Dynamics CRM on the cloud using the 5 licenses. I would like to create a test project in visual studio and try to call the web api. Can you show me something how can i do the set up?
For now, all i need is below:

1. create a static method to check the connection is valid or not. return true or false
2. create a static method to read all leads inside of lead entity.  and that is all i need.
0

Microsoft Visual Studio

802

Solutions

824

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.