Quantcast
Channel: Visual Studio General Questions forum
Viewing all 21115 articles
Browse latest View live

Form Help

$
0
0

Wondering how does one take a User Control Form and insert into a Window Form? I can't seem to figure it out or wrap my head around how a company did it with their SDK.

Any help would be really appreciated. Thanks!


Visual Studio Commnity 2017 - Terms of Use

$
0
0

Hi All,

I have downloaded Visual Studio Community 2017, As It's free and I have gone through it's terms and conditions.I am single developer and no organization/no enterprise wants to use as a single developer.I want to make a website socially and get adds through Google Adsense. Can I use this Visual Studio Community for this case. Can you please confirm. Thank you Guys.

How to make ComboBox not show the text in its textbox as selected (C#)

$
0
0

I created a Form with a ComboBox on it named comboBox1, and if I load text in the ComboBox at program start, it shows the text being selected:

Notice that the text inside the ComboBox shows as selected. I want to text to not show selection when the program starts, like this:

Here is the code I use. I attempt to set Select() to 0 with 0 length, to no avail:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApp1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();

            this.comboBox1.Text = "Hi!";
            this.comboBox1.Select(0, 0);
        }
    }
}


How to embed image inside source code?

$
0
0

He there!

I'd like to know how to embed an image inside source colde like (this code was copied from an c# file with Visual Studio 2017):

new SampleItem(     "📏","Accelerometer",
                    typeof(AccelerometerPage),"Retrieve acceleration data of the device in 3D space.",
                    new[] { "accelerometer", "sensors", "hardware", "device" }),

Where can I find this type of image and what's its format?

Thanks in advance.


Ciro


Visual studio 2017(15.9.7) restart when closing.

$
0
0

Visual studio restart when close solution. 

attach window event log.

- <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
- <System><Provider Name="Application Error" /> <EventID Qualifiers="0">1000</EventID> <Level>2</Level> <Task>100</Task> <Keywords>0x80000000000000</Keywords> <TimeCreated SystemTime="2019-02-20T08:07:31.433624200Z" /> <EventRecordID>30188</EventRecordID> <Channel>Application</Channel> <Computer>PC</Computer> <Security /> </System>
- <EventData><Data>devenv.exe</Data> <Data>15.9.28307.423</Data> <Data>5c5b5342</Data> <Data>Qt5CoreNvda.dll</Data> <Data>5.7.0.0</Data> <Data>5811baa1</Data> <Data>c0000005</Data> <Data>001b0cd5</Data> <Data>21cc</Data> <Data>01d4c8eaff77ee7a</Data> <Data>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\devenv.exe</Data> <Data>c:\Program Files (x86)\NVIDIA Corporation\Nsight Visual Studio Edition 5.6\host\common\Qt5CoreNvda.dll</Data> <Data>28256dbb-ae29-406b-a88a-128a7232c086</Data> <Data /> <Data /> </EventData></Event>


how to solve this problem?



Cannot remove items from project

$
0
0
Is there not a remove function anymore?
I can only chose delete (deletes item permanently from my drive) or exclude from project (which in turn keeps reference to the item).

I have code I no longer need in this project, but need in other projects, yet there is no "remove .cs file from project" feature?

Visual Studio Enterprise 2017 15.9.7 - unable to create a new project

$
0
0
Hi Team,

We are unable to create a new project from Visual Studio new project creation dialog. We are getting the below message "Please choose a project type, and verify that a matching framework is selected".  

I also found a similar issue in VS2013. Following are the reference links: 

https://social.msdn.microsoft.com/Forums/vstudio/en-US/dfc97df7-86ca-4348-ba1b-78305326d003/visual-studio-ultimate-2013-update-4-how-to-create-a-web-forms-project-?forum=visualstudiogeneral 

https://stackoverflow.com/questions/20823499/visual-studio-2013-no-visual-basic-visual-c-sharp-web-templates-installed 

http://www.sysnet.pe.kr/2/0/11003 

Is there the same issue exists in VS2017 enterprise edition 2017? 

Could anyone please provide a solution to this? 








Find all reference window

$
0
0

Hi,

how can i get content from "find all reference" window in viusal studio 2015, in c#, to manipulate them?

Thank for answer.


SSIS project build using command line devenv.com on build server

$
0
0

Hi.

We are using our own build server connected to Azure DevOps.

On build server I have installed Visual Studio 2017, SSDT.

Build is using command line to build SSIS project, for example : "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\devenv.com" "C:\work\SSISproject\SSIS.sln" /Build Development

I have activated Visual Studio with my MSDN subscription.

Problem is, that after some period - I need to reactivate again Visual Studio (by updating license), otherwise build will fail with error : "The license for Visual Studio has expired."

This is not big issue, if I would have only 1 build server, but if I have 10 or more, then it is problem.

My question - what is solution to this problem on build server ?

Thanks

Mareks

Assistance

