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

Can't register Visual Studio 2010 Express

$
0
0

I installed Visual Studio 2010 Express on a new computer. I am warned that I need to register in 30 days. The button takes me to a link to submit my profile which I did a dozen times. Never do I reach a page or receive an e-mail with a registration key. Can someone tell me how to get the key? 

Thanks,

Ken Smith


Ken Smith


Never Mind.  I found the answer indirectly in another forum question.  I was not answering one question on the profile form.  As soon as I answered that question I got a registration key.

"manage nuget packages for solution" is missing in the drop down for NuGet Package Manager

$
0
0

Hi,

I have VS2013 Ultimate on windows 7 PC and that Nuget Option does show in the dropdown.  Today, I setup a vm in Azure, from image I select VS2013 Ultimate, just like the one on my PC.  However, when I click on the Tools, Nuget, there is only 2 drop down option, "package manager console" and "package manager settings" are the only 2 available.  How can I get the ""manage nuget packages for solution"?

I want to install the xamarin.forms extension and I need this.

thank you



Thank you

how to use access database

$
0
0
is it possible to use access database in visual basic 2012

Local Resource not being read from database

$
0
0

I created a Customer Resource Provider for my project. This provider is executing properly for Global resource requests (see sample #1 reference below). However, for Local resource references (see Sample #2 below), it is not loading anything.  Can anybody help out or spot what is wrong?

Sample #1:

<asp:LabelID="lblAmount"runat="server"Text="<%$ Resources:TestResource, Total_Amount_is %>"></asp:Label

>

Sample #2:

<asp:TextBoxID="txtMoney"runat="server"meta:resourcekey="txtMoneyResource1"></asp:TextBox>

Here is the Customer Provider code:

using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Web;
using System.Web.Compilation;
using System.Globalization;
using System.Resources;
using System.Data;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using System.Text;
using System.Diagnostics;
using System.Runtime.CompilerServices;
namespace Globalization_and_LocalizationV6
{
    public sealed class SqlResourceProviderFactory : ResourceProviderFactory
    {
        public SqlResourceProviderFactory()
        {
        }
        public override IResourceProvider CreateGlobalResourceProvider(string classKey)
        {
            return new SqlResourceProvider(null, classKey);
        }
        public override IResourceProvider CreateLocalResourceProvider(string virtualPath)
        {
            //virtualPath = System.IO.Path.GetFileName(virtualPath);
            //virtualPath = virtualPath.Replace(HttpContext.Current.Request.ApplicationPath, "");//System.Web.VirtualPathUtility.ToAppRelative(virtualPath)
            virtualPath = virtualPath.Replace(System.Web.VirtualPathUtility.ToAppRelative(virtualPath), "");
            return new SqlResourceProvider(virtualPath, null);
        }
    }//End of Sealed Class called SqlResourceProviderFactory
    internal class SqlResourceProvider : IResourceProvider
    {
        private string _virtualPath;
        private string _className;
        private IDictionary _resourceCache;
        private static object CultureNeutralKey = new object();
        public SqlResourceProvider(string virtualPath, string className)
        {
            _virtualPath = virtualPath;
            _className = className;
        }
        private IDictionary GetResourceCache(string cultureName)
        {
            object cultureKey;
            if (cultureName != null)
            {
                cultureKey = cultureName;
            }
            else
            {
                cultureKey = CultureNeutralKey;
            }
            if (_resourceCache == null)
            {
                _resourceCache = new ListDictionary();
            }
            IDictionary resourceDict = _resourceCache[cultureKey] as IDictionary;
            if (resourceDict == null)
            {
                resourceDict = SqlResourceHelper.GetResources(_virtualPath, _className, cultureName, false, null);
                _resourceCache[cultureKey] = resourceDict;
            }
            return resourceDict;
        }
        object IResourceProvider.GetObject(string resourceKey, CultureInfo culture)
        {
            string cultureName = null;
            if (culture != null)
            {
                cultureName = culture.Name;
            }
            else
            {
                cultureName = CultureInfo.CurrentUICulture.Name;
            }
            object value = GetResourceCache(cultureName)[resourceKey];
            if (value == null)
            {
                // resource is missing for current culture, use default
                SqlResourceHelper.AddResource(resourceKey, _virtualPath, _className, cultureName);
                value = GetResourceCache(null)[resourceKey];//How do you add a new item to the "list" inside this method? Or refresh the list with the updated data?
            }
            if (value == null)
            {
                // the resource is really missing, no default exists
                SqlResourceHelper.AddResource(resourceKey, _virtualPath, _className, string.Empty);
            }
            return value;
        }
        IResourceReader IResourceProvider.ResourceReader
        {
            get
            {
                return new SqlResourceReader(GetResourceCache(null));
            }
        }
    }//End of Sealed Class SqlResourceProvider
    internal sealed class SqlResourceReader : IResourceReader
    {
        private IDictionary _resources;
        public SqlResourceReader(IDictionary resources)
        {
            _resources = resources;
        }
        IDictionaryEnumerator IResourceReader.GetEnumerator()
        {
            return _resources.GetEnumerator();
        }
        void IResourceReader.Close()
        {
        }
        IEnumerator IEnumerable.GetEnumerator()
        {
            return _resources.GetEnumerator();
        }
        void IDisposable.Dispose()
        {
        }
    }//End of Sealed Class SqlResourceReader
    internal static class SqlResourceHelper
    {
        public static IDictionary GetResources(string virtualPath, string className, string cultureName, bool designMode, IServiceProvider serviceProvider)
        {
            SqlConnection con = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["ASPNETDB"].ToString());
            SqlCommand com = new SqlCommand();
            //
            // Build correct select statement to get resource values
            //
            if (!String.IsNullOrEmpty(virtualPath))
            {
                //
                // Get Local resources
                //
                if (string.IsNullOrEmpty(cultureName))
                {
                    // default resource values (no culture defined)
                    com.CommandType = CommandType.Text;
                    com.CommandText = "select resource_name, resource_value" +" from ASPNET_GLOBALIZATION_RESOURCES" +" where resource_object = @virtual_path" +" and culture_name is null";
                    com.Parameters.AddWithValue("@virtual_path", virtualPath);
                }
                else
                {
                    com.CommandType = CommandType.Text;
                    com.CommandText = "select resource_name, resource_value" +" from ASPNET_GLOBALIZATION_RESOURCES " +"where resource_object = @virtual_path " +"and culture_name = @culture_name ";
                    com.Parameters.AddWithValue("@virtual_path", virtualPath);
                    com.Parameters.AddWithValue("@culture_name", cultureName);
                }
            }
            else if (!String.IsNullOrEmpty(className))
            {
                //
                // Get Global resources
                //
                string strFinalCultureName = string.Empty;
                if (String.IsNullOrEmpty(cultureName))
                {
                    strFinalCultureName = string.Empty;
                }
                else
                {
                    strFinalCultureName = cultureName;
                }
                com.CommandType = CommandType.Text;
                com.CommandText = "select resource_name, resource_value " +"from ASPNET_GLOBALIZATION_RESOURCES where " +"resource_object = @class_name and" +" culture_name = @culture_name ";
                com.Parameters.AddWithValue("@class_name", className);
                com.Parameters.AddWithValue("@culture_name", strFinalCultureName);
                //if (string.IsNullOrEmpty(strFinalCultureName))
                //{
                //    // default resource values (no culture defined)
                //    com.CommandType = CommandType.Text;
                //    com.CommandText = "select resource_name, resource_value" +
                //                      " from ASPNET_GLOBALIZATION_RESOURCES " +
                //                      "where resource_object = @class_name" +
                //                      " and culture_name is null";
                //    com.Parameters.AddWithValue("@class_name", className);
                //}
                //else
                //{
                //    com.CommandType = CommandType.Text;
                //    com.CommandText = "select resource_name, resource_value " +
                //                      "from ASPNET_GLOBALIZATION_RESOURCES where " +
                //                      "resource_object = @class_name and" +
                //                      " culture_name = @culture_name ";
                //    com.Parameters.AddWithValue("@class_name", className);
                //    com.Parameters.AddWithValue("@culture_name", cultureName);
                //}
            }
            else
            {
                //
                // Neither virtualPath or className provided,
                // unknown if Local or Global resource
                //
                throw new Exception("SqlResourceHelper.GetResources()" +" - virtualPath or className missing from parameters.");
            }
            ListDictionary resources = new ListDictionary();
            try
            {
                con.Open();
                //SqlCommand _com = con.CreateCommand();
                //_com.Connection = con;
                //_com.CommandType = CommandType.Text;
                //_com.CommandText = com.CommandText;
                //_com.Parameters.AddRange(com.Parameters.AddRange(com.Parameters.Cast<System.Data.Common.DbParameter>().ToArray()););
                //foreach (var Parameters in com.Parameters)
                //{
                //    _com.Parameters.
                //}

                com.Connection = con;
                SqlDataReader sdr = com.ExecuteReader(CommandBehavior.CloseConnection);
                while (sdr.Read())
                {
                    string rn = sdr.GetString(sdr.GetOrdinal("resource_name"));
                    string rv = sdr.GetString(sdr.GetOrdinal("resource_value"));
                    resources.Add(rn, rv);
                }
            }
            catch (Exception e)
            {
                throw new Exception(e.Message, e);
            }
            finally
            {
                if (con.State == ConnectionState.Open)
                {
                    con.Close();
                }
            }
            return resources;
        }//End of GetResources
        public static void AddResource(string resource_name, string virtualPath, string className, string cultureName)
        {
            string resource_object = "UNKNOWN **ERROR**";
            if (!String.IsNullOrEmpty(virtualPath))
            {
                resource_object = virtualPath;
            }
            else if (!String.IsNullOrEmpty(className))
            {
                resource_object = className;
            }
            string strFinalCultureName = string.Empty;
            if (String.IsNullOrEmpty(cultureName))
            {
                strFinalCultureName = string.Empty;
            }
            else
            {
                strFinalCultureName = cultureName;
            }
            SqlConnection con = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["ASPNETDB"].ToString());
            SqlCommand com = new SqlCommand();
            StringBuilder sb = new StringBuilder();
            sb.Append("MERGE ASPNET_GLOBALIZATION_RESOURCES as trg " +"using (values ('" + resource_object + "', '" + resource_name + "', '" + resource_name + " * DEFAULT * ', '" + strFinalCultureName + "')) " +"as source (RESOURCE_OBJECT, RESOURCE_NAME, RESOURCE_VALUE, CULTURE_NAME) " +"on " +"    trg.RESOURCE_OBJECT = '" + resource_object + "' " +"and trg.RESOURCE_NAME = '" + resource_name + "' " +"and trg.CULTURE_NAME = '" + strFinalCultureName + "' " +"when matched then " +"update " +"set RESOURCE_VALUE = source.RESOURCE_VALUE " +"when not matched then " +"insert ( RESOURCE_OBJECT, RESOURCE_NAME, RESOURCE_VALUE, CULTURE_NAME) " +"values ( source.RESOURCE_OBJECT, source.RESOURCE_NAME, source.RESOURCE_VALUE, source.CULTURE_NAME);");
            com.CommandText = sb.ToString();
            //sb.Append("insert into ASPNET_GLOBALIZATION_RESOURCES " +
            //          "(resource_name ,resource_value," +
            //          "resource_object,culture_name ) ");
            //sb.Append(" values (@resource_name ,@resource_value," +
            //          "@resource_object,@culture_name) ");
            //com.CommandText = sb.ToString();
            //com.Parameters.AddWithValue("@resource_name", resource_name);
            //com.Parameters.AddWithValue("@resource_value", resource_name +
            //                            " * DEFAULT * " +
            //                            (String.IsNullOrEmpty(cultureName) ?
            //                            string.Empty : cultureName));
            //com.Parameters.AddWithValue("@culture_name", (String.IsNullOrEmpty(cultureName) ? SqlString.Null : cultureName));
            //string resource_object = "UNKNOWN **ERROR**";
            //if (!String.IsNullOrEmpty(virtualPath))
            //{
            //    resource_object = virtualPath;
            //}
            //else if (!String.IsNullOrEmpty(className))
            //{
            //    resource_object = className;
            //}
            //com.Parameters.AddWithValue("@resource_object", resource_object);
            try
            {
                com.Connection = con;
                con.Open();
                com.ExecuteNonQuery();
            }
            catch (Exception e)
            {
                throw new Exception(e.ToString());
            }
            finally
            {
                if (con.State == ConnectionState.Open)
                    con.Close();
            }
        }//End of AddResource
        public static IDictionary AASearch(List<Dictionary<string, object>> testData, Dictionary<string, object> searchPattern)
        {
            return testData.FirstOrDefault(x => searchPattern.All(x.Contains));
        }
    }//End of Class SqlResourceHelper

}//End of Namespace Globalization_and_LocalizationV6

