VS2013: Clicking Compile does nothing - vb.net

See Image for Reference http://i.stack.imgur.com/Ujjkt.png
When I click on Complie button(Iniciar in Spanish) the solution gives no errors, everything seems to be ok but the Solution won't start running... BTW this happends almost all the time, not always but atleast 80% of the time, after 9999999 Clicks it starts normally... So I don't know what can be the problem

Try this.
Right click your project and select "Properties"
On the "Debug" tab, un-check "Enable the Visual Studio Hosting Process".
Save project and re-compile.
Try and run program

Related

Xamarin - Error IDE1100 Error reading content of source file

I've made a new content page, but forgot to type the name.. So I deleted it an made it again with proper name..
I have done it like this multiple times already, but this time something went wrong and I cannot compile.
I have this error message:
Severity Code Description Project File Line Suppression State
Error IDE1100 Error reading content of source file
'C:\Users\shark\source\repos\GalShare\GalShare\GalShare\Views\Page1.xaml' -- 'Could not find file
'C:\Users\shark\source\repos\GalShare\GalShare\GalShare\Views\Page1.xaml'.'. GalShare-XamlProject
C:\Users\shark\source\repos\GalShare\GalShare\GalShare\Views\Page1.xaml 1 Active
I have done nothing except the steps above.. What is the cause of this error and how can I fix it?
Cleaning the project did not solve, but closing and reopening solved my problem.
In addition to the answers of E.Zhao and messyprogrames, here a step-by-step walkthrough.
Clean Solution:
Navigation Bar > "Build" > "Clean Solution"
Unload project:
Choose your "problem project" on the right side within the solution explorer. Right mouse click > "Unload Project"
Reload project:
Choose your unloaded "problem project" again. Right mouse click > "Reload Project".
Opening and closing the solution wasn't helping, but unloading and reloading the project worked.
Actually, it is unnecessary to exit and reopen current solution, try to clean the error project, unload and then reload it again. hope it works for you.
In VS click your initials > Account Settings > and check there's no warning there asking you to re-fresh your credentials. It was this for me. After I re-entered my credentials, cleaned and rebuilt all was fine.
Unloading and reloading the project worked for me.
To reproduce this, in a new folder add a WPF user control with a accidental typo.
Rename with F2 or simply rename,
the code behind doesn't rename, so change that.
Initalize component gets a good old red squiggly!
create a new one with an appended number as you want to crack on...
delete the user control that you originally created.
You will get this error (well I did on enterprise edition Version 16.7.2)
Then as other contributors have suggest, remove the pain by unloading and reloading the project.

Visual Studio 2013 - F10 / F11 stopped working on upgrade?

