Steps to Reproduce:
Create new Visual Basic Analyzer with Code Fix (NuGet + VSIX)
From VSIX project add New Item...
Extensibility/Custom Command called "CustomCommand"
Not required but helps see the issue set the following options
Option Explicit Off
Option Strict Off
Option Infer On
Build Solution
Several files are added and you get 381 warnings for the ComandComand.vb and CustomCommandPackage.vb files. The warnings are "Type or namespace definition or end-of-line expected", "Newline in Comment", "Type Expected" , "Too many characters in character literal"., "Comma Expected". None of which make any sense in a VB file. If I included these files in a C# project and rename them to .cs I get the exact same errors. The errors make no sense for a .VB file.
The example above is complete and shows a bug in Visual Studio 2015. In the VSIX project file there are two lines that include the word "CSharp" that must be changed to "VisualBasic" otherwise the VB code will be compiled by the C# compiler. To edit the file, unload the VSIX project from within Visual Studio, replace occurrences of "CSharp" with "VisualBasic", Save and reopen the solution the 381 Errors/Warning will go away.
Related
So I just made some c++ application, using NotificationIcon sample from Microsoft as a reference, and thus I'm stuck with the NotificationIcon.exe output file. The name is really lame and I'd like to change it. I've tried renaming the exe, renaming the solution, the project - whatever else - and my programm just exited with code 0x00 after building. What else should I try?
I tried to do the same thing, but there were a few steps I had to follow in VS2019 just to get set up. If you are not in a similar state, the rest of the answer might not apply.
Downloading the sample: I had to install the Windows 7 SDK, as the download page didn't seem to exist anymore. I'm not sure if you found it elsewhere, in which case you might be starting from different sources.
Converting the .vcproj file to .vcxproj. Visual Studio no longer supports .vcproj, and opening the solution triggered this conversion automatically.
Now, once I have a .vcxproj file, there are two routes to setting the name of the exe:
Right-click the project in VS, click Properties, and find the Target Name field. This defaults to $(ProjectName) so I would have expected that renaming the .vcxproj would have renamed the .exe file.
Edit the .vcxproj file directly, adding <TargetName>Foo</TargetName> into the section that starts with <PropertyGroup Label="Globals">
Working on a project using Visual Studio as my IDE. It has an API component written in C#, and a webserver component that uses TypeScript.
I am using webpack to deal with the typescript compilation and would like to remove the Visual Studio build step from the typescript files.
Normally I wouldn't care if it was building them, but I am using Typescript > 1.8.4 which has language features that Visual Studio cannot understand which is making Visual Studio throw errors and prevent compilation. I found a workaround for this in this github issue thread but I have other developers cross team who are working on this and trying to coordinate a hack to make code among them will not work.
I have also tried removing the typescript imports line from the .csproj file, but whenever I add a new ts file, it adds the line back in.
Is there a way to completely shut down the typescript compilation/parsing step in Visual Studio and prevent it from coming back?
This in in VS 2015.
You can disable typescript compilation by editing the .csproj file to contain the following:
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
That should disable all typescript compilation within VS 2015.
To disable TypeScript compilation altogether for Visual Studio, edit:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Microsoft\VisualStudio\v15.0\TypeScript\Microsoft.TypeScript.targets
(Your path might be slightly different depending on your OS/VS version, in that case just search for Microsoft.TypeScript.targets)
And add:
<PropertyGroup>
<TypeScriptCompileBlocked>True</TypeScriptCompileBlocked>
</PropertyGroup>
This works for .NET Core projects as well.
It seems that the errors are triggered by IntelliSense and one can remove IntelliSense errors by simply filtering the list.
In case that other solutions doesn't help this is the key to clean up the error list, at least temporarily.
Sam Storie's answer is a great start and it will stop typescript errors from preventing compilation, but Visual Studio will still report the parsing errors which will prevent the ability to use the built in publishing tools.
To completely remove error reporting in ts, find all import lines in the csproj that reference typescript and set the Condition property to false, make sure to restart VS afterwards:
Example:
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.targets" Condition="false" />
Remove / Uncheck Test Javascript Content Files from the Project filter.
I have found very cool possibilities in QtCreator which is:
prolongate signature changes between declaration and definition for C++ methods,functions
find symbols usage
Is it possible "append" include file for specific "type name" of "function"?
(Like Visual Studio VS assist plugin)
I want a text file to be included in the build, so I used Add->Existing Item to load it into the solution. However, I can't open it in a ifstream unless I use an absolute path to the original file. I set Excluded from Build to No and Item Type to Text. For a relative path to file.txt, I tried "file.txt", "../file.txt", "/file.txt" but none of them work. I don't know if it's my syntax that's wrong, or if it's just not included in the build, or both.
The program is in C++.
I came across some old answers that mentioned an option to specify additional directories in the build, but I don't see it in Visual Studio 2013.
so I have downloaded a template from the tutorial website http://devmaster.net/posts/introduction-to-c-with-game-development-part-2-project-template
however I have a problem because the template was apparently made in Visual Studio 2008, and I have Visual Studio 2010. When I convert the project I get the error "Unable to start program'C:\c++\Debug\Template.exe' The system cannot find the file specified."
I looked in the original file before conversion and the \Debug\Template.exe file does exist, however after converting the file it gets deleted. I had a few warnings on my conversion and I found this:
"MSB8012: $(TargetPath) ('C:\c++\Debug\Template.exe') does not match the Linker's OutputFile property value 'Template_debug.exe' ('C:\c++\Template_debug.exe') in project configuration 'Debug|Win32'."
Any idea how to fix this?
Any help would be very appreciated
How about creating a fresh project in Visual Studio 2010 and adding the source files and dependencies. Then compile and run, always works!