Visual Studio 2008 not detecting Errors while coding - visual-studio

I just installed VS on another PC, but this time, while I am coding, it is not marking syntax errors while I am coding..... I need to press F6 to get the errors.
Normally when for example typing the line below, I get 's' underlined saying that there is a mismatch. Any ideas how I can enable this option?
string s = 4;

In order to enable background compilation for C#, which checks you code while typing for many types of errors that are usually only reported when you build the project, you will have to install Service Pack 1 for Visual Studio 2008. If you use the offline MSDN, you will also want to install the updated MSDN Library for Visual Studio 2008 SP1, since there were framework changes from .NET 3.5 RTM to .NET 3.5 SP1 (such as the addition of Entity Framework).

Have you recently deinstalled ReSharper?
(see responses in the same link for other possibilities).

C# has never been as consistent about finding errors while i type as VB.net has. I always assumed it was just due to the freeform nature of the language, which would also explain why C++ never found errors either til build time.

Related

Visual Basic Studio 2010 does not start

I've got trouble with my copy of Microsoft Visual Basic 2010 Express.
I installed it about a year ago. Since then I've used it several times without any problems. Now, I haven't used it for some weeks and now, when I try to start the application, it crashes after the welcome-screen with a not-helpful message. Because I use the german version of Visual Studio, I don't know exactly, how this message would look like in english:
German: Ein Aufrufziel hat einen Ausnahmefehler verursacht.
English (freely translated): A called target has caused an exception.
So, as you see, this Error Screen does not give many information. It is also not possible to gather more information. After clicking OK to the error, the application simply shuts down.
Some details
I am using the german installation of MS Visual Basic 2010 Express
I've got also installed the german version of MS Visual C++ 2010 Express (does not work as well)
Both applications does not work with user permissions nor with administrator permissions
No possible Compatibility-Option (Compatibility Mode, Reduced Color Mode, etc) fix the problem
I work inside a physical Windows 8.1 machine
I installed all updates, that came with the automated update feature of windows
I've got another copy of MS Studio Express inside a VM (Windows 7), working properly
I do not remember exactly what I have changed since my last use of VS, I think I installed Far Cry 4 AFTER my last use, wich came with some .NET components. But I don't think there were other big changes inside the system.
Because the error message is so inconcrete, I do not know, wich further information can be useful, nor I can imagine any problem, that suddenly occured. So I hope somebody got a similar problem and knows how to fix it.
The best option is to go for visual studio community 2013.It's free and you can recover your previous work.
You can download it here.
[http://go.microsoft.com/fwlink/?LinkId=517284][1]
Even if you find an error go to build->clean solution.It will work like wonder.
thanks
N S Deo

the service microsoft.visualstudio.shell.interop.iselectioncontainer already exists in the service container

I recently installed Visual Studio 2013 Ultimate version on my machine. I'm just trying to create a sample windows form project and trying to open the designer / form by double clicking on Form1.cs and I'm getting this weird error message:
"the service microsoft.visualstudio.shell.interop.iselectioncontainer already exists in the service container"
My system is already having Visual Studio 2010 which is working smoothly from a long time. I then installed Visual Studio 2012 which was giving the same problem as above. So I went ahead with installing VS 2013 hoping that I might be able to get rid of this issue, but no use.
Once I click OK on the error windows, I can see the following "message" in the bottom Error List window:
"The file 'C:\Users\ABCD\Documents\Visual Studio 2013\Projects\WebSite1\WindowsFormsApplication1\Form1.cs' does not support code parsing or generation because it is not contained within a project that supports code."
I have spent 2-3 days searching various blogs like these, all of which talk about previous version of Visual Studio like VS 2005 / VS 2008:
https://connect.microsoft.com/VisualStudio/feedback/details/311949/the-service-microsoft-visualstudio-shell-interop-iselectioncontainer-already-exists-in-the-service-container
Form inheritance in Visual Studio 2008 doesn't work
I have even tried uninstalling and reinstalling VS 2013, again no use.
It would be really great if someone can help me out in fixing this.
I've just had the exact same error message.
After compiling the solution(F6 or Build->Build Solution) it worked fine for me.
To deal with your issue, please first make sure that you installed latest updates on your Windows 8 machine, and then repair VS2013.
During your repairing process, please temporally turn off your anti-virus/antispyware software and repair VS2013 with the Administrator privilege.
follow this link
The problem got resolved finally, after so many days and various frustrating tries to resolve the issue. I should thank Tim Atkins from Microsoft for helping me with resolving this issue.
Fix: When we tried 'gacutil /l system.design', we found that there were 3 variants of system.design; One from .Net 2.0 targetting MSIL, second from .Net 4.0 targetting x86 and last one also from .Net 4.0, but targetting MSIL.
On a working machine, there were only 2 entries, the .Net 4.0 one targetting x86 wasn't there. Hence we uninstalled this version using gacutil which did the magic. I was so relieved seeing the win forms popping up without any errors anymore :)
I changed the target framework from 4.5 to 4.6.1 and it fixed it for me. My assumption is sometimes when you change target framework back and forth and the process does not go through all the way (cancelling in the middle of changing it) - something happens that leads to this error. Hope that helps
I solved this be closing VS, deleting contents of the .vs folder where my solution is, restarting VS and recompiling.
Seems like one of those file/settings/caching problems that pop up now and then, might be after switching source branch.
VS2019, .net fw 4.6.2.
If your C drive (Where you are installing Visual Studio) does not have enough space, try moving some files from the C drive to another drives.

RDLC 2005 conversion to RDLC 2008 : Custom code not "seen" anymore

I have some issues with my reports since I have updated them to VS2010 format.
Even though I have modified references to from v9 to 10 for Microsoft.ReportViwer.Common and Microsoft.ReportViewer.WinForms as well, when I try to type code. in a field, what is after "Code." is always underlined with red and I get #ERROR instead of the value I want when I print the report. I know it is case sensitive and I double checked the spelling multiple times.
Moreover, I don't know why but I have errors with the Fields! syntax; I seem to have to use the Fields().value to get them to work (at the places I don't need to call custom code too)
These reports worked well before conversion (over 20 reports converted this way) but do not now. Seems like custom functions are not "seen" by the report designer. I tryed to make them public, shared; all I had is the same stupid #ERROR display.
I want them to work in VS2010 to avoid always having to modify them in VS2008 and then go back in VS2010
It's a winform application with framework 3.5
Any idea of what could cause that and what is the remedy?
Many thanks
Nico
There are a couple of ways to use custom code in SSRS. Firstly you can enter VB directly into the window under
Report -- >Report Properties --> Code
Another way is to write a custom DLL (which can be done in any .NET language of course), which then needs to be copied to both your dev machine and the production report server.
You then need to create references to that assembly in the project using:
Report --> Report Properties --> References (I assume you know this).
If you are not using your own custom assembly, and just using a reference to one on your machine then there could be some confusion on the server as to where to find the dll's. You may need to copy DLL's to the folder as indicated in the KB link below:
http://support.microsoft.com/kb/920769
When you drag a field onto a tablix or textbox, and have a look at the value expression, does it use the Fields!Fieldname.Value syntax? That syntax is natural to SSRS so it sounds like something seriously broken in your visual studio 2010 there if that is not working. I take it you installed visual studio 2010 to create web applications. What you haven't explained is which version of BIDS or SSDT you are using. If you are developing reports for SSRS 2008 R2 or earlier, then these are not compatible with visual studio 2010. There's no compromise there.
If you are developing for SSRS 2012, then you are using either SSDT by itself (which installs a shell version of visual studio 2010) OR if you already have visual studio 2010 then you need to install service pack 1 for VS2010 and then install SSDT from the SQL Server 2012 disc.
http://msdn.microsoft.com/en-us/library/hh500335(v=vs.103).aspx

