I'm using the latest version of SlowCheetah on an existing WPF project I have that was already using ClickOnce.
I'm trying to provide different application settings (the applicationSettings node in app.config; the ones that form the Settings.settings file) for each environment. When I publish I'm getting a app.config.deploy (with the correctly transformed settings inside) and also a ProjectName.exe.config file that doesn't have transformed settings.
When someone installs the application and runs it, it's just using the settings inside ProjectName.exe.config (which is correct) and obviously the transformed settings in app.config are ignored. Is there an extra step to get SlowCheetah to put the transformed settings into the exe.config instead?
Related
I have used WebStorm from JetBrains for almost four years now. It's a fantastic IDE for many reasons, but one of the best features is that it saves versions of files outside of version control. So if you accidentally delete files or lose files before they are saved by your version control system, WebStorm has a copy of them and there are visual diff tools to use. This feature has saved me on more than one occasion.
For Visual Studio Code, is there some feature/plugin that will auto-save copies of files as they change? Will Visual Studio Code save the files to some central location, or perhaps in the .vscode folder in the local workspace?
The feature in WebStorm is available from Local History → Show History from a folder or file. Here is an article about it:
Using Local History for code changes tracking
The view looks like:
You can go to menu File and choose Auto Save.
You can enable auto save with these methods:
Check the Auto Save item in the File menu
Go to Settings, search for auto save, and select the auto save option (afterDelay)
Auto save description in Visual Studio Code documentation
Yes, Visual Studio Code can auto-save changes on files as you make changes. It also allows you set a delay for how long to wait before saving the file.
Here's a link that should help you with that.
Or a shortcut you can simply navigate to your Visual Studio Code settings, and add the following to your settings.json file.
{
...
"files.autoSave": "afterDelay",
"files.autoSaveDelay": 1000,
...
}
This will instruct your editor to autosave after a 1000 ms delay. You can set the autosave option to onFocusChange to autosave whenever you move your cursor away from the current text area.
There's a package called Local History that can be used to save a backup of your files outside version control.
You should check that out.
As of March 2022 (version 1.66), Visual Studio Code has a built-in feature called Local History that automatically creates commit-like versions of your files on every save.
It is enabled by default, but you can double check the setting workbench.localHistory.enabled to make sure it is enabled in your project.
From the reference:
Each local history entry contains the full contents of the file at the time the entry was created and in certain cases, can provide more semantic information (for example, indicate a refactoring).
From an entry you can:
Compare the changes to the local file or previous entry.
Restore the contents.
Delete or rename the entry.
The saved local versions are accessible from the Timeline section in the File Explorer tab.
Also, ensure you add .history to your .gitignore file, so Visual Studio Code doesn't track every change made to a single file as changes made to multiple files. This can be a problem and make your files changed so large even though it's a single file or a few files you made edits to.
I've deployed a Windows Forms application. On my local development PC, there is a settings.settings file which contains all the app's settings.
I'm aware as-per this question and others like it, that a User.config file gets created in c:\Users\username\Local Settings\AppData\Local\...
However, I need to change a default setting, so that when users start it for the first time, the default settings are different than when we initially deployed the app.
So the first time a user runs the app, it creates their local copy of the file.
What does it base that on? Is there a default copy of the file somewhere, or is it compiled into the .exe?
I need to get the default settings updated on an app that's deployed on several laptops remotely where I only have telephone support. If I have to recompile and republish then that needs to be as a last resort.
Considering this facts may be useful:
The default values for user settings are stored in yourapplication.exe.config beside yourapplication.exe
Current values for user settings are not in this file and any change in them could be saved using Properties.Default.Settings.Save()
If there is no yourapplication.exe.config in your executable folder, it will be created automatically using values in your .settings file.
If you call Properties.Default.Settings.Reset() the values in yourapplication.exe.config will be used to override user saved values.
Adding a new settings requires recompile and republish.
To overcome the pain of update and distribution, you may consider ClickOnce.
I have a situation where I need to add localised satallite assemblies to an existing XAP file. This is in the context of a SharePoint webpart.
The problem is that when I add the de/Assembly.resources.dll and rebuild the XAP, it fails to load in the browser. The mode of failure depends on how I attempt add the assembly to the AppManifest.xaml. In some cases, it just shows nothing in the browser. In others, it shows the loading spinner stuck at 0%.
My procedure is as follows:
Extract XAP
Extract the .resource from core webpart assembly
Convert to .resx
Translate
Rebuild as delay signed satallite assembly
copy to 'de' subfolder
Add to AppManifest
Rebuild XAP
Copy back to 14 hive
IISRESET
Clear browser cache
Test
The original assemblies are signed and so I have disabled assembly verification checking sn -Vr [star],[star] and have modified the registry to include 64bit and 32bit entries for verification checking. Assembly verification check skipping has been proven on the same system in a non-Silverlight/XAP context. The assemblies are built with the same .net version. SharePoint timer service was restarted after sn -Vr to reload exception list for verification skipping.
I must be missing something, but I don't know what.
In one Silverlight localisation guide I saw that the .csproj contains a string of supported localisations - I doubt the original base assembly was build with any other cultures specified - could this be the problem?
I need to make 3rd party (I'm a software distributor) extensions to some OOTB components of the software I resell. I have permission for this, and can even get my assemblies signed when the time is right, but I have no source access and any changes to the core component take a long time and a lot of effort - i.e. undesireable.
Assistance greatly appreciated. I have this working already for some ASP.net apps and standard webparts - but this Silverlight based web-part remains a problem.
Many thanks.
Well.. what I'm really needing is to allow the user to install two different versions of the same application. Changing the assembly name just generates a lot of errors that require too much work. I've been reading that changing the assembly identity tells WPF that those are different applications and so the second application (it's a ClickOnce) doesn't replace the previously installed. Sadly this cannot be change inside VS2010.
I've changed the MyApp.exe.manifest here, I Think:
assemblyIdentity name="MyWPFApp_NEWNAME" version="1.0.0.0" language="neutral" processorArchitecture="x86"
And resigned the manifest this way:
mage.exe -update MyWPFApp.exe.manifest -certfile D:\MyDir\MyWPFApp_TemporaryKey.pfx
mage.exe -update MyWPFApp.application -appmanifest MyWPFApp.exe.manifest -certfile D:\MyDir\MyWPFApp_TemporaryKey.pfx
the signing states sucessfull, but when trying to open the application it get an error stating that the Hash is misscalculated...
As this is my first try to modify a deployed application with no doubt I'm doing something wrong...
Have you tried right clicking on your start-up project and going to properties. Then in properties in the "Application" tab look for "Assembly Information" button. Click that button and change the desired values. Rebuild your project and then try to get the user to install this version while an older version is still installed.
Solved... (this always happens to me as soon as I post a question) for client to detect the versions as different applications all I needed was to create a different key file (pfx) for each deployment and change the "Name of application group" in the application properties.
I need multiple sites to all point to a common application, varying by host-header.
While the code / content for each each site is identicial each site does need a unique config, for things like connection strings.
What would be the best approach to set this up?
(The site is actually a Silverlight / WCF application, although I don't think that should matter.)
Either use msi installation package and allow set up all these values in installation wizard or use new web.config transformation syntax introduced in .NET 4.0 (you will have separate config and build target for each host header).
Edit - I didn't understand your question first:
You will have to install the application multiple times. You can't have single site with multiple different configs. But you don't have to copy libraries multiple times - you can use links (mklink.exe). It means you will have one central directory holding your shared content like bin directory and you will have separate directory for each site. Each of sites' directories will contain its own web.config and some content placed to root of your site + links to central directory. You will create create separate application for each site in IIS and map single host header to each application.
Other possiblity is handling this in your code and having everything in single web.config but IMO it is pretty bad and dangerous solution.