WPF Project Folder File Bloat - wpf

I work on my WPF project daily in Visual Studio 2022, and back-up my project folder in the evening. I can't help but notice the number of files in there just keeps getting greater (by hundreds every day), even when I'm not adding anything new to the project. It's causing back-up time, and the time it takes to transfer my files between workstations, to get longer and longer.
What could be generating these extra files and is there a way to minimize it?
I've had a look around the net for answers, but to no avail.
Thanks for all and any advice you can give me.

The best way to solve your problem is using the GitHub Repository.
Go to the Git Studio menu, select the create repository item in it, upload your Solution to the created Repository, commit the changes when you need it.
In addition to just backing up, this will allow you to easily and conveniently compare different versions.
If for some reason this is inconvenient for you, then pay attention to the ignore file in the Repository. All templated files and folders in this file do not require backup.
Here is a link to the ignore file from my Repository: https://github.com/EldHasp/CyberForumMyCycleRepos/blob/master/.gitignore
In the most minimal variant, all folders whose names begin with a dot, the bin, obj and packages folders do not require saving.

Try the following:
Try compiling in release mode instead of debug mode.
Try clearing the obj and bin folders
Turn off the automatic generation of xml.
Update:
My guess is that you are running your program in debug mode and your program is causing some files to grow.
There are the following methods to clean up the obj folder:
Right-click the project and select clean, then rebuild
Add the following code into the pre-build event, so that the obj folder will be cleaned up before each build, but this operation will delete the previous obj folder.
rmdir /s /q "$(ProjectDir)obj"

Related

Why is VSCode creating a history file?

VSCode keeps creating a history file even after I delete it. If I don't delete it, it accumulates to over 5000+ pending changes in my source control tab, and I don't know what I did with my settings for it to keep recreating the history folder. How can I delete this for good? I don't know if it affects my other files, and based on my history of deleting it, I don't think it does.
you can always add a .gitignore file and add the following line in it. This way your git engine won't pick them up.
.vscode
It just means you have a lot of vscode settings in your local, you can ignore them or delete them if you don't want to keep these editor settings. These settings won't affect any other files or other people's computer, as long as they don't get committed into the code repository.

Merging a folder in SVN records only the folder in the log, and not the files inside it

The scenario is as follows.
We're running a CI server which scans a repository for any .sql changes, then executes them against a target database.
Currently it's failing because SVN is not recording file changes within a folder (that has been merged from a branch). Merge info was commit too.
Example:
Developer branches "/Trunk" to "/Branches/CR1"
Developer adds a new folder "CR1/Scripts"
Developer adds two new files "Scripts/Script1.sql" and "Scripts/Script2.sql"
Developer commits the folder and files together
Developer merges from CR1 to Trunk, commit dialog displays status "Normal"
CI server detects no changes
Developer examines the log and sees no mention of Script1.sql or Script2.sql
All this is displayed via TortoiseSVN on Windows, the CI Server is using SharpSvn .NET library.
Any help figuring out how to get the *.sql files to show up would very much be appreciated.
It's nearing a year, and during this time we've used a workaround to find the missing files. Using the CLI command svn log -v we scanned for any directory with the COPY-FROM-PATH text and listed the contents from that directory on disk rather than SVN.
Whilst this does provide us with a full list of files in that folder, we should really be able to get this info remotely without checking out a copy of the repository. When a co-worker also encountered this issue recently they found the the answer courtesy of the IRC channel #svn on freenode.
Using the CLI command svn diff <url>[old rev] <url>[new rev] --summarize you get a difference between the revisions which thanks to the --summarize flag displays all the files and which finally answered the original question.

Accidentally deleted page.xml. How do I get it back?

I have accidentally deleted the file app/design/frontend/base/default/layout/page.xml from my directory.
My understanding is that this is the 'default' page.xml file that comes with Magento. How can I get this file back?
You can get the file from:
http://svn.magentocommerce.com/source/branches/1.7/app/design/frontend/base/default/layout/page.xml
If you have an other version of Magento, you might want to tweak with the version in the URL.
You could also redownload Magento and search for the file in the package if this won't work out.
Another way is to just go over to www.magentocommerce.com/download, select the release archive tab, grab the .zip archive for the version you are working with and unzip it into a temp folder. You then have all the files that make up Magento right there stored in the exact same directory tree as exists on your website, very easy to retrieve.
Personally, I keep the archives on hand for the current version, previous version and next version in my upgrade path. That way I always have an easy reference if some code oddity comes up in my custom templates and modules.

How to populate Isolated Storage for Windows Phone application

Is there a recommended way to initialize the data in Isolated Storage for Windows Phone 7 application before it is run for the first time? Right now the best solution I can think of is putting a flag in IsolatedStorageSettings and checking for its presence on in the application Launching event. If the flag is not present I initialize several objects in code and save them to Isolated Storage and set the flag so they are not set the next time the application is run. Is there a better way to do this? Should I add the objects in serialized state as some kind of resource or it is acceptable to initialize them in code? I expect that they would require like a thousand lines of code.
Well if you can create your files and add them to the project. And if you are sure that you will not be editing your files than just keep them like that. The files will go into your installation folder.
Or if you think that you are going to edit them and want to keep the changes saved, than copy them from the installation folder to the application storage folder.
Here is a link in which a database which was added as a reference to the project is copied from installation folder to storage folder of the app.
http://msdn.microsoft.com/en-us/library/hh286411(v=vs.92).aspx
Do the same for your files and everything will be fine.
The second part of your question. Well after this just check for one file/folder in the app storage folder and if it says yes it is there than do not copy your files from installation folder to application storage folder.
And if you are trying to make the files when the application launches than just add a check before the creation code is run. Where you will search for a file/folder existence. And if it exists do not run the file creation code.

Auto generated view.g.cs page keeps including old using statements?

I'm having a pretty difficult time with my resources within the view pages.
The auto generated view.g.cs page keeps including old using statements and I can't get it to stop. I have about 12 views and it will only do it on the first one, but then I delete that file completely and it then adds them to the next view. I've tried recreating the views and but the first one with the generated file still fails. I then set the build option to none, cleaned, rebuilt, and back to page, and it still happens!
I've tried deleting the actual generated files in the obj folder but they just get created again and the first view in my list then screws up again.
Any way around this? I think I've exhausted my options other then recreating the project but I'd prefer not to do this. Any other way to fix the generated files?
Cheers.
Try right-clicking on the XAML file and "Run custom tool".
This should generate the new, up-to-date .q.cs files.
EDIT:
Also, make sure that your own XAML and code-behind file is correct. The best way to do this is to perform a recursive search for the old namespace in all the files . in project directory (most appropiate part of it, for example: com.company.product.OldNameOfFeature - search for OldNameOfFeature). If there are any XAML or code files you'll need to fix them.
EDIT 2
This search should be done using external application outside Visual Studio, for example TotalCommander.
How to search in TotalCommander:
Figured out the issue, I had two warnings that said the new namespace was declared twice in the same file... builds successfully.
Cheers.
If you downgraded from .NET Core 6 to .NET Core 3.1, you need to fix your .csproj file:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
Remove the "<ImplicitUsings>enable</ImplicitUsings>" line.

Resources