Prevent Compile Errors from Non-Compiled VB6 File - visual-studio-2012

I am porting some of the logic from old VB6 files to C#.
For easy reference, and to have the VB6 files available long-term for reference, I added them to my project and set the Build Action to None.
When I compile my project, I get over 100 errors in the Error List related to those files. If there are no other errors in the project, I get a Build Succeeded message and I can run or debug the project. If there are other errors, those errors are well-hidden among all of the VB6 related error messages.
I would prefer to keep the .bas file extension, because Visual Studio provides syntax highlighting that is mostly-useful, as VB6 and VB.Net share significant syntax.
How can I prevent Visual Studio from showing compile errors related to the VB6 file, and treat it simply as a reference document, without abandoning the .bas file extension?

Visual Studio has no support for VB6 code. By using the .bas file type, you are telling Visual Studio that these are VB.NET files which, for some reason, you do not want to compile.
I don't see any way to get the best of both worlds here. Perhaps someone has created the document handling code for .vb6, or you could create your own using the Visual Studio SDK.
Also, a search of the Visual Studio Gallery for free tools for VB6 found two that look interesting:
Visual Basic 6X
Visual Basic Tools for Visual Studio CTP

Related

Could not find type 'Microsoft.Office.Tools.Ribbon.RibbonTab' error prevents designer from opening