Automatic Parentheses Removed?

$
0
0

I just recently upgraded vs2010 to vs2015 and one thing is driving me crazy. 

In VS2010 if you type

msgbox "hey"

and press enter you get Msgbox("hey")

in VS2015 if you type

msgbox "hey"

and press enter you get msgbox "hey"

Anyone know if you can turn that back on?

Sign in Error

$
0
0

Recently when attempting to sign in to Visual Studio, I receive the following error message. To me it indicates a potential server side issue. Has anyone else encounterd this error before?

Click once winform APP publish on web with security

$
0
0

My business application :

  • Winform for UI
  • Webservice on azure for business and data

Deployment:

  • winform : stored on an azure folder and installed with click once
  • webservice : continuous integration via visual studio online

My problem is just about winform deploy : the winform update through the web and click once is not secure. Every one who get the link can download my winform app. How Can I secure this download and update ?

After installation of the winform, there is an authentification but I think this is not enough.

WCF Application only works after debugging

$
0
0

Hello,

I am programming a WCF managed application that will be hosted in IIS. When i am testing this application the following problem occurs:

I open the project, run without debugging i get EndPointNotFoundException. When i run with debugging de program exits with code 0x0. If i run without debugging after debugging once the program works fine, until i restart Visual Studio. Then i have to run debugging mode again. What dependencies are set when i run with debugging mode? How can i solve this?



