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

problem

$
0
0

how do i solve this

<Error Condition="$(MDAInstallErrorCode) != '0' And $(MDAInstallErrorCode) != '-17'" Text="Error installing local npm package.

 in visual studio 2015 rc


Adding data to a table

$
0
0

I would like the most direct way to add data to a defined table in a database I have created. In a previous version of VS, I was able to do this easily but the method I had used seems to have disappeared. Does it amount to creating a stream of sql insert

statements or is there some less tedious way to get me there?  I was doing this before windows and now I am trying to catch up to do it in my VS2013 environment.

Using VS 2015 iOS static library output

$
0
0

This might be a bug with the current preview of VS 2015 (Community RC). If so I would like to report it, otherwise I would like some assistance if possible.

VS 2015 seems to support the creation of iOS static C++ libraries. I can in fact create such a project and get it to compile using VCRemote. My problem is that it does not seem as if though one can actually do anything with the output.

The first reason is because as far as I can tell, the .a is never actually copied back to the Windows machine after compiling because I could not find it anywhere even when a build is successful. Without the .a file, I cannot do anything with it...

The second reason is that one would expect to be able to instruct VS to reference the output of the C++ library in a Xamarin.iOS C# application (which VS 2015 supposedly has native/very good support for). This works for Xamarin.Android and VS 2015 Android C++ library projects and has always worked for Windows projects... Currently it complains about the output not being a DLL or an EXE when I try to add a reference.

These appear like bugs to me, and like rather small ones two. Am I missing something here? Otherwise, if someone from MS is listening, could you please fix this, because it is making a feature with huge potential quite useless.

How to update GUI

$
0
0

Hello, I'm new at programming and probably asking some very stupid questions so please bare with me.

I made a CPU Monitor that runs in a console window. 

I know want to create a GUI for an extremely similar program. I just don't know how to do it. I've been looking at the toolbar in VS and don't know which tool to use. All I want to do is print the CPU Load and available RAM to the screen and have it update every second. If someone could please point me in the right direction that would be greatly appreciated. 

Thank you,

Matthew

Msoftcon.h and Msoftcon.cpp

$
0
0

i have added both to my source file but when i compile the code it gives me error in msoftcon.cpp kindly help me 

how to fix this 

Error1 error C2664: 'HANDLE CreateFileW(LPCWSTR,DWORD,DWORD,LPSECURITY_ATTRIBUTES,DWORD,DWORD,HANDLE)' : cannot convert argument 1 from 'const char [8]' to 'LPCWSTR'c:\users\haider rashid khan\downloads\compressed\msoftcon.cpp171 training 2

ERROR2 IntelliSense: argument of type "const char *" is incompatible with parameter of type "LPCWSTR"c:\Users\Haider Rashid Khan\Downloads\Compressed\msoftcon.cpp1526 training 2

//msoftcon.cpp
//provides routines to access Windows console functions

//compiler needs to be able to find this file
//in MCV++, /Tools/Options/Directories/Include/type path name

#include "msoftcon.h"
HANDLE hConsole;         //console handle
char fill_char;          //character used for fill
//--------------------------------------------------------------
void init_graphics()
   {
   COORD console_size = {80, 25};
   //open i/o channel to console screen
   hConsole = CreateFile("CONOUT$", GENERIC_WRITE | GENERIC_READ, // COMPILER HAS UNDERLINE CONOUT$
                   FILE_SHARE_READ | FILE_SHARE_WRITE,                              // when i compile it
                   0L, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0L);
   //set to 80x25 screen size
   SetConsoleScreenBufferSize(hConsole, console_size);
   //set text to white on black
   SetConsoleTextAttribute( hConsole, (WORD)((0 << 4) | 15) );

   fill_char = '\xDB';  //default fill is solid block
   clear_screen();
   }
//--------------------------------------------------------------
void set_color(color foreground, color background)
   {
   SetConsoleTextAttribute( hConsole, 
                        (WORD)((background << 4) | foreground) );
   }  //end setcolor()