Pex and F# in Visual Studio 2010 Ultimate

I have been trying using Pex in a F# project but I have faced several issues on which I would appreciate some help:
Visual Studio Pex addin worked for half an hour and not for complex project exploration.
After that each time I run a Pex Exploration from within Visual Studio 2010 I get a !warning! [metadata] no explorations found after applying all filters; did you forget a [PexClass] or [PexMethod] attribute? error message. If I copy and paste the command run by visual studio when doing the exploration and remove some attributes (like sourceFilter ...) and run it from a command console then I get some generated tests. Any idea why visual studio generates an invalid command?
After a while the Microsoft.Pex.Framework.dll either disappears from the .Net Reference list and I have to reference it manually using its file path or I can't even reference it any more and I have to uninstall/reinstall Pex. (A reference to C:\Program Files (x86)\Microsoft Moles\PublicAssemblie\Microsoft.Pex.Framework.dll could not be added. Please make sure that the file is accessible, and that it is a valid assembly or COM component.)
All these issues don't occur when I work on a C# project.
Issues 1 2 3 occurred with the Academic version.
Using the version available for MSDN Subscriber I never got it working within visual studio (Visual Studio 2010 Ultimate NO SP1). However it worked from the command prompt. I did not face problem 3 with this version.
Has anyone managed to get Pex working with F# within visual studio ? If yes can you you tell me how you did it ? Which versions (VS and Pex) do you use ?
I have had some success running Pex with F#. The version I used, if I believe my Downloads folder, was the academic version of Microsoft Pex and Moles 0.94.51006.1 Release for (x86). The installation file was named pex.academic.x86.msi.
I don't know if that version predates yours.
My impressions from my trials were that Pex and F# were not a very good combination: Pex insisted on creating test cases with null inputs. As generating null values in F# isn't all that common, that's typically not the scenarios in which I'm interested. Adding lots of assumptions to eliminate those just left me with Pex not being able to generate test cases. Admittedly, the functions I was testing were too complex, I still like the idea behind Pex and might try it again on smaller/easier pieces of code.
Using Pex and its GUI inside VS 2010 worked relatively fine, but not without frustration.