Visual Studio 2015 Code Review Feature

$
0
0

I see from this link that professional as well as enterprise are going to have the ability to do a code review.  Previously in 2013, only with at least a Premium license you could take advantage of the Code Review feature. So is this diagram accurate and now will we have access to the code review feature in the professional version?

Will this be the same version of the code review feature that is accessible by both Professional and Enterprise?

Thanks!


ck

VS android emulators running in Azure Virtual machine not possible or ?

$
0
0

Hi.

I am pretty excited about the cross development (Xamarin) inside VS 2015, thus created a Virtual machine in Azure prebuild with VS 2015 Ultimate image.

But I seems like the new VS Android Emulator can not be runned in Azure as Hyper-V kan not be installed in a Virtual invironment.

Is this really correct or is there some kind of trick?.

/Paw

Javascript to validate asp.net textbox for HH:MM format on keypress event

$
0
0

Hi,

How to write Javascript to validate asp.net textbox for HH:MM format on keypress event?

I need it on keypress event only


Regards, Shreyas R S

error in vs13

$
0
0

i am getting the following error during visual studio 13 installation and my os is windows 8.1 is there any one to help and solve my problem

VS Express 2012 occasionally hangs on win 7 64bit when closing designer windows

$
0
0

I'm experiencing something I've never experience before. I have a new laptop and installed VS Express 2012. Everything runs great except occasionally, when I'm closing tabs - VS will just hang. It seems to only happen with WPF form design view, does not seem to happen when closing code only windows. Everything else runs exceptionally fast. Please help, thanks.