/* 0  Black          8  Dark gray
   1  Dark blue      9  Blue
   2  Dark green     10 Green
   3  Dark cyan      11 Cyan
   4  Dark red       12 Red
   5  Dark magenta   13 Magenta
   6  Brown          14 Yellow
   7  Light gray     15 White
*/
//--------------------------------------------------------------
void set_cursor_pos(int x, int y)
   {
   COORD cursor_pos;              //origin in upper left corner
   cursor_pos.X = x - 1;          //Windows starts at (0, 0)
   cursor_pos.Y = y - 1;          //we start at (1, 1)
   SetConsoleCursorPosition(hConsole, cursor_pos);
   }
//--------------------------------------------------------------
void clear_screen()
   {
   set_cursor_pos(1, 25);
   for(int j=0; j<25; j++)
      putch('\n');
   set_cursor_pos(1, 1);
   }
//--------------------------------------------------------------
void wait(int milliseconds)
   {
   Sleep(milliseconds);
   }
//--------------------------------------------------------------
void clear_line()                    //clear to end of line
   {                                 //80 spaces
   //.....1234567890123456789012345678901234567890
   //.....0........1.........2.........3.........4 
   cputs("                                        ");
   cputs("                                        ");
   }
//--------------------------------------------------------------
void draw_rectangle(int left, int top, int right, int bottom)
{
char temp[80];
int width = right - left + 1;

for (int j = 0; j < width; j++)
{

//string of squares
temp[j] = fill_char;
temp[j] = 0;                    //null
}
   for(int y=top; y<=bottom; y++)  //stack of strings 
      {
      set_cursor_pos(left, y);
      cputs(temp);
      }
   }
//--------------------------------------------------------------
void draw_circle(int xC, int yC, int radius)
   {
   double theta, increment, xF, pi=3.14159;
   int x, xN, yN;

   increment = 0.8 / static_cast<double>(radius);
   for(theta=0; theta<=pi/2; theta+=increment)  //quarter circle
      {
      xF = radius * cos(theta);  
      xN = static_cast<int>(xF * 2 / 1); //pixels not square
      yN = static_cast<int>(radius * sin(theta) + 0.5);
      x = xC-xN;
      while(x <= xC+xN)          //fill two horizontal lines
         {                       //one for each half circle
         set_cursor_pos(x,   yC-yN); putch(fill_char);  //top
         set_cursor_pos(x++, yC+yN); putch(fill_char);  //bottom
         }
      }  //end for
   }
//--------------------------------------------------------------
void draw_line(int x1, int y1, int x2, int y2)
   {

   int w, z, t, w1, w2, z1, z2;
   double xDelta=x1-x2, yDelta=y1-y2, slope;
   bool isMoreHoriz;

   if( fabs(xDelta) > fabs(yDelta) ) //more horizontal
      {
      isMoreHoriz = true;
      slope = yDelta / xDelta;
      w1=x1; z1=y1; w2=x2, z2=y2;    //w=x, z=y 
      }
   else                              //more vertical
      {
      isMoreHoriz = false;
      slope = xDelta / yDelta;
      w1=y1; z1=x1; w2=y2, z2=x2;    //w=y, z=x
      }

   if(w1 > w2)                       //if backwards w
      {
      t=w1; w1=w2; w2=t;             //   swap (w1,z1)
      t=z1; z1=z2; z2=t;             //   with (w2,z2)
      }
   for(w=w1; w<=w2; w++)            
      {
      z = static_cast<int>(z1 + slope * (w-w1));
      if( !(w==80 && z==25) )        //avoid scroll at 80,25
         {
         if(isMoreHoriz)
            set_cursor_pos(w, z);
         else
            set_cursor_pos(z, w);
         putch(fill_char);
         }
      }
   }
//--------------------------------------------------------------



