I'm trying to override VS2010 behaviour when an external program makes changes to the project or solution files. Atm VS throws a popup asking if you want to reload/save the project files.
I've trying to override this behaviour however I have yet to find a solution. Is there some way to override the event or programatically set VS so it automatically lets external changes refresh active projects?
There are some configuration options available at
Menu Tools - Options - Environment - Documents
Look at the checkbox and other options
Detect when file is changed outside the environment
Related
A dumb question.
Is it possible to configure VS2017 to allow adding new folders while running a solution on debug mode? I'm trying to organize multiple styles and scripts defined inside the views.
Thank you very much.
Is it possible to configure VS2017 to allow adding new folders while
running a solution on debug mode? I'm trying to organize multiple
styles and scripts defined inside the views.
For a framework project, there is no such option to realize it to add new file into a project under debugging. And when the project is under debug, the files under the solution explorer and we cannot modify such as add a new folder in Solution Explorer.And you cannot add new item into it.
For a core project, you can add a folder in this new type of the project. After that, you can add existing new item and import new files into it. As far as l know, it can work for showing the style of the page and you can modify it and then refresh the page,you will see the effect.
Note: if your project is based on Net Core 3.0 and later, you can refer to this link to install a new nuget package called Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.
Hope it could help you.
is anybody aware of a way to apply (as in write or transfer) the settings of a Visual studio property sheet to the actual properties of the project (so they appear explicitly in .vcxproj file)?
I would like to load in a property sheet, transfer the settings to the "real" project's properties (not inherit the settings from the sheet!) so I can remove the property sheet afterward again.
Does the VS IDE allow this?
I am looking for a clickable solution, not a manual transfer.
Thanks in advance
There is no built-in way to do this though you could program an extension or external executable (which is easy to invoke as External Tool in VS) to do this, using e.g the Project class. But it is not that trivial: what do to when conflicting properties are found? Replace them? Combine them? Moreover it sort of defeats the entire purpose of propertysheets which is having a reusable set of options for building.
I need to add a new configuration (additional to Debug and Release) to a Visual Studio Project that has been created with the QT Visual-Studio-add-in.
Problem is that the moc files are not automatically added to the project.
Where does the QT Visual-Studio-add-in store the configuration rules for adding a moc_file based on an existing header file?
If I generate a new configuration like Release_Special
there should be a new filter Release_Special in the project that contains the files
moc_Test1.cpp
moc_Test2.cpp
with correct exclusion rules.
I am using VS2010 and qt 4.8.3.
Thank you and best regards
M.S
Took a while, but I managed to figure it out.
You need to create a new configuration without losing any of the Qt add-in custom-added stuff. Open the Configuration Manager and create a configuration, but be sure to select Debug or Release in the "Copy settings from..." dropdown list. Let's say you named the new configuration "Debug-foo", and used the settings from the pre-existing Debug configuration.
Build the project. All necessary files will be moc'd and the outputs will appear inside the GeneratedFiles\Debug-foo directory (it will be created automatically). The build will then try to process the moc files from the Debug configuration which is clearly not what we want, so as soon as the build finishes moc'ing, you can just terminate it.
Add a new filter, named "Debug-foo" under Generated Files in the solution explorer, then Add->Existing item to that, selecting all moc_(...).cpp files from GeneratedFiles\Debug-foo that the build just created.
Last, but not least, select all the files inside the Generated Files\Debug filter, select Properties and set "Excluded from build" to true, otherwise the build will include moc_ files from both Debug and Debug-foo.
Hopefully, this will be fixed in some new version of the add-in. Maybe it is already, who knows (I encountered this problem with add-in 1.1.10).
As to the part of your question about where the rules for moc_ generation are stored;
creating the configuration as a copy of an existing one saves you the trouble of adding custom build instructions for invoking moc for every file that requires it. These are stored inside the Properties of invidual header files which need moc'ing under "Custom Build tool" if you want to check them out.
I have OCX created using VB 6.0. And this OCX has custom activex controls in it. The custom controls are used in my application. I have installed my application in a system in which I have registered mu first application.
My second application needs the custom controls which are available in my OCX , few enhancements in previous controls and new custom controls.
For this purpose I have created new OCX with previous controls and new control added. In this case in future if I need different controls I need to create more OCX files. This is difficult to maintain different OCX.
If I add new functionalities in the existing OCX and register in the system, already existing application couldn't able to find the previous version of activex control.
How to add new features in already existing ocx with out affecting the applications already using these controls?
Thanks
Publishing a component with "Binary Compatibility" allows this (with several caveats involving what you can safely change) by examining the existing version of the activex control and then re-using IDs from the type library in the new version at compile time.
See here for an explanation: http://wynport.wynsys.net/Visual_Basic_Binary_Compatibility.htm which includes a list of what incremental changes you can make.
When you compile your project, Visual Basic only creates new Class and Interface IDs when necessary. It preserves the class and interface IDs from the previous version(s) so that programs compiled using an earlier version will continue to work. If you are making a change that will result in an incompatible version, Visual Basic will warn you. If you want to maintain compatibility with older, released versions of an ActiveX component.
Ref: http://support.microsoft.com/kb/161137
To make your control binary compatible,
Open the properties dialog of project
Select Component tab
Select Binary Compatibility radio button
Browse your existing control which you have compiled
Click OK button and recompile your project
I downloaded an ASP.NET open source solution and opened it in Visual Studio 2010. VS is running as admin.
Everytime I switch the solution or a project from Active (Release) to Debug and uncheck 'Optimize code' and save, these changes don't stick. The solution or project reverts back to Active (Release).
Why is this happening?
You also have to change it in Configuration-Manager (see pictures).
I just had this exact issue. The solution ended up being:
Go to Tools ⇒ Options ⇒ Make sure "Show All Settings" in the lower left is checked.
Then, in that same window, go to Projects and Solutions ⇒ General ⇒ check "Show advanced build configurations".
I have no idea why this checkbox was suddenly unchecked for me this morning, but this worked.
This is guessing a little, but anyways:
Most likely, you are using build configurations that don't include your start up project for Debug build.
Look for the 'Manage Build Configurations' (I think, no Windows machine nearby) menu item. It will show you a list of projects with tickboxes on the right to show whether it is to be built in the build configuration.
Switch to 'Debug' in that dialog and make sure your startup project - or the project that your starting the build for - is actually included in the build.
PS It is even entirely possible that the 'misbehaving' project is actually lacking a Debug build (it might have a deviant name, like DebugConsole or something else entirely). In that case, use the Project menu to add a build configuration of the proper name for that single project. Afterwards, check (again) that said build configurations are checked in the 'solution wide' build configuration dialog.
HTH
Changing the properties of a configuration doesn't change the current build configuration. If you open project properties, change from Release to Debug and make some changes, after exiting the dialog, you will build on the same platform as before. To change the platform you're building on, there is a combo-box right above the code - use that. You should have all available configurations in the list. When you open the project preferences dialog, the current configuration will be the default one in the dialog.
I opened the csproj file in a text editor. Noticed there were two PropertyGroup sections which look like duplicates, one was Debug|AnyCPU and the second was Release|AnyCPU. I deleted the second one and the debug one showed up.
Luchian Grigore's answer explains correctly one simple misconception that could lead to this problem and aaaaaaa's answer gives another way of correcting it: there is a dialog that looks like you are selecting the configuration to build but you are actually just selecting the configuration to configure.
However neither of their ways of opening the 'Configuration Manager' actually worked for me -- I had to click on the button configuration manager at the top right of the solution Properties.
(Note that the place where you choose the configuration is called Configuration Manager, whereas the place where you manage the configurations is Properties.)