Enterprise Library Configuration Tool : How to stop showing application and database settings every time - enterprise-library

I am using Enterprise Library 5.0 configuration tool from within VS2010.
Every time I open it, it keeps showing the following 2 settings even though I do not use them at all.
Application Settings
Database Settings
Its very annoying. How do I stop these 2 settings from showing up from within the configuration-tool unless I am actually using them.
Thanks

The database settings are there because there are database connection strings in machine.config. The way the .NET config system works, they show up when you enumerate sections.
AppSettings are there because just about every app does use appsettings, and so it was felt to be a convenience to include them. Note that this isn't an entlib section, it's the default .NET one.
There's no way to get them to stop showing up in the tool as written, you'd have to change the code of the config tool to change this behavior.

Related

SqlPackage - How do I stop it from turning off my query store?

I have a database project in Visual Studio 2017. Our database project is managed just like any other library of code where multiple developers can update the project as necessary. To ease the pain of deployments, I have built a custom deployment task in our TFS 2018 (vNext) Build process that is a powershell script that calls sqlPackage.exe. SqlPackage compares our compiled database project (*.dacpac file) to our target database (in Dev, QA, etc.). I have the custom step configured so that it will write the expected changes to disk so I have a record of what was changed, then sqlPackage runs a second pass to apply the changes to the intended target database.
My DBA enabled the Query Store in our SQL 2016 Database. During my sqlPackage deployment, one of the initial steps is to turn the query store off, this makes my DBA unhappy. He wants the ability to compare pre and post deployment changes but if the query store gets turned off, we lose the history.
I have tried several of the switches in the documentation (https://msdn.microsoft.com/en-us/library/hh550080(v=vs.103).aspx#Publish%20Parameters,%20Properties,%20and%20SQLCMD%20Variables) but I can't seem to find the magic parameter.
How do I stop SqlPackage from turning off the query store?
My current script:
sqlPackage.exe /Action:Script /SourceFile: myPath\MyDatabaseName.dacpac" /OutputPath:"myPath\TheseAreMyChangesThatWillBeApplied.sql" /TargetConnectionString:"Integrated Security=true;server=MyServer;database=MyDatabase;" /p:DropObjectsNotInSource=false /p:DropPermissionsNotInSource=false /p:DropRoleMembersNotInSource=false /p:BlockOnPossibleDataLoss=True /Variables:"CrossDatabaseRefs=CrossDatabaseRefs
Is there a better way? I am surprised that I had to write a custom TFS Build Task to do this. Which makes me think that I might be doing it the hard way. (But this has worked pretty well for me for the last several years). I love database projects, I love that they enforce references and ensure that we don't break other objects when a column is dropped (for instance).
Any insight would be greatly appreciated.
Either disable the scripting of database properties using /p:ScriptDatabaseOptions=false, or update the database properties in the project to reflect the desired Query Store settings.
To set the Query Store settings in the project, right-click the database project in Solution Explorer and open Properties. From there, in the Project Settings tab find the "Database Settings..." button. In the Database Settings dialog, click the Operational tab and scroll down to find the Query Store settings.
Apparently, all we needed to do was add a post deployment script to re-enable the Query Store. Hope this helps someone out there...
USE Master
ALTER DATABASE [MyDbName] SET QUERY_STORE = ON

Service fabric debugging - reliablecollection persisted?

I can't seem to find any information on whether a ReliableCollection, specifically ReliableQueue is persisted between debugging sessions in visual studio. It does not seem like it is. I think it's because the application is removed and then re-added during debugging. Can anyone confirm this?
Yes, the default behavior is to remove the deployed application after the debugger stops.
Fortunately, you can change this.
There are two ways this can be done: Launch your app from VS without
the debugger attached (Debug -> Start Without Debugging [Ctrl+F5]).
Obviously, this would require you to manually attach VS to your
service processes in order to debug them. When you detach VS from the
processes, VS will not remove the application in this scenario.
With
your Application (.sfproj) project selected in Solution Explorer, go
to the Properties window and change Application Debug Mode from
"Remove" to "Auto Upgrade". This prevents VS from removing the
application after debugging. However, it also causes another change in
behavior in that it will automatically upgrade your application each
time you launch it from VS. The added benefit of auto upgrade is that
your application state will be maintained across multiple launches
from VS. This may be desired or not. There is not a setting that
allows you to both prevent application removal and not do an auto
upgrade.

Is there auto-syncing in netbeans for external changes

I know netbeans syncs the original files once I save, but if there is a file changed externally is there a way for netbeans to recognize this and either tell me to re-sync it or automatically resync it with the new changes?
Here's what makes this behavior possible:
NetBeans 6.9 contains a feature that automatically looks for external changes to keep informations about files up-to-date. We have some reports that it can slow down NetBeans mainly, when an open project has many folders. When NetBeans find out that files were externally changed, it re-scans the files to keep data up-to-date that are used with features like code completion, navigation etc. Unfortunately the notification and following re-scanning can take some time and during this time many mentioned features are waiting for the finishing of scanning. There is option Enable auto-scanning of sources that can switch off this behavior. The option you can find it in Options dialog, Miscellaneous category and Files tab.
The default behavior is that NetBeans also looks for external changes when the main window gets focus. This is can be during developing a web application very often when user switches between browser and IDE. The mentioned option also switch this off.
When you switch off option Enable auto-scanning of sources you can still keep the information up-to-date, just invoke Scan for External Changes action from Sources menu manually.
(Here's the original article by Petr Pisl)
I find it counterproductive to leave this setting on, as sometimes auto-loading external changes to a file opened in the UI without asking for permission first can ruin your day when you're forced to make small local changes that you don't want replicated in your repository. I'm sure other people can think of more reasons to advocate for "warn before loading external changes" behavior to be implemented in NB. That is one of the reasons why I like Eclipse better sometimes.

Configuring VB6 with VSS 2005

I have configured VB6 with VSS 2005, following functionality working fine :
Check In and Check Out of code
Get Latest Version
Showing error when code Check Out by another user.
Showing error if use try to edit code without Check In ( only when user takes latest version)
Difference I am finding in VB.Net and VB6 configuration with VSS are :
Code not getting Check In automatically when user try to edit code, without Check In Code.
Not allowing user to save changes and Check In code later after 1 or 2 days. User require Check In code before closing code.
Showing "Path/File access error:" for .vbp file.When user tries to save code on machine.
Allowing user to edit code without Check in when user opens the code first time.
I did all the settings mentioned in this link.
As MarkJ mentioned the vbp file is always saved when the application runs. You can cancel out of the dialog to run the project anyway but this is more hassle than just right clicking on the project root and checking out.
I am using Team Foundation Server with my VB6 projects and there is no auto check out in this either. I'm afraid you will have to live with it until you port the code the .NET
As I mentioned heredead link: WayBack version there is also a problem when you have some files or documents not in SourceSafe.
Specifically (as I still document here), when some of the files of a project are not associated with SourceSafe often no files have their SourceSafe status glyphs displayed.
The workaround I found was displaying the Add Files dialogue and then cancelling it. I offer my public domain add-in that automatically implements this workaround.
And BTW, make sure you install the latest VSS Service Pack.

How to configure independent sets of runtime settings in Xcode

My iPhone application connects to three different servers, say: production, staging and testing. There is a bunch of configuration values that the application uses depending on to which server it connects to, e.g. Facebook App ID, TestFlight team key, etc.
I'd like to have all the settings in GIT and only select which configuration the application supposed to use when compiling or releasing. For example, when testing is selected, Product -> Run in Xcode runs the debug version of the app connecting to testing, and Product -> Archive creates the IPA file with the release version that also connects to testing.
I don't want to create more build configurations than debug and release (because that would mean 6 different combinations of build configurations/run-time configurations). The ideal solution, as I see it, would be that I have three schemes: production, testing and staging, and each scheme selects one of three Info.plist files to use with the application. That would allow me to not only define different run-time settings, but also different application versions or bundle identifiers depending on the back-end server. But it doesn't look like I can configure the Archive action in any other way apart from selecting a different build configuration. Any ideas if that could be achieved in any way?
Edit: To make it a bit more clear, production/staging/testing is the back-end server, not the version of the iOS application. The iOS app comes in two versions: debug/release. In other words I may want to run a debug version of the application connecting to the production server for example to debug a crash caused by JSON returned from that server. I could have named the servers as A, B and C for the sake of clarity.
A good way to do this would be with build configurations and C macros. This avoids having to create a separate target for every configuration which is not really the correct use of targets.
First you want to set up the configurations at the project level:
You can create different configurations for debugging, enterprise distribution, and any other type of special build you want.
Next you can define some macro flags for each configuration which will be passed to the compiler. You can then check for these flags at compile time. Find the "Preprocessor flags" build setting at the target level:
If you expand the triangle you can define different values for each of your configurations. You can define KEY=VALUE or just KEY macros here.
In your code, you can check for the existance of these macros, or their value (if there is one). For example:
#ifdef DISABLE_FEATURE_X
featureXButton.hidden = YES;
#endif
// ...
#if FOOBAR_VISIBLE == 0
foobarView.hidden = YES;
#elif FOOBAR_VISIBLE == 1
foorbarView.hidden = NO;
#else
#error Invalid value for FOOBAR_VISIBLE
#endif
You can pass in string values as well, which must be wrapped with single quotes in the build setting, e.g. DEFAULT_LOCALIZATION_NAME='#"en"'.
You can also configure which configuration is used during Debug and Archive time using the Schemes editor. If you choose "Run" or "Archive" in the Schemes editor you can select the appropriate configuration.
If you need to parameterize entries in the Info.plist file, you can define their value using a custom build setting. Add a custom build setting for your target:
And then give it an appropriate value for your different configurations:
Then in the Info.plist file you can reference this setting:
Note that the one limitation of this approach is that you cannot change the following items:
Settings.bundle
Additionally, in older versions of Xcode without asset catalog support, you cannot change the following items:
Icon.png
Default.png
These cannot be explicitly defined in the Info.plist file or anywhere else, which means you need different targets to change them.
I would suggest using different build targets for each environment. I successfully used this model before. In your project's settings you can duplicate the current target and change the build settings as needed. There's an Info.plist File property that will let you change the default plist for that target.
After that, you can create a scheme for each environment that will use the according target.
You can get a step further and use different bundle id for each target and different names. That will allow you to install both the staging and the production builds on the same device for example.
The only downside in this is that you have more work when you want to update provisioning profiles.
Here's a much easier solution if the concerned libs allow to set the keys in code, meaning that you can have production value in your plist file, but change them in your AppDelegate (or whichever file they are first used in).
Works with facebook, twitter and google sdk at the moment.
Ex:
#ifdef DEBUG
// Facebook
[FBSettings setDefaultAppID:#"SandboxID"];
// Fabric / TwitterKit - must be called above [Fabric with:#[TwitterKit]];
[[Twitter sharedInstance] startWithConsumerKey:#"SandboxKey" consumerSecret:#"SandboxIDSecret"];
#endif
Same in Swift, just use #if instead of #ifdef.
Note about Facebook This worked with version 3 of their SDK, I'm not sure it's possible with later versions.
It is probably very low tech but I just have a method called apiURL() that returns the URL of the API I want. I have localhost, stage, and production and I simply uncomment the one I want. It's worked well for me so far. I've only forgotten to switch it back a few times. Oops.