I just upgraded my Visual Studio from 2012 to 2013 and haven't done anything else yet short of installing all the updates recommended.
For whatever reason, when I go into my solution and press F10 or F11, it runs the entire program as if I had pressed F5... F8 works the way F10 used to, but I don't know why the keys I've always used now don't.
I set up visual studio as a VB environment.
How can I fix this?
Thanks!!!
Additional Info:
Just to add on as much information as I can, if I set a breakpoint in my code, then I can use F10 / F11 to continue stepping through my code once the breakpoint is hit and execution is stopped as would be expected.
EDIT 2013-12-31:
Based upon a comment made by Neolisk, it appears this is simply a change in default behavior in Visual Studio 2013... If anyone knows how to change this back to the way it was in 2012, that would be GREATLY appreciated, but at least I now know it's not an error / installation issue.
If 2013 works the same as previous versions, then do the following:
Navigate to Tools > Import and Export Settings
Choose "Import selected environment settings"
On the next screen, choose to save your current setings if you want to.
When you get to the point where you can import, just select "General Development Settings"
That should set everything back to what you're probably used to. Most people are set up using general settings and either don't realize it or just forget.
EDIT: If your issue is that the program executes when you press F10 or F11 when you are not debugging, then I think you might be out of luck. It's done that to me personally since VS 2008 (I'll frequently miss the F12 key when I'm in a hurry), and, after some searching, I think it actually happens to everyone:
Visual Studio - Prevent F11 from starting the debugger?
My guess is that this is a side-effect of not being able to set contextual hot keys based on whether you are or are not debugging. Since F10 and F11 are tied to debug-execution-related operations, my guess is that Visual Studio realizes that it needs to be debugging to process them, and thus starts the program.
ANOTHER EDIT: Of course, it's also possible that you had the scheme set to something else entirely in VS2012. Check out all of Visual Studio's pre-defined hotkeys by environment here: http://msdn.microsoft.com/en-us/library/da5kh0wa(v=vs.120).aspx
If none of those have the mappings that you're used to for F8, F10, or F11, then it's possible that you or an add-on may have had few custom hotkeys defined.
Worst-case scenario, you can simply redefine your shortcuts manually by key in the keyboard settings: Tools > Options > Environment > Keyboard
It sounds like you are in VB settings and not C#. You should try changing your settings to one or the other and see if those debug options change. On my machine
Tools - Import Export Settings - Reset All Settings - C# (If you want F10/F11) VB if you want F8/Shift-F8. It doesn't matter what your settings are you can still code in both languages, but if you are used to pressing F10 to debug VB.NET code you've been using C# settings this whole time. Nothing new with Visual Studio in this regard. I am using VS2013 Ultimate, have been using Visual Studio since VS2003.
The first image is VB.net, second is C# settings
You can try some of these reset settings:
And different combinations thereof, i.e. ResetToBasic first. If does not help, try ResetToC#, then back to Basic. Then try General, back to Basic. See if you can hack your way through like this.
EDIT: I tried my VS 2012, and compared to VS 2013. What you described is completely normal. VS 2012 used to step in Form_Load and similar on F10 and F11, VS 2013 no longer does it. So it seems like your VS 2013 is working as expected.
Microsoft probably has a reason to not allow to step into a property by default.
Properties are supposed to be mostly get and set and not contain a whole lot of implementation in it. But that may not be the case all the time.
If somebody is trying to step into a property that means this developer is suspecting something in that property that may be causing problems. So by default this behavior needs to be reversed and allow stepping into properties.
For now this is how you can enable stepping into properties.
Go to Tools > Options menu in Visual Studio.
Goto Debugging > General menu item in left pane.
In right view you will see and option Step over properties and operators (Managed only). Uncheck this option and then you are all set.
Enable step into properties in Visual Studio Debugger
If the above didn't work then follow this
In the Options.Keyboard page, please select "Debug.StepOver" from the command listbox, and then put focus to the "Press shortcut keys" textbox and press F10, click Assign button to re-assign shortcut, does it work?
You can also try to run Visual Studio under safe mode, which will prevents all third-party VSPackages from loading when Visual Studio starts; if the issue disappear under safe mode, you may consider checking your installed add-ons or VSPackages.
Second, to log all activity of Visual Studio to a log file for further troubleshooting, please use the /Log switch, and post the log file content here, so we can do more investigation on it.
If this feature works well before, and suddenly behave abnormally, it usually indicate that some files or configurations of Visual Studio installation is corrupted or missed, you can:
Restores Visual Studio default settings by using "Devenv.exe /ResetSettings" command. Please backup your settings before restore to default settings.
Repair/reinstall Visual Studio;
To repair Visual Studio In the Add or Remove Programs dialog box, select Visual Studio then click Change/Remove.
I found I had to run VS as Administrator to debug properly. I also do a clean solution prior to debugging, especially on x64 machines. If you put a manual debug breakpoint in the code and the IDE indicates it can't stop at that point, then it's possible that the debugger is out of sync with the source code.
An idea to test it in a short way:
Create a Hello World console app.
1 Module Module1
2
3 Sub Main()
4 Console.WriteLine("Hello")
5 End Sub
6
7 End Module
Build first.
Put the cursor in line 4 (before each step), commands should start Debug Mode if you are in Design Mode.
F10 (StepOver): Should break on line 3
F11 (StepInto): Should break on line 3
CTRL+F10 (RunToCursor): Should break on line 4
If it is working properly: Maybe the assembly which containing the entry point of your program had modified and wasn't been rebuilded, or there is somthing other problem with the point where the control expected to break.
If it doesn't work as expected on the sample, I think you should ask on MSDN FORUM or make a bug report.
I don't know why they might have intent to change this behavior.
It is working for me in my 2013 Express Edition with C# recently.
I found what I think is an acceptable workaround for the non-functioning F10/F11 Keys. They are probably the most used keys in stepping through code, and it is a real pain to click on debug and select the key from the dropdown.
I got around this shortcoming by adding icons to the toolbar for these operations.
If you are not sure how to do this, On the Debug toolbar click on the down pointing arrow near the right side of the bar. Click on Add or remove buttons.
Select Customize...
Select Add Command
Select Debug
Scroll down to the desired key (Step over / Step into)
You once clicked, you will see the two icons added at the left side
of the toolbar, Unfortunately they are the same Icon, but with a
little use, you should be able to select the right key to click on.
I actually prefer this method to trying to remember which function key
to press.
On many branded laptops, there is an extra button "Fn", Press "Fn" and "Esc" together. Functional keys will be enabled in visual studio.
Kindly press Fn key and Esc (with Lock with Fn label).
Sometimes it gets locked and Media Player buttons get activated.
Sounds stupid to ask but what type of keyboard do you have? I know some keyboards have different modes that allow you to set different profiles for keys based upon the application. I use the feature with my Microsoft Natural keyboard. However I have had problems with the profile still being active when I switch into Visual Studio and then F10, etc doesn't work correctly.
I faced the problem that F10/F11 doesn't work but the breakpoint works.
Once I uninstall the Security Software and unload the relevant drives it works again.
So my advice is that. And I guess it's due to the drives, so if these don't work just try to unload those questionable drives may connected with this question.
Using Logitech MX 3000 Keyboard, I've upgraded to the last setpoint version and these keys work now perfectly. (Driver version 5.90.41)

Why doesn't Visual Studio debug my VB.NET application?