Things to note:

  • cpu usage does not increase (stays at 0).
  • The hang time can be anywhere from 10 second to over 30 seconds (at that point i kill the process).
  • memory usage does not increase.
  • I have 3 other installations on separate computers and none of the others experience this problem with the same code. (this is the fastest computer of all of them).
  • The display is 4k resolution, and is the only one with that size screen.
  • I am not running any addons.
  • Basic VS installation nothing special.

I have done the following to try to fix it:

  • Installed all the latest plugins and patches for VS.
  • Installed all the latest patches for Windows 7.
  • Reinstalled VS on a completely seperate drive (SSD).
  • Erased the solution *.suo file and let it rebuild.
  • Disabled AntiVirus - other computers have the same AV also.

Edit for clarity:

What I mean by closing tabs - When I have my WPF project open, I will open source files inside the project and the sources file is in a tabbed window. I close the source file inside the project, either by middle mouse button or by clicking the 'x'. At no other time have I noticed this hang and it only seems to happen when the source file includes a form design view (*.xaml) not plain text (*.cs).


How to avoid having to clean a portable class library every time?

$
0
0

WinRT Project Foo references a portable class library PCLFoo.  Whenever a change is made to Foo and it is run (by pressing F5 or Ctr+F5), the following error occurs:

The type or namespace name 'PCLFoo' could not be found (are you missing a using directive or an assembly reference?)	
Everything will be fine after cleaning PCLFoo (right-click >Clean).  Is there a way to avoid having to do this cleaning every time?

 

