Quantcast
Channel: Visual Studio and Visual Web Developer Express
Viewing all 3509 articles
Browse latest View live

The name 'username' does not exist in the current context for web projects compiled in x64

$
0
0

I have an ASP.NET web application with the following in the aspx page

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script>
        var username = "<%=username%>";
    </script>

</asp:Content>

The code behind sets up the variable username for example:

public string username = "david";

In Visual Studio error list pane, it shows this error "The name 'username' does not exist in the current context"

So basically any page that I use <%=VARIABLE%> then I get this error.  But it compiles fine and works as expected.  But this error is really annoying when I have other pages with several of these errors.  This only happens when I build the project as x64.  It works fine if I change the project to x86, but my other project in same solution must be x64 and referenced by my web app so everything needs to be x64 or it complains.  So why is it that Visual Studio complains about this error incorrectly when it compiles just fine?  What can I do to fix this?  Is this a bug I need to report to Visual Studio team?


Error when debug langage C by gdb. Errror: The program has exited

$
0
0

hello everyone,
I have just installe VSC and i try to use cygwin and suyu but it can't debug. It show:
Suyu:
Breakpoint 1, 0x000000000040156d in main ()
[Inferior 1 (process 3572) exited normally]
The program has exited with code 0 (0x00000000).
and
cygwin:
ERROR: Unable to start debugging. Unexpected GDB output from command "-exec-run". Error creating process /cygdrive/d/C C++/a.exe, (error 193).
The program has exited with code 42 (0x0000002a).
what should i do? Thank you very much
My test is very easy:

int main()
{
int a, b, sum;
scanf("%d%d",&a, &b);
sum = a+b;
printf("%d + %d = %d",a, b, sum);
return 0;
}

Visual Studio Community 2017

$
0
0

Hi, please somebody refer me, how can I download VS Community 64 bit if exist? Thank you.

Web Application and Web Site project in Visual Studio 2017

$
0
0

After updating to 15.6.1, I discovered that there is a change in the way of creating a new web project - new Web Site project is not available from File->New menu. Instead, this function is moved to "Web->Previous Versions" in the New Project dialog. It seems the new trend is Web Application. Can anyone explain the reason behind this change?

Is there any alternative to Microsoft visual studio 2017?

$
0
0

Is there any alternative to Microsoft visual studio 2017? It's heavy. Will Microsoft visual studio 2017 community edition (not enterprise) do the job for starter?

How can I get back toolbox with tools in General item in visual studio 2017?

$
0
0

How can I get back toolbox with tools in General item in visual studio 2017?

View>Toolbox has html tools but nothing in General tools or asp.net tools.

Typescript version issue

$
0
0

I updated my version of Visual Studio today, and have lost my version of typescript that i was using.

Now within the project properties for typescript where it was set to version 2.1 this now shows as 2.1 (Unavailable)

Via Nuget i installed Microsoft.Typescript.Build 2.1.5 but this doesnt' address the issue...

What do i need to install to have version 2.1 available for selection again within my project?

visual studio 2013 express wants to install visual studio 2015 tools

$
0
0

Dear All,

I have strange problem, I had installed VS 2015 Express on my computer in short time and I came back to VS 2013 EE a few days ago. After that VS 2013 (notifications) wants to install tools:

Developer Analytics Tools & Microsoft ASP.Net and Web Tools (.net core) - it is tools for VS 2015.

Is someone who can explain me that? Thank you in advance.

Krzysztof


How to download a file from cloud and to get the path of that downloaded file through C# programming.

$
0
0

I want to download a file from cloud and i want to get the path of that downloaded file through programming.
I'm able to fetch file by passing the path through a variable. But I need to fetch the file without passing file path as variable.could anyone help me on this.
var folderPath = "C:\\Users\\T430\\source\\repos\\download\\download\\bin\\Debug";
foreach (string file in Directory.EnumerateFiles(folderPath, "sample*.xml"))
{
string contents = File.ReadAllText(file);
Console.WriteLine(contents);
Console.ReadLine();
}

Help how to update code in real time

$
0
0

Can someone help me here?

For the past 12-15 years I've done this (previous to VS2017):

1.) Created a new "Web site" running on my dev computer that ALSO has a full version of IIS running on it as localhost.