$
0
0
Hi dear, My name is John From Nigeria, all in search of solution to my upcoming final year project,
Please if any one can help, i have in mind to develop a finger print recognition system as my final year project, using Visual c++. However the problem is this. I really don't have a single idea on this beside  designing the interface, the code aspect is nothing to write home about. I have been using VC++ for a year and seven months now all the projects I have handled are basically from calculator to login forms. In fact, this is the first time am going in to something this challenging.  I sincerely need help, no matter how little the idea , I need something to get started, be it the direction to a site, a pdf or the needed libraries. Just any suggestion or code you deem suitable and usefull. Thanks for your anticipated response.

XamlParseException when loading the Designer in a brand new project

$
0
0

I've searched everywhere for the answer but none of the questions in this website (or StackOverflow) solved it. Everytime I create a new Windows Phone 8.1 project I get the XamlParseException, even when I choose the Blank App project. I will list everything I tried.

  • Reinstall VS 2015
  • Reinstall VS 2015 without the SDK and then download it later with the emulators
  • Enable Developer Mode on Windows
  • Disable Project Code
  • Open the .xaml files with the Automatic Editor Selector and XAML Designer
  • Enable XAML Designer in the Options, of course
  • Update Windows 10 (note: I couldn't upgrade to 1809, I'm stuck with 1803)
  • Enable Hypervisor on the BIOS
  • Reboot computer
  • Adding the 'ThemeResources.xaml' manually on the project
  • Build, Rebuild and Clean the solution
  • Using different .NET Framework versions 

Here is my App.xaml code:

<Application
    x:Class="App2.App"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:App2"></Application>

Here is the MainPage.xaml code:

<Page
    x:Class="App2.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:App2"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"><Grid></Grid></Page>

ASP.NET MVC 5

$
0
0

Code to db workflow. Trying to query my db. When I use the below code I get the errors mentioned below?

public class CustomersController : Controller
    {
        private ApplicationDbContext _context;

        public CustomersController()
        {
            _context = new ApplicationDbContext();
        }
    
        protected override void Dispose(bool disposing)
        {
            _context.Dispose();
        }
    }

Server Error in '/' Application.

Could not load file or assembly 'EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.IO.FileLoadException: Could not load file or assembly 'EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Source Error: 
Line 14:         {
Line 15:             _context = new ApplicationDbContext();Line 16:         }Line 17:     
Line 18:         protected override void Dispose(bool disposing)

Source File: C:\Users\cdpai\Documents\SourceCodeWC\trunk\ASP.NET\03 Working with Data\EntityFramework\EntityFramework\Controllers\CustomersController.cs    Line: 16 

Assembly Load Trace: The following information can be helpful to determine why the assembly 'EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' could not be loaded.
=== Pre-bind state information ===
LOG: DisplayName = EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
 (Fully-specified)
LOG: Appbase = file:///C:/Users/cdpai/Documents/SourceCodeWC/trunk/ASP.NET/03 Working with Data/EntityFramework/EntityFramework/
LOG: Initial PrivatePath = C:\Users\cdpai\Documents\SourceCodeWC\trunk\ASP.NET\03 Working with Data\EntityFramework\EntityFramework\bin
Calling assembly : Microsoft.AspNet.Identity.EntityFramework, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Users\cdpai\Documents\SourceCodeWC\trunk\ASP.NET\03 Working with Data\EntityFramework\EntityFramework\web.config
LOG: Using host configuration file: C:\Users\cdpai\Documents\IISExpress\config\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
LOG: Attempting download of new URL file:///C:/Users/cdpai/AppData/Local/Temp/Temporary ASP.NET Files/vs/7461f73a/4dfb86b1/EntityFramework.DLL.
LOG: Attempting download of new URL file:///C:/Users/cdpai/AppData/Local/Temp/Temporary ASP.NET Files/vs/7461f73a/4dfb86b1/EntityFramework/EntityFramework.DLL.
LOG: Attempting download of new URL file:///C:/Users/cdpai/Documents/SourceCodeWC/trunk/ASP.NET/03 Working with Data/EntityFramework/EntityFramework/bin/EntityFramework.DLL.
WRN: Comparing the assembly name resulted in the mismatch: Major Version
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.

Stack Trace: 
[FileLoadException: Could not load file or assembly 'EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]
   EntityFramework.Controllers.CustomersController..ctor() in C:\Users\cdpai\Documents\SourceCodeWC\trunk\ASP.NET\03 Working with Data\EntityFramework\EntityFramework\Controllers\CustomersController.cs:16

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) +0
   System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +119
   System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +232
   System.Activator.CreateInstance(Type type, Boolean nonPublic) +83
   System.Activator.CreateInstance(Type type) +11
   System.Web.Mvc.DefaultControllerActivator.Create(RequestContext requestContext, Type controllerType) +55