Hong

Trouble debugging ActiveX control on Win8.1/IE11

$
0
0

I'm starting development of an ActiveX control (c++) using Visual Studio 2012. I've built an initial control using the VS wizard and taking all defaults -- this results in a .ocx file in the debug directory for the project.

I've made a simple .html file that references the control using an object tag and the control's clsid.  In the debugging entries for the control's project I've given iexplore.exe as the executable to run and the file location of the test html file as the command argument.

When I start the debugger IE with the html file comes up but with a box indicating that the activex control might interact with other elements of the web page and asking me if that is alright.  At some point the instance of IE that was started by the debugger quits and a difference instance of IE appears to be running.  Because of that, I can't debug the control -- the instance of IE that runs after I say 'OK' to the permission box is not running under the debugger.

I've tried to attach the debugger to the running IE process but that doesn't find the debug pdb file for the control -- all the breakpoints I've set indicate that no debug information is available.

Is there a way to suppress the permissions box to allow the ActiveX control to run cleanly (and supposedly keep the initial instance of IE running)?  Is there something else I need to do in order to debug the control code?

Thanks for any word on this.


unable to renew developer license from vs2013

$
0
0

this is what i get whenever i tried to renew my license . though it was working before installing vs2013 update 4 .

whats wrong? ive also reset all vs settings and uninstall and installed again but not working.:(

can anyone there to help me.


binodtamang


Using the Microsoft help icon (?) in a customised tab integrated in the help menu

$
0
0

I am using the Visual Studio and customizing it for my company. I want to use their help icon in a tab in the help menu which is personalized and integrated with the Visual studio build. I am unable to find the image (?) used. Can anyone help me in locating the image and how to reference it so that I can use it for my integrated menu.

Visual studio 2013 update 4 problem

$
0
0

I updated Visual Studio 2013 to update 4 and subsequently could not run any projects. Attempting to run a project failed with error:

"The debugger resource DLL is out of date. if this problem persists, use 'Add or Remove Programs' in control panel to repair your Visual Studio installation."

I started Visual Studio as administrator and the error occurred both in debug and release modes.

I ran the repair tool twice without success. Rolling back the update resolved the problem.

I haven't been able to find any good information on how to resolve this issue. Has anyone else experienced this and know how to resolve it?

Invalid Index in Crystal Report

$
0
0

Hello,

I have written a code which displays records in the crystal report filtered by a textbox in the windows form. I wanted to pass the value of the textbox into the parameter field found in the header of the report. Please help anyone.

SqlConnection conn = conString.getCon(); ReportDocument cy = new ReportDocument(); dt1 ds = new dt1(); conn.Open(); cy.Load(Application.StartupPath + @"\crpt.rpt"); SqlDataAdapter da = new SqlDataAdapter("exec viewInfo @gen", conn); da.SelectCommand.Parameters.AddWithValue("@gen", txtGender.Text); da.Fill(ds.Info); cy.SetDataSource(ds); cy.SetParameterValue("gName", txtGender.Text); // prompts invalid index although I did check this already

//Everything works except this line

crystalReportViewer1.ReportSource = cy; conn.Close();

Thanks in advance.

'Microsoft.VisualStudio.Editor.Implementation.EditorPackage' package did not load correctly

$
0
0

After the 07/10/2013 Microsoft update, I tried to open Microsoft Visual Studio, then this error showed up

No exports were found that match the constraint: ContractName

Microsoft.VisualStudio.Utilities.IContentTypeRegistryService RequiredTypeIdentity

Microsoft.VisualStudio.Utilities.IContentTypeRegistryService  

This error happened to every member's of our group.

The Microsoft Visual Studio Professional 2012:

Version 11.0.50727.1 RTMREL

Appreciate any help on this issue.

Viewing all 21115 articles
Browse latest View live


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