void draw_pyramid(int x1, int y1, int height)
   {
   int x, y;
   for(y=y1; y<y1+height; y++)
      {
      int incr = y - y1;
      for(x=x1-incr; x<=x1+incr; x++)
         {
         set_cursor_pos(x, y);
         putch(fill_char);
         }
      }
   }
//--------------------------------------------------------------
void set_fill_style(fstyle fs)
   {
   switch(fs)
      {
      case SOLID_FILL:  fill_char = '\xDB'; break;
      case DARK_FILL:   fill_char = '\xB0'; break;
      case MEDIUM_FILL: fill_char = '\xB1'; break;
      case LIGHT_FILL:  fill_char = '\xB2'; break;
      case X_FILL:      fill_char = 'X';    break;
      case O_FILL:      fill_char = 'O';    break;
      }
   }
//--------------------------------------------------------------

VS 2015 RC - Unable to debug in Simulator

$
0
0

I'm trying to evaluate VS 2015 and start the task of porting a Windows 8.1 app to a universal app. Starting out, I created the simplest of universal applications with only one button to exit the app. I can run it on the local machine just fine (Windows 10 build 10130), but when I try to run in the simulator I get this error message. How can a resolve this problem?

Error 0xc000007b VISUAL STUDIO 2013

Can't create new projects in Visual Studio 2013

$
0
0

Installed VS Community 2013. The installation was successful.

When trying to create new c# project from template I receive this exception message:

Could not find a part of the path..followed by the path to the template.

The path and the template are valid and exist on my desktop.

However, I was able to open existing solution projects. 

Any assumption or suggestion for what is causing this message?

Note: I also installed the Express version and receive the same exception!

Thanks!!


Unit Tests not found in VS2015RC Community Version

$
0
0

I have written some unit tests using Xunit and everthing ran ok when I first wrote the code. However the next time I started Visual Studio and loaded the solution the tests where not found.

I have searched the internet for a solution and one solution was to start Visual Studio as administrator, but this did not fix the problem.

Does anyone have any idea why the unit tests should not be found?

Thanks

Ivan Wuljahorodsky


How do I start JSON editor ?

$
0
0

I have just installed  VS2013 community edition  Update 4.

I can find the XML editor OK, but I see no sign of the JSON editor?

Examples are shown in Release candidates from 2014 but the menus seem to have changed.

Does it exist?  Do I have to install some addin?  Use a special Template?


Joe

Visual Studio Ultimate 2013

$
0
0

I recently downloaded ultimate and after testing it, have noticed these error messages after I run my program, I don't know what they mean. My program will run but then after it done and I exit I get those messages. Is this something to worry about???

'demo.exe' (Win32): Loaded 'C:\Windows\SysWOW64\KernelBase.dll'. Cannot find or open the PDB file.

'demo.exe' (Win32): Loaded 'C:\Program Files\Bitdefender\Bitdefender 2015\active virus control\Avc3_00305_007\avcuf32.dll'. Cannot find or open the PDB file.

'demo.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcp120d.dll'. Cannot find or open the PDB file.

'demo.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcr120d.dll'. Cannot find or open the PDB file.

Application "\??\C:\WINDOWS\system32\cmd.exe" found in cache

The program '[11712] demo.exe' has exited with code -1073741510 (0xc000013a).

'demo.exe' (Win32): Loaded 'C:\Windows\SysWOW64\KernelBase.dll'. Cannot find or open the PDB file.


'demo.exe' (Win32): Loaded 'C:\Program Files\Bitdefender\Bitdefender 2015\active virus control\Avc3_00305_007\avcuf32.dll'. Cannot find or open the PDB file.


'demo.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcp120d.dll'. Cannot find or open the PDB file.


'demo.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcr120d.dll'. Cannot find or open the PDB file.


Application "\??\C:\WINDOWS\system32\cmd.exe" found in cache


The program '[11712] demo.exe' has exited with code -1073741510 (0xc000013a).

How to assembler a .asm file under both 32- and 64-bit projects?

$
0
0