I have a VSTO for Excel project with a custom ribbon tab. The solution builds without errors. I can run the solution. It launches Excel and displays the custom ribbon tab and task pane without any issue.
When I try to open the designer for the custom ribbon tab in Visual Studio 2019, I get the following error:
Could not find type 'Microsoft.Office.Tools.Ribbon.RibbonTab'. Please
make sure the assembly that contains this type is referenced. If this
type is a part of a development project, make sure that the project
has been successfully built using the settings for your current
platform or Any CPU.
The solution builds and runs without any issues.
When I expand the error info, There is no stack trace or error line information available for this error.
The build settings are set to 'Any CPU'.
The assemblies that contain 'Microsoft.Office.Tools.Ribbon.RibbonTab' are included in the project references. These are Microsoft.Office.Tools.Common and Microsoft.Office.Tools.Common.v4.0.Utilities.
I have tried to Clean, Rebuild, and Restart Visual Studio 2019. This had no effect.
I could not find anything definitive when I Check Windows Forms Design-Time error list.
Would anyone know how to address this issue so that I can open the custom ribbon in the designer?
Is VSTO still supported by Microsoft? All documentation appears to be several years old.
This is a Visual Studio issue, not a C#/Build/DLL linkage issue.
Make sure your Visual Studio setup (do the Modify in the installer (#1) if already installed) has these two components checked:
Is VSTO still supported by Microsoft?
They are moving to an online office365 addin (my words) type VSTO. As to new features, not recently. One can still put in a Visual Studio support ticket if you have the right subscription.
I have never had any issues with ribbons, but sometimes the winforms res files in designer do not show and I use the JetBrains Rider editor to view those controls when VS fails.

Visual Studio Shows Tons of JavaScript Errors for an ES6 project

I'm using Node.js tools for Visual Studio 2015. All ES6 features under Node.js tools options are turned on. I've tried turning them off too. I've also tried setting JavaScript files not to display syntax highlighting.
Visual Studio displays tons of errors for files containing ES6 JavaScript (the content of the files are actually just fine by ES6 standards).
Interestingly, if I double click on any of the errors, I get a message
So, it seems that maybe VS is "double-inspecting" these files...and the second pass fails. Because if I open the file in question from solution explorer, there is no run underlining anywhere in the file?
I've spent a long time troubleshooting this. Is there any way to make Visual Studio work, a little bit?
What version of Node.js Tools for Visual Studio are you using? You may just need to update to the latest version.
I had this same problem with version 1.1.31117.00, but I'm not seeing it anymore with 1.2.40726.00.

c++ programs on computers without visual studios

My friend and I are making a game using C++ and the sfml graphics library. We are almost done, but every time we manually put the .exe (and necessary assets) on a computer that doesn't have visual studios installed it gives an error. The error is: The program can't start because MSVCP120D.dll is missing from your computer. Try reinstalling the program to fix this problem. After making a copy of the .dll file and placing it in the local application folder, it came up with another error: The application was unable to start correctly (0xc000007b). I've seen a few posts on stack over flow and other resources, but the questions are usually lacking in detail and go unanswered.
You need to download the Visual C++ Redistributable Package for Visual Studio 2013 (VC++ v12) and install it.

Visual Studio 2012 doesn't convert vs2010 solution?

I opened my vs2010 solution with vs2012 but it didn't make any conversion as from 2008 to 2010 was happening. So my solution still remains the same as 10 label on it. when I make a new solution of course it has 11 label on it. I haven't got any problem running like that but I am curious. Is there any difference? if yes, how to convert into vs2012 solution?
I managed to 'convert' the solution file to change the line containing '# Visual Studio 2010' to '# Visual Studio 2012' in the .SLN file.
Manual editing of the solution file is not necessary, or recommended. Simply open the VS2010 solution in VS2012, left-click the solution (at the very top of the Solution Explorer), then use File | Save As to overwrite the original file. This will effectively convert the VS2010 solution file to a VS2012 solution file.
There are some exceptions, but mostly you'll be able to open the same project and solution files files in both VS2012 and VS2010 SP1.
VS2012 may convert projects when you first open them, but the changes are (except noted in the document linked) backward compatible with VS2010 (ie using conditionals where needed to only apply to either version when loaded) Most project types will be left entirely untouched though.
It is about Visual Studio 2012 Compatibility
If you created your assets in Visual Studio 2010 with Service Pack 1 (SP1), many of them will load and run in Visual Studio 2012 without any further action on your part.
Many assets will also open again in Visual Studio 2010 with SP1 without any issues, even after you open those assets in Visual Studio 2012
For C++ projects it makes a difference, as the 2012 compiler (VC11) will only be used on projects that are explicitly 2012, not on 2010 projects opened in VS 2012. Some C++11 improvements are available with the VC11 compiler but not with VC10 (see this SO Answer for a summary), including:
Range based for-loops
New standard library headers (atomic, mutex, thread,...)
Smaller standard library container sizes
(And more to follow when the Nov 2012 CTP is delivered to VS 2012)
In order to convert from VS 2010 project to VS2012 there is no need to manually edit the solution file or 'Save As' over the existing project. Instead:
If you decline the update when first prompted, you can update the project later by opening the Project menu and choosing Update VC++ projects... [at the top of the menu options]
From MSDN's "How to: Upgrade Visual C++ Projects to Visual Studio 2012"
(This page was linked from #Joachim's MSDN link, but I wanted to have the answer here on SO since a number of other answers suggested manual workarounds instead of this VS 2012 feature)
In my case, I had some Visual Source Safe stuff (my project was created with Visual Studio 2003/2005, yes, very old!)
Once I manually removed the VSS stuff, the conversion succeeded.
PS: I know it's about VS2010, but maybe this helps others.
You can convert a project from VS2010 to VS2012 by doing the following:
Add the 2010 project to your VS2012 solution by right-click on your solution in the Solution Explorer and Select Add --> Existing Project...
The project will appear in the solution and will have (Visual Studio 2010) appended to its name.
Right-click on the added project and select Properties.
In the Configuration Properties --> General pane, change the setting in Platform Toolset field to Visual Studio 2012 (v110)
Repeat for each configuration type, e.g. Release and Debug.
I came across this question while googling for a solution to a specific problem: MSBuild was failing to execute the Publish target against a VS2012 solution that had started life in VS2010 when called from the command line (specifically through TeamCity):
error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Windows Azure Tools\2.3\Microsoft.WindowsAzure.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
MSBuild was looking for the Azure SDK 2.3 targets in the VS10 location (C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Windows Azure Tools\2.3\Microsoft.WindowsAzure.targets). The cause is explained by Sayed Ibrahim Hashimi in a blog post and, as I understood it, boils down to some decisions they made while enabling cross-version compatibility for solution files. The solution was simple: add the VisualStudioVersion property to the MSBuild invocation, something like this:
msbuild.exe MyAwesomeWeb.sln /p:VisualStudioVersion=11.0
Practically speaking, this overrides the following in each csproj file:
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
Presumably you could get the same result by editing all of these by hand to replace 10.0 with 11.0 but that might break backwards-compatibility -- I haven't tried it. I also haven't tried an update to VS2013 to see if the problem persists.
So to wrap this up by answering the question: yes, there are some differences before you "convert" (using any of the methods offered by other answerers) and some differences remain afterwards.
This is slightly different, but along the same lines so in case it helps anyone:
I was loading a project where it looked like it was loading and then kept showing all projects as unavailable. No errors were on the migration report. I tried reloading the solution and projects many times, using various methods including suggestions here.
Finally I found a "Resolve Errors" option when right clicking on the solution in the Solution Explorer. VS went through a load process again and it worked; no problems.
I don't know what it did differently that time, but apparently it made a difference.
it's to simple just edit the .sol file
change the version to 11
like this
Microsoft Visual Studio Solution File, Format Version 12.00
Visual Studio 2012

Error highlighting in Visual C++

When using Eclipse or NetBeans IDE on a Java project I get to see where errors in my code are, before and after compiling. The line causing the issue is shown. I remember that back in the old days, the Visual C++ 98' edition did do underlining of errors in the code. Is there a way to enable this in Visual C++ 2005? Or is there a 3rd party plugin to do so?
What you need in order to do this is a static code analysis tool for C++ with a real-time plug-in for VS2005. Unfortunately, I'm not aware of any open-source static code analyzers that plug into VS2005, but there are some commercial ones. One such product that has been well-received is Riverblade's Visual Lint.
In general, Googling "visual c++ static code analysis" is a good place to start hunting this type of software down.
Visual Assist is also a useful tool. Works with all versions of visual studio.

Resources