I recently have encountered a weird issue with my project: as soon as I click debug and it builds the project, it stops debugging. There isn't any error message, or anything else that comes up, including the form itself.
I've tried messing with the settings: no splash screen and I've even changed the startup form to a blank Windows form. What could be causing this problem? Is it Visual Studio or my code?
Probably your program is exiting normally. Set a breakpoint at the first statement to be executed, press F5, then single-step through the program until you get to the last statement executed.
If the first statement is never reached, then one of two things probably happened:
You're mistaken about which statement is executed first, or
The program is terminating during initialization, probably because a class constructor is exiting the program either normally or abnormally.
A few ideas:
Use Debug->Exceptions, and check all the checkboxes so you break when an exception is thrown.
Use Debug->Step into to step into your code.
Then you can use Step Over and Step Into (look at the menu for the keyboard shortcuts)
I found a solution, but not the problem.
How I fixed it:
I just created a template for each form, created a new project, and imported everything into the new project. One thing that I found useful is in the new project is to add an existing item (CTRL + D), and group select (maybe, don't know if you can) and select all the non-code/form/designer/etc. files (like text files or images) and then import them.
I have found a possible solution after I had the same problem.
You probably have more than one project in your solution (The main project, plus an "InstallShield" project",perhaps)
Make sure you have the main project set up as "Startup Project".
In the Solution Explorer, right click on the Main Project and select "Set as Startup Project".
Everything will then run OK.
If you get the error like: "The debug mode is program but there is no program specified....." Go to Solution Explorer then Right Click on main project's name and Click on Set as StartUp project. You can debug your program.

VS2005 immediately runs my older code when an error occurs

For years, I had this behavior when writing VB.NET code with VS2005:
If my code contains a syntax error, when I hit F5, a popup would ask
something like "do you want to stop... or run a previously compiled
version of this code?"
(I would always hit STOP. Not sure why anyone would want to run a prior edition of their code, instead of the code you are trying to write/fix NOW.)
Yesterday, something changed. Now even blatant errors like "callll ThisCodeDoesntExist(xxx.zzz)" just immediately runs my older code. No popup. No choice. No warning. No error. Nothing.
Did I accidentally change some compiler option(s)? Where would I even begin to look for this?
I'm running vs2010 so I'm not sure if there will be any difference but try the following steps:
Click 'Tools' in the main toolbar (file, edit... etc.)
Click 'Options...'
Check 'Show all settings' (on vs2010 this is at the bottom left of the window)
Expand 'Projects and Solutions'
Click on 'Build and Run'
Then under 'On Run, when build or deployment errors occur:' select 'Prompt to launch'
I assume you're current set up has 'Launch old version' in the combobox. Hope that helps!

Changes in the code or the designer won't update when debugging

I am trying to debug my VB.net app in Visual Studio Express 2010, when I realized my changes will not update on my form-on the designer or in the code. After looking online, I found that you should clear out the "Debug" folder under the bin. That worked-for only one time. Now it went back to the older version and when I delete it again, it doesn't change. When I build the project and run it from the "Release" folder, it works perfectly, but when a error occurs at runtime, it won't show where the error is because it is running independently.
Thanks in advance.
(I have Windows XP SP3)
I had the same problem. Frustrating problem....? Close the project, go to debug bin/folder, delete these files, reopen project and rebuild it (F5).
- .exe
- .pdb
- .vshost.exe
- .vshost.exe.manifest
- .xml
it works 99.99%.......thanks
Before I'd create a new project, I'd copy all of the code-behind (including the code that creates the controls that you're not supposed to touch) into another form. That may be all you need to do. Try compiling that form and running it and see if it's good. If so, you won't have to create a whole new project and can just delete the old form.
I would think there's something causing this that would be much easier to to fix. Are there any config files or anything like that? Are you building to the right location?
It's been a while since I've done winforms, but I remember this happening in VS 2005 and I just created a new form and copied the code-behind into another winform and compiled.
Hope this helps.
mmm... if it was for me, with such a weird bug, i would create a new project then insert the files (not as a link, but a copy) in the project, and i most likely all will work fine after... Faster than finding where-the-hell is that wrong parameter...
So how do you do that ? Well create a new project, choose the folder and name, change namespace in settings if needed, then in project explorer Add existing item, then Browse and select your code and xaml (and other maybe) files. Let us know.
This happened to me as well. I believe the /bin and /obj folders of my application must've been locked for by some other application. Before manually deleting them I tried running Visual Studio as an administrator and did a Clean and a Rebuild which worked. If it doesn't work for you, try deleting the folders manually.
Close VS
Press Ctrl + Alt + Delete
Choose "Task Manager"
In the "Process" tab in "Task Manager" find your "ProjectName.EXE" and click "End Task"
Restart VS
I have the same problem, but i changed the solution config next to the start button from debug to release and that fixed my problem, try it :)
"Save all" works for me in VS 2010 VB, in Debug and Release mode.
I put the "Save all" icon next to the Run and Build icons.
First make sure your Localizable Property of you form is set to FALSE