My project builds both a 32- and 64-bit executable.  The project includes one assembler file for low level functions.  Previously under VS2008, I had separate 32- and 64-bit .vcproj files.  Now that I've switched to VS2013, I'm trying to put the four platforms (Debug32/Release32/Debug64/Release64) all into one .vcproj file (which VS2013 will convert to a .vcxproj file).  In this context, I can't see how to specify that the 32-bit version must use the 32-bit assembler (ml.exe) and that the 64-bit version must use the 64-bit assembler (ml64.exe).

Under VS2008 I used a separate masm64.rules file which specified the correct drive, path, and name of the 64-bit assembler.  I don't see how to integrate that into the combined project file.

I tried using the 64-bit .rules file specifying it in the <ToolFiles> section, in each <Configuration> section as <Tool Name=MASM64" AdditionalOptions="..." />, and in the 64-bit <FileConfiguration> sections as in

            <File
                RelativePath=".\DBGBRK.ASM"
                >
                <FileConfiguration
                    Name="Debug32|Win32"
                    >
                    <Tool
                        Name="MASM"
                    />
                </FileConfiguration>
                <FileConfiguration
                    Name="Release32|Win32"
                    >
                    <Tool
                        Name="MASM"
                    />
                </FileConfiguration>
                <FileConfiguration
                    Name="Debug64|Win32"
                    >
                    <Tool
                        Name="MASM64"
                    />
                </FileConfiguration>
                <FileConfiguration
                    Name="Release64|Win32"
                    >
                    <Tool
                        Name="MASM64"
                    />
                </FileConfiguration>
            </File>
but the compiler complains that "Having multiple tools for the same file is unsupported in MSBuild."

Then I split out the 64-bit code into a separate .asm file and made changes to the .vcproj file, but when I build the 32-bit version the compiler is attempting to assemble both the 32- and 64-bit .asm files.

The .sln and .vcproj files from this last try may be found in http://www.nars2000.org/NARS2000/

Any help is greatly appreciated.

C# - How do you send message from server to clients

$
0
0

Hi!
I'm writing a program that communicates between one server and several clients. My problem this time is that I can't figure out how I send a message from the server to the clients in a method. Right now, this is my source code:

private static void SendMessage(string msg)
    {
        Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
        socket.Send(Encoding.UTF8.GetBytes(msg));
    }

I know I'm missing a lot and I've googled how I should send the message and I've come across the word AcyncResult but I don't know how i should implent it.

So, what's the best way to send a message from the server to the clients, and how?
(Ask if you want other parts of the source)

vs 2015 nuget errors

$
0
0

hi,

i have an issue when trying to add firebird entty framework package in vs 2015 rc, this worked  just fine with vs 2013

here the error log