[InvalidOperationException: An error occurred when trying to create a controller of type 'EntityFramework.Controllers.CustomersController'. Make sure that the controller has a parameterless public constructor.]
   System.Web.Mvc.DefaultControllerActivator.Create(RequestContext requestContext, Type controllerType) +178
   System.Web.Mvc.DefaultControllerFactory.GetControllerInstance(RequestContext requestContext, Type controllerType) +80
   System.Web.Mvc.DefaultControllerFactory.CreateController(RequestContext requestContext, String controllerName) +102
   System.Web.Mvc.MvcHandler.ProcessRequestInit(HttpContextBase httpContext, IController& controller, IControllerFactory& factory) +187
   System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state) +50
   System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContext httpContext, AsyncCallback callback, Object state) +48
   System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData) +16
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +103
   System.Web.<>c__DisplayClass285_0.<ExecuteStepImpl>b__0() +26
   System.Web.StepInvoker.Invoke(Action executionStep) +101
   System.Web.<>c__DisplayClass4_0.<Invoke>b__0() +22
   Microsoft.AspNet.TelemetryCorrelation.TelemetryCorrelationHttpModule.OnExecuteRequestStep(HttpContextBase context, Action step) +64
   System.Web.<>c__DisplayClass284_0.<OnExecuteRequestStep>b__0(Action nextStepAction) +54
   System.Web.StepInvoker.Invoke(Action executionStep) +85
   System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +9980113
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +159

Which configuration file holds the load test results repository connection string for VS2017

$
0
0
I'd like to edit the connection string for the load test result repository outside the VS2017 UI. Is it possible?

Visual Studio 2015 taking over 2GB of memory while running

$
0
0

Hi Friends,

Please help me to fix my visual studio. 

I  have  some plugins like (code rush and resharper) on my visual studio 2015 , I disabled them and still my visual studio taking alot of memory. 

I have other plugins like productivity tools...  I am  not sure which plugin should I disable or remove from visual studio 2015.

How can I verify which  plugin on  visual studio 2015 is killing its  memory.

How to identity. .. such problem.. I can how to find memory logs.. for visual studio so that i can post here.. to get help ?

Thank you,

Priya

Managing VS2017 Community Solution Explorer TreeNodes

$
0
0

Is there a way to 'merge' files in Solution Explorer so that I could show a text file under the corresponding .vb file (such as how SE used to expand to include the .Designer.vb as a child node?)

The reason I ask is because I am planning to publish a component library and would like to 'attach' a ReadMe.txt file and any additional related external files that I might code as nodes under each respective .vb file. This would keep all parts of the whole under individual parent nodes and clean up the SE GUI. Perhaps this could be accomplished via XML somewhere?

I am currently using VS2017 Community Version 15.9.4.

(As an aside: is there a switch that can be set somewhere that would cause the Solution Explorer to show the .Designer.vb node expansion as it used to display?)

Thank you!


Visual Studio Diagrams tool

$
0
0

Hello,

1) I still have uml diagrams, activity diagrams, classdiagrams from VS2015, that I cannot open anymore on VS2017, is there a tool I could use to keep updating such documentation or make new diagrams?

2) Will the source code of VS2015 documentation’s tool become opensource, in such a way that we as a community can keep upgrading it?

Look forward to your reply

Best


Configurations get confused when adding a new configuration

$
0
0

Hi Everyone,

I am new to this forum, but have been using Visual Studio express since 2008. I am managing a large number of projects, but now have come up against a problem. I had to add new solution configurations to all my projects, but one of them when I add a new solution configuration the existing project configurations become confused and some appear to have gone missing when viewing them in the configuration manager. Some solution configurations end up connected to the incorrect project configuration. If I remove the new configuration that I have added (both both the solution and the project), the configurations are back to normal again.

This is happening to only one of my solutions. I have successfully modified all my other solutions/projects.

Has anyone come across this before and remembers how that was resolved?

Forgot to say, I am currently using Visual Studio 2015.

Many thanks in advance,

Michael




What is wrong with my Interop?

$
0
0

Hi,

I am building an interop from C++ DLL for the use from a c# solution as reference library.

I am using visual studio 2017.

The solution uses .Net framewrok 4.5.2.

I currently have a working c++ dll with a certain file version and a matching interop I created using tlbimp.exe with no version and this works OK for me.

The thing is - I now want to update the c++ DLL file version and create a new interop but once I do that (whether the Interop is being generated with file version and whether it isn't ) the solution compiles ok using the new interop but when I run the application It cannot reach it.



Gmail authentication error

$
0
0
I designed my own process to send e-mail via my Gmail account and I want to give it full access by adding it to the Gmail secure apps list. If I turn on "Less secure app access" in my Gmail account the mail works fine. If I turn off "less secure app access" I get a message as follows:  System.Net.Mail.SmtpException:  The SMTP server requires a secure connection or the client was not authenticated. I want to keep the "Less secure app access" off as recommended. Is there a way to let my app get secure access?



RONATMOODYLAKE

why there is no stdafx.h and targetver.h in visual studio c++ 2017?

$
0
0
I created new project in VS 2017 using windows desktop wizard by not changing any default. There should be stdafx.h and targetver.h in the head file in VS 2013 right? But why there's no such files in VS 2017? How can I add these two files in my project?
Viewing all 21115 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>