I am building several VC++ projects using TFBuild 2010. I want all of them to inherit a .props file. Is there a way to do this in the build process? I know I can manually add the .props sheet to each using the property manager in Visual Studio, but would rather have a more elegant solution.
I am running the the build service under the NT AUTHORITY\Network Service account, so I don't think I can take advantage of the Microsoft.Cpp.Win32.user.props sheet in the user's AppData folder.
NT AUTHORITY\Network Service does in fact have an AppData folder in C:\Windows\ServiceProfiles. I edited the Microsoft.Cpp.Win32.user.props in this folder, which solved my problem.
Related
I use VS 2019's publish feature to create a ClickOnce installer which sits on a server. When someone installs or updates their version of the exe, I need a folder of files to be copied to a specific folder on their local machine. This seems to be the closest I could find to do what I want, but it seems like its only targeted for Office add-ins. How can I do a post-deployment action or event for clickonce publishing?
I have an issue. We are upgrading to VS 2012 at work. When we open a VS 2010 project Visual Studio converts the project. This is fine, because VS 2010 can still use the project (yay microsoft). However, there is a \Backup folder created in the solution directory. Is this being created as part of the migration? Is there any way to control it?
The reason I ask is that the process that makes this folder copies web.config files into the folder. If you then try to build the solution (these are MVC projects), we get a "It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS." error. The cause is that there is a web.config file in a subfolder instead of the root folder. We did not make and do not want this change, and cannot figure out how to control it. Deleting the Backup\Web.config file fixes the error. Renaming it from web.config to web.config.bak fixes the problem.
I don't really want to have to personally open and convert every single project, and don't want random people bumping into this problem. Any idea how to either stop VS from creating the Backup folder, or how to make it create them in the my documents studio folder etc? I can't find any setting to control this and can't find any good info.
By chance, are you using the MvcBuildViews property to pre-compile your views at build time? If so, this is why you're encountering this (since it does the pre-compile in the same directory, it doesn't filter out any of the files below the project directory).
Note that you will also encounter this issue if you use the Publish feature for this project. Publish copies the web.config under your intermediate build output directory (by default, obj/) before and after applying web.config transforms.
The good news is that in VS2012, or in VS2010 with the latest Azure SDK installed, pre-compile is now supported for Web Application Projects (including MVC). These settings are currently in the project properties, under the Package/Publish Web tab.
(this doesn't directly address your question about the Backup folder, but it was too long for a comment.)
There is no way to control it that I found. We had to go ahead and run through and convert every project to 2012 and delete the backup folders to prevent any other team from running into it.
I have to find a suitable location to deploy my SDF (database) file.
The file must be the same to all users
Windows applications can't write to the ProgramFiles folder.
One user can't access other user's AppData folder
A good choice would be %ProgramData%
In Visual Studio Setup Project File System view, when I right click the output folders I don't have the %ProgramData% option
How to write to that folder?
Check this out:
Specifying c:\ProgramData folder in Setup project?
Winforms Deployment
string path = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData);
CommonApplicationData is C:\ProgramData on Windows > Vista, and something like C:\Documents and Settings\All Users on XP.
Actually this question is a duplicate. Here is the real way tell VDPROJ to deploy to that location:
Writing to AppData from a Setup & Deployment Project
But that will leave another problem: Standard Users won't have write privs to that directory. You'll either have to write a custom action to open it up or you'll have to use a better MSI authoring tool such as Windows Installer XML (open source) or InstallShield 2010LE ( free ) that has proper support for defining resource permissions.
Is it possible to add visual studio macros to a solution, so they would be checked in by svn ?
If not, how do you deploy your utilities/scripts with your developer team ?
Unless I'm mistaken, VS Macros are stored in a .vsmacros file as selected when you created the Macro project (I think the default location is C:\Users\yourname\Documents\Visual Studio 2010\Projects\VSMacros80), so just copy that file to your project's directory and add it to the project with no build action and you should be all set.
But that's just if you want to use those macros only with that project, most macros are useful in many projects and if so I'd recommend keeping them where they are rather than in the folder of just one project, and then just add the .vsmacros file manually to subversion to some suitable location (suggestion would be a Tools folder) and check in and out manually when needed.
I want to register/unregister my project's assemblies in the GAC using Visual Studio's Setup installer project.
I am thinking of using a custom installer to utilise the Install() and Uninstall() methods to write commmandline (in code) commands via the gacutil.exe.
Is there an easier way - or is this the way you would do this? Please keep responses within the scope of using Visual Studio tools (not Installshield or WISE etc)
Cheers.
You cannot rely on gacutil.exe, it will not be available on the target machine. Only machines that have the Windows SDK installed have it. The Visual Studio Setup project supports registering assemblies in the GAC without any custom tool. Right-click "File System on Target Machine" and select "Global Assembly Cache Folder".
You can install assemblies to the GAC by adding a Global Assembly Cache folder as part of the destination file system.