Attempting to gather dependencies information for package 'EntityFramework.Firebird.4.6.2' with respect to project targeting '.NETFramework, Version=v4.5.2'
Attempting to resolve dependencies for package 'EntityFramework.Firebird.4.6.2' with DependencyBehavior 'Lowest'
Resolving actions to install package 'EntityFramework.Firebird.4.6.2'
Resolved actions to install package 'EntityFramework.Firebird.4.6.2'
For adding package 'EntityFramework.Firebird 4.6.2' to project 'tmpapp' that targets 'net452'.
For adding package 'EntityFramework.Firebird 4.6.2' to project 'tmpapp' that targets 'net452'.
Adding package 'EntityFramework.Firebird 4.6.2' to folder 'C:\Dev\WPF\Projects\Cardio\CardioRC\packages'
Added package 'EntityFramework.Firebird 4.6.2' to folder 'C:\Dev\WPF\Projects\Cardio\CardioRC\packages'
Added reference 'EntityFramework.Firebird' to project 'tmpapp'.
Added package 'EntityFramework.Firebird 4.6.2' to 'packages.config'
For adding package 'EntityFramework.Firebird.4.6.2' to project 'tmpapp' that targets 'net452'.
Executing script file 'C:\Dev\WPF\Projects\Cardio\CardioRC\packages\EntityFramework.Firebird.4.6.2.0\tools\install.ps1'...
Exception calling "LoadFrom" with "1" argument(s): "Invalid directory on URL."
At C:\Dev\WPF\Projects\Cardio\CardioRC\packages\EntityFramework.6.1.2\tools\EntityFramework.psm1:780 char:5+     $utilityAssembly = [System.Reflection.Assembly]::LoadFrom((Join-Path $ToolsP ...+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+ CategoryInfo          : NotSpecified: (:) [], MethodInvocationException+ FullyQualifiedErrorId : ArgumentException

You cannot call a method on a null-valued expression.
At C:\Dev\WPF\Projects\Cardio\CardioRC\packages\EntityFramework.6.1.2\tools\EntityFramework.psm1:781 char:5
+     $dispatcher = $utilityAssembly.CreateInstance(+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+ CategoryInfo          : InvalidOperation: (:) [], RuntimeException+ FullyQualifiedErrorId : InvokeMethodOnNull

Exception calling "CreateInstanceFrom" with "8" argument(s): "Invalid directory on URL."
At C:\Dev\WPF\Projects\Cardio\CardioRC\packages\EntityFramework.6.1.2\tools\EntityFramework.psm1:809 char:5+     $domain.CreateInstanceFrom(+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~+ CategoryInfo          : NotSpecified: (:) [], MethodInvocationException+ FullyQualifiedErrorId : ArgumentException

Exception calling "LoadFrom" with "1" argument(s): "Invalid directory on URL."
At C:\Dev\WPF\Projects\Cardio\CardioRC\packages\EntityFramework.6.1.2\tools\EntityFramework.psm1:780 char:5+     $utilityAssembly = [System.Reflection.Assembly]::LoadFrom((Join-Path $ToolsP ...+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+ CategoryInfo          : NotSpecified: (:) [], MethodInvocationException+ FullyQualifiedErrorId : ArgumentException

You cannot call a method on a null-valued expression.
At C:\Dev\WPF\Projects\Cardio\CardioRC\packages\EntityFramework.6.1.2\tools\EntityFramework.psm1:781 char:5
+     $dispatcher = $utilityAssembly.CreateInstance(+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+ CategoryInfo          : InvalidOperation: (:) [], RuntimeException+ FullyQualifiedErrorId : InvokeMethodOnNull

Exception calling "CreateInstanceFrom" with "8" argument(s): "Invalid directory on URL."
At C:\Dev\WPF\Projects\Cardio\CardioRC\packages\EntityFramework.6.1.2\tools\EntityFramework.psm1:809 char:5+     $domain.CreateInstanceFrom(+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~+ CategoryInfo          : NotSpecified: (:) [], MethodInvocationException+ FullyQualifiedErrorId : ArgumentException

Successfully installed 'EntityFramework.Firebird 4.6.2' to tmpapp.
========== Finished ==========

any help is welcome

Issue debugging classic asp in VS2013

$
0
0

Hi,

Have been successfully debugging classic ASP web site in VS2013, until yesterday when I can no longer attach to the process w3wp.exe, get the message 'Unable to attach to the process.....'.  Have tried uninstalling and reinstalling VS, resetting all my settings in the Import Export wizard etc.  Any pointers gratefully received.

Many Thanks

Laurence


Clicking on any control results in "Could not complete the action"

$
0
0

So, umm... help ?

Win7.1 x64, VS2010 Professional and VS2013 Express Web edition are both installed. Has been working fine since forever.

I'm not 100% what's kicked this off, but all my working web applications are now throwing errors in the IDE. The source files have NOT been changed, and I can confirm this in SVN.

So, open a project, open the default.aspx, find an ASPX button on it, double-click it to see the code-behind, and it comes up with "Could not complete the action". Both VS2010 and VS2013 exhibit this exact same behaviour.

Right-click on the page and do "view code", and the page comes up. Every piece of code that references a control on the page has a line under it and the Error list goes through the roof:

Error2 'lblStatus' is not declared. It may be inaccessible due to its protection level.C:\inetpub\wwwroot\QuotaManager\QuotaManager\Default.aspx.vb4113 http://localhost/QuotaManager/

lblStatus label is clearly in the source code, as is every other control displaying the same error. I've seen this in the past when the headers get mangled in the <%@ Page/> directives, but again - these files/projects have NOT changed.

The only thing I can think of that changed* is I installed Nuget as I read it was a nice easy way to reference the Powershell System Automation libraries (I can never remember where they are), so I did that. The problem has been around since after that, but this may be a red herring.

I'm thinking some component has been registered at the wrong level, and that's why both IDEs are screwed with working code. Oh yeah... and despite the 80-odd errors, the solution builds and runs fine.

If I create a brand new project, it works fine. But again.. my existing project have NOT changed.

Any help?

Thanks

AW

* https://www.nuget.org/packages/System.Management.Automation




Multiple project files in a folder causes packages.config corrruption

$
0
0

For historical reasons mainly, and in a couple of cases functional reasons, we have a few places where multiple visual studio project files exist in a filesystem directory.  The NuGet integration gets horribly confused and ends up corrupting the projects (leaving orphaned xml elements) when you make changes, including stepping to a new version of a package.

Everywhere else VS associates a file with a project the name of the file incorporates the name of the project file; eg the .user files, and this setup has been working since VC6.

I don't see any indication that the name or location can be overridden.  An item is created so the packages.config file gets displayed in the tree view but it doesn't seem plausible that the integration is picking that up; it has no unique-ifying attributes.

The historical situation was that a very large project was broken up by making multiple copies of the project file and deleting subsets of the source from each, leaving them disjoint but in one folder.  I can reorganize that; it won't be pleasant but it's a finite task.

The functional situation has to do with the desire to product a comprehensive product as the result of building a solution; there are some pieces of code that have to be built in more than one configuration to make that happen but there's no way to associate more than one configuration of any given project with one solution-level configuration.  Hence, multiple project files for one folder full of code.  I suppose I can make two subfolders and push the project files down a level there as well.  Sigh.

My question here is simply this: is there a mechanism for managing the name/location of the packages.config file associated with a project file?


Stephen W. Nuchia StatSoft, Inc. Tulsa, Oklahoma USA

Microsoft Visual Studio Ultimate 2013 taking too much time for startup

$
0
0

Hi, Greetings for the day! Since 16 May 2015 (for last 3 days), my visual studio is taking too much time while startup. Please help to troubleshoot. Thanks & Regards, Vinayak Nikam.

Unable to open JSON file as it exceeds the 5 MB limit for the JSON editor

$
0
0
For my Windows 8.1 universal app, my source data stored in JSon file exceeds the 5MB limit for the JSON editor and therefore my app fails to initialize. Now I cannot run both my Windows phone 8.1 and Windows 8.1 app. Also, now when I open my JSON file for editing, the VS 2013 JSON editor does not allow me to add more data to it. Anyone encountered this issue before? Any idea on how to increase the 5MB limit, or split the file into multiple files, and yet let the application use it as one big JSon file?

Unable to Create a C++ Projekt in VisualStudio 2010

$
0
0

Hi,

my Visual Studio does not create new C++ Projecs, in older Projects it doesen't find my C++-Compiler, that is installed with Visual Studio.

I have a fresh Windows 7 Installation, installed 3 days ago as well a new Visual Studio Professional Installation (complete), I only modified the pathes to my projects. When I try to create a new C++ project the wizard flickers and the same window reapears without a project created. Projects in the other languages (c#, F#,...) are created without any trouble. My older C++ projects compile with Visual Studio 2010 on different machines, so I'm fairly sure the projects aren't corrupt.

I have the same problems in safe mode (Windows and/or VS) and new account, already tried reseting the Default Settings as well as repairing the VS Installation with the wizard and a new Installation. None did work, so I still cannot work with C++ in VS.

Regards

Patricia

Viewing all 21115 articles
Browse latest View live


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