2.) Edited as much as I wanted in VS, and pressed SAVE (that's it) then refresh on my web browser (no debug mode) to see what I did. This was FAST.

Now I don't seem to have that option. How can I "edit and save and view QUCKLY' my changes in VS and whatever browser (chrome) I want? Meaning do I have to use that Terrible "debug mode?" Because it doesn't let me save stuff in real time and just click "reload" on the browser. That's what I need to do.

 

using visual studio Performance Profiler to find memory hogging code - question

$
0
0

My code uses too much memory at some point.   It might be due to the fact that I use so may session variables (including structures), or it might be due to using the callback feature frequently, or I may not be closing connections etc.   Anyway, I ran Performance-Profiler (on the VS menu) and it opened Internet-explorer (I would have preferred EDGE) and then it wouldn't run  the JavaScript on the pages, so I couldn't really get the program to work, but I did get this chart.  What does this chart tell me?

Thanks:

performance profiler

Data is not getting inserted in to the database

$
0
0

Hi experts,

I recently started working in asp.net c#. right now working on a sample project but having some trouble.  When i insert the data into database nothing gets inserted except for that table's primary key without any error. here is the code. 

database table

CREATE TABLE [dbo].[product] (
[p_id] INT IDENTITY (1, 1) NOT NULL,
[p_name] VARCHAR (50) NULL,
[description] VARCHAR (MAX) NULL,
[datetime] VARCHAR (50) NULL,
[image] VARCHAR (50) NULL,
[p_price] VARCHAR (50) NULL,
[quantity] INT NULL,
[category] VARCHAR (50) NULL,
CONSTRAINT [PK_product] PRIMARY KEY CLUSTERED ([p_id] ASC)
);

asp.net design page

<section id="main-content" class=" ">
<section class="wrapper main-wrapper row" style=''>
<div class='col-xs-12'>
<div class="page-title">

<div class="pull-left">
<!-- PAGE HEADING TAG - START -->
<h1 class="title">Add a Product</h1>
<!-- PAGE HEADING TAG - END -->
</div>

<div class="pull-right hidden-xs">
<ol class="breadcrumb">
<li>
<a href="index.aspx"><i class="fa fa-home"></i>Home</a>
</li>
<li>
<a href="Products.aspx">Products</a>
</li>
<li class="active">
<strong>Add Product</strong>
</li>
</ol>
</div>

</div>
</div>
<div class="clearfix"></div>
<!-- MAIN CONTENT AREA STARTS -->
<div class="col-xs-12">
<section class="box ">
<header class="panel_header">
<h2 class="title pull-left">Basic Info</h2>
<div class="actions panel_actions pull-right">
<a class="box_toggle fa fa-chevron-down"></a>
<a class="box_setting fa fa-cog" data-toggle="modal" href="Settings.aspx"></a>
<a class="box_close fa fa-times"></a>
</div>
</header>
<div class="content-body">
<div class="row">
<div class="col-xs-12 col-sm-9 col-md-8">

<div class="form-group">
<label>Name</label>
<asp:TextBox runat="server" CssClass="form-control" ID="t1"></asp:TextBox>
</div>
<div class="form-group">
<label class="form-label">Product Name</label>
<span class="desc"></span>
<div class="controls">

</div>
</div>

<div class="form-group">
<label class="form-label">Image</label>
<span class="desc"></span>
<div class="controls">
<p>
<label for="image">
No Image Selected<br />
<asp:Button runat="server" ID="browseImg" CssClass="btn btn-primary" Text="Browse" /></label>
</p>
</div>
</div>

<div class="form-group">
<label class="form-label" for="description">Description</label>
<span class="desc"></span>
<div class="controls">
<asp:TextBox runat="server" CssClass="form-control" ID="t2"></asp:TextBox>
</div>
</div>
<div class="form-group">
<label class="form-label" for="price">Price</label>
<span class="desc"></span>
<div class="controls">
<asp:TextBox runat="server" CssClass="form-control" ID="t3"></asp:TextBox>
</div>
</div>
<div class="form-group">
<label class="form-label" for="qty">Quantity</label>
<span class="desc"></span>
<div class="controls">
<asp:TextBox runat="server" CssClass="form-control" ID="t4" ></asp:TextBox>
</div>
</div>
<div class="form-group">
<label class="form-label" for="category">Category</label>
<span class="desc"></span>
<div class="controls">
<asp:TextBox runat="server" CssClass="form-control" ID="t5"></asp:TextBox>
</div>
</div>
<div class="col-xs-12 col-sm-9 col-md-8 padding-bottom-30">
<div class="text-left">
<asp:LinkButton runat="server" CssClass="btn btn-primary" ID="saveButton" Text="Add" OnClick="saveButton_Click" ></asp:LinkButton>
<asp:LinkBUtton runat="server" CssClass="btn btn-primary" id="deleteButton" text="delete" OnClick="deleteButton_Click"></asp:LinkBUtton>
</div>
</div>
<div>
<asp:Label runat="server" class="form-label" ID="status" Text="" /></div>
</div>
</div>


</div>
</section>
</div>
<div>
</div>

</section>

</section>

code behind button

protected void saveButton_Click(object sender, EventArgs e)
{
DateTime dt = new DateTime();
dt = DateTime.Now;
string mydate = dt.ToString();
con.Open();
string str = "INSERT INTO product([p_name],[description],[datetime],[image],[p_price],[quantity],[category])VALUES('"+t1.Text+"','"+t2.Text+"','"+mydate+"','"+null+"','"+t3.Text+"','"+t4.Text+"','"+t5.Text+"')";
SqlCommand cmd = new SqlCommand(str, con);
cmd.ExecuteNonQuery();
con.Close();
}

i've been through so many tutorials and lectures but nothing is of real help until now.

please take a look at this and tell me where I am going wrong and why the garbage values are getting inserted in to the database. I expect a quick responose brothers. it'll be a lot of help.

Thanks

Where to download offline setup of latest VS2017

$
0
0

please share link from where to download offline setup of latest VS2017 ?

what was the last stable version ? i am not looking for any RC version. i want last stable version. guide me with right link. thanks

The project file could not be loaded. Root element is missing.

$
0
0

Hello everyone and thanks for your help in advance.  I was working on a VS 2015 project when my computer unexpectedly shut down.  The computer restarted fine, however, when trying to open the project I was working on, I now receive the error "The project file could not be loaded. Root element is missing.".  I looked in the project folder and now see four HTML files UpgradeLog through UpgradeLog4.  Each file has the same message "KidsMedical_Api\KidsMedical_Api.vbproj:Error on line 1. Expected '<' but found 'null character'."  When opening the vbproj file with notepad, I see the following:

<?xml version="1.0" encoding="utf-8"?><Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"><PropertyGroup><ProjectView>ShowAllFiles</ProjectView><NameOfLastUsedPublishProfile>Production</NameOfLastUsedPublishProfile><WebStackScaffolding_IsLayoutPageSelected>False</WebStackScaffolding_IsLayoutPageSelected><WebStackScaffolding_IsPartialViewSelected>False</WebStackScaffolding_IsPartialViewSelected><WebStackScaffolding_IsReferencingScriptLibrariesSelected>False</WebStackScaffolding_IsReferencingScriptLibrariesSelected><WebStackScaffolding_LayoutPageFile /><WebStackScaffolding_IsAsyncSelected>False</WebStackScaffolding_IsAsyncSelected><UseIISExpress>true</UseIISExpress><WebStackScaffolding_ViewDialogWidth>600</WebStackScaffolding_ViewDialogWidth><WebStackScaffolding_ControllerDialogWidth>600</WebStackScaffolding_ControllerDialogWidth></PropertyGroup><ProjectExtensions><VisualStudio><FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}"><WebProjectProperties><StartPageUrl>PatientDemographics.html</StartPageUrl><StartAction>SpecificPage</StartAction><AspNetDebugging>True</AspNetDebugging><SilverlightDebugging>False</SilverlightDebugging><NativeDebugging>False</NativeDebugging><SQLDebugging>False</SQLDebugging><ExternalProgram></ExternalProgram><StartExternalURL></StartExternalURL><StartCmdLineArguments></StartCmdLineArguments><StartWorkingDirectory></StartWorkingDirectory><EnableENC>True</EnableENC><AlwaysStartWebServerOnDebug>True</AlwaysStartWebServerOnDebug></WebProjectProperties></FlavorProperties></VisualStudio></ProjectExtensions></Project>

So the xml looks fine to me unless I am missing something.  All other projects open and load fine, so this is the only one causing me problems, so I doubt it has anything to do with framework corruption which seems to be a common theme with this problem.  To be clear, no upgrade was purposefully performed, so I have no idea what triggered the upgrade files as this project was built from the start in VS 2015.  I'm not sure what the next step is.  Any help would be appreciated.

An unhandled exception(Script Breakpoint) occured in iexplorer.exe[8396]

$
0
0

Hi,
We are facing the below debugger issue in Microsoft visual studio12 issue while working with IE version 11 and windows7 (64 bit ),When we debug the code using debugger keyword in the JavaScript .

An unhandled exception(Script Breakpoint) occured in iexplorer.exe[8396]

We have also tried the following steps
1.Cleared the local tempfile ,passwords etc. in internet settings as well as in \Local\Temp path
2. Enabled the 2 checkbox (Disable Script debugging in IE and other ) in Advanced option and also Reset the Internet settings  
3.Enabled the  Compatibility mode in System32 for vsjitdebugger.
4.We have restarted the machine also.
But still we are getting the error while running the application in IE. Please suggest us any solution to resolve this issue and also confirm us whether it requires any system admin rights to do further investigation to resolve the debugger  issue. Since at present we don’t have the system admin privileges for the system in which issue occurs.


Suddenly, Academy.vbproj is empty !

$
0
0

Hello everybody

I am developing ASP.net web forms application (VB.net).

Suddenly, I can see many html files (UpgradeLog.htm, UpgradeLog2.htm .....) and the file (Academy.vbproj) is empty. seems like it is erased !

is there any method to regenerate it? or recover it ?

Thank you

streaming from webcam to asp.net

$
0
0

Heya folks, I'm building a website in asp.net for fun and I'd like to try my hands at hosting a webcam stream on the website, but I can't really figure out how to get started.
I know that there's software like OBS (open broadcaster software) that can stream to a link, but I don't know how I would have the website accept and display that.

Pretty much all tutorials I found seemed to be geared towards the kind of streaming that youtube does (a video is hosted on the server and is streamed to the user), but I assume that for a live stream this would be a different setup?
Can anyone point me in the right direction?

How can I upgrade Visual Studio to a specific version?

$
0
0

Hi,

I am running Visual Studio 2017 Professional Version 15.0.0+26228.23 and I want to upgrade it to VS 2017 Professional 15.5.3.

When I click on notifications it is taking me to Vesion 15.6 which I don't want.

I want to exactly upgrade to Version 15.5.3.

How can I upgrade Visual Studio to a specific version?

Thanks,

Why doesn't Visual Studio 2017 discover my unit tests?

$
0
0

Hello,

Ever since I migrated over to Visual Studio 2017 from 2015, I've been having issues getting my unit tests to be discovered. I have a project with 824 unit tests. Visual Studio 2015 had no trouble discovering them. Then when I opened the project in 2017, no tests were discovered. I tried clearing the solution, rebuilding the solution, rebuilding the Test project, "Run All", etc. but nothing works.

An even bigger issue is that this is affecting Visual Studio 2015. When I go back to VS2015, I find my unit tests are no longer discoverable there too.

SOMETIMES what sort of works is when I update Nuget packages or install new ones. The project has had NUnit since the beginning but Nuget gives me the option to update it. Further, I can also install NUnit3TestAdaptor, NUnitTestAdapter, and NUnit.Runners (which installs a whole bunch of dependency packages). I say SOMETIMES this works because it's hit and miss (different combinations at different times, something nothing), and because it only ever ends up discovering 77 out of the 824 unit tests I have in place.

The last thing I tried, in VS2017, was to undo all my changes to the Test project (which consisted only of all the package installs and updates). I've done this before to no avail, but somehow magically this time it worked: all 824 tests showed up! By UNINSTALLING all additional packages and updates.

So then I open VS2015 <-- There they were! Awesome! I opened VS2017 and... they're gone. Cleaned solution, rebuilt, rebuilt Test project in particular, clicked "Run All" and... nothing. I'm back at square one.

This looks to me like it's a problem with VS2017. When you start it up, and it tries to discover any unit tests, it fails. It not only fails, but it messes things up for other versions of Visual Studio.

Does anyone know what's going on here and how to fix it?

VS 2012/Silverlight 5 .net 4.7 not installed

$
0
0

I have an older Silverlight project using VS 2012 that I need to make some changes to, when I open it in VS 2012 I get the error indicating that the project is targeting the 4.7 framework and that it's not installed, do I want to download it.

The current framework installed is 4.7.1, but VS cannot detect it, what could be causing this. I have confirmed that 4.7.1 is installed.

I also have .Net Core installed but I don't see why that would interfere.

Thanks

Viewing all 3509 articles
Browse latest View live


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