Issues debugging Moles

I’m using visual studio 2008 and moles version 0.93. Everything works well except when I try to debug any test that uses a Moled type. The test skips all my breakpoints. And I get the following message in the output window:
Unable to attach. Check for one of the following.
The application you are trying to debug uses a version of the Microsoft .NET Framework that is not supported by the debugger.
The debugger has made an incorrect assumption about the Microsoft .NET Framework version your application is going to use.
The Microsoft .NET Framework version specified by you for debugging is incorrect
Please see the Visual Studio .NET debugger documentation for correctly specifying the Microsoft .NET Framework version your application is going to use for debugging.
If I try debbuger.Break () I get a message: "No symbols are loaded for any call stack frame. The source code cannot be displayed."
I’m in a crunch right now chasing an issue with one our main components and it has been a pain (like I need novocaine) trying to figure anything out without being able to step through the code.
I want to take advantage of mole's "smooth debugging experience". However, I can't seem to get the debugger to attach at all.
Thanks,
Bzz
See the solution to this issue here:
http://social.msdn.microsoft.com/Forums/en/pex/thread/91c08bf4-3260-458c-a221-91f030a75499
I had this problem when I moved a project from Visual Studio 2010 to Visual Studio 2008. Here's what I did to fix it.
Close Visual Studio. Navigate to the Debug/bin location. Delete the following files:
*.vshost.exe
*.vshost.exe.config
*.vshost.exe.manifest
Open the solution. Goto the project Settings. Under the Application Target Framework, select a framework lower than the one you are working with (you'll set it back later). Visual Studio will close and re-open your project automatically. Then set the Target Framework back to the original version you were working with. Rebuild all, and debugging will work properly.

Resources