Renaming Windows Toolbar application link - c#

I'm working on Visual Studio 2019 with C# and i'm stuck with this technical matter. I want to change the name of my app displayed on Windows bottom toolbar.
I tried many things.
I changed the solution name.
I changed (i suppose) ANY possible location of that word in the files.
I changed the name in the application tab in the solution properties.
I changed the folder name and project name (opening the project file via notepad).
I removed obj and bin folders and cleansed/rebuilded.
I removed old files named with their old version (when i renamed things in visual studio, instead of renaming some files it created new files with the new name, so the old files with old name remained).
I already did this weeks and weeks ago, it worked...but never did it before and i was a bit confused and randomly trying. I thought the real thing was just opening the project via notepad and changing its content (so i even wrote myself a note to remember it), but it's not. I don't understand what i'm missing.
I did something useful by trying to play it as Release and not Debug, but i also managed weeks ago to change it as a Debug as well and just don't remember or understand how to do it.
Thank you in advance!
(Edit: i'm trying to edit it again to change a letter into Upper Case, but also running it into Release it doesn't change and stays Lower Case...definitely something goes wrong with all this)

Related

New changes do not appear in bin debug

I have created a windows form application.
Few days ago I started making it look better by changing icons and images.
But the changes do not appear on my form. (imagelist and program logo .ico)
I have built/cleaned my application several times.
Is there something else I should clean?
Please make sure that in the solution's properties the project is actually marked for build. You can - for every project in the solution - check a box saying whether the project should actually be built or not.
Make sure you are compiling to Debug and not Release
Make sure you have the same platform (x86, x64, Any CPU) than before.
If still problems:
Clean solution
Delete bin and obj folders.
Rebuild
Also, its a good practice to have images and icons in resources. If you don't you can give it a try.
Update
Are you sure the app is compiling? You might have said to run even with errors and checked to not ask you again. Go to View menu -> Error list and see if there is any compiling error.
Any resources ( image files for example) must be added to the project and marked as copy to output folder ( always ) there is the option to copy if newer but since this is dependant on time stamps the first choice is more reliable.
Without this associated resource files will not end up in your build output folder.

Can't rebuild my application anymore

I'll give you 2 versions of my problem to describe it, first the short version.
When I try to build my application it does that perfectly and my app works but when I try to rebuild it, that fails and gives an error message saying that 2 files are missing (bin/debug/MusicPlayer.exe and bin/debug/MusicPlayer.pdb). When I then try to build normally, it fails to with the same error.
Now the longer version:
The way this happened was quite out of nowhere, I program on 2 different locations (both in Visual Studio 2010 sp1) but to always have the recent version in the right place I copy the entire solution folder to a usb stick, this folder I copy over again on the other PC and use it to continue were I left off, I've done this many times without problem. Yesterday however, I got an exception while testing the app. But instead of showing this in my code, it was complaining that it could not find the program.cs file (it was there, but apparently it had a different checksum (md5) and it asked me to use this one. After a while I found what part of my code caused the exception and fixed it. Since then I haven't got that error anymore. But when I later tried to rebuild instead of build, it gave me the error described in the short version. I have tried to fix it, but apparently I was not very successful.
Basically, what I think it does is delete the files in the debug folder that need rebuilding and then gives me the error of missing files (the files that it deleted) and thus failing to rebuild succesfully because these deleted files the normal build option won't work to.
(What I then do is re-copy them from my usb to make the normal build work).
Don't know if it's important, but I program in C# and I'm still learning.
Also when I copied it to my usb I believe I had no errors and the app was working fine (except the part I fixed later, which I could not test at that location). And when I build the entire solution it gives some warning ==> "Assembly 'bun/debug/MusicPlayer.exe' is incorrectly specified as file" and this for 5 files.
Does anyone know how to fix this rebuild problem and if necessary the warnings?
Thanks in advance
(and sorry for my bad English)
OK it seems like you might be confusing yourself with your directory structure here. If you want to add Content or Resources (Images, Text Files, etc.) you should place them in a folder within your project (not called bin or obj). All your build files will go here. Instead place the Content in another folder and Right Click -> Properties and Set the build action to "Content" or "Resource" and set the Copy to Output Directory (bin folder) to "Do not Copy" or "Copy if newer."
The project is failing because you have the built executable "MusicPlayer.exe" in your project. So Visual Studio is trying to build an executable file in adding to the project. Restructure your directories or remove "MusicPlayer.exe" ever time your build your project.
Do you have any anti-virus software running? They can go way too aggressive on removable drives. You are actually continuously deleting and creating a runnable program on usb stick by recompiling.
Just a guess tho...
Sounds to me like you have a pre- or post-build event with a hardcoded path in it. Fix that using variables and it should be ok.

problem with Visual Studio 2010

I've been using Visual Studio to code my C# project for a while, everything is seem to be okay until today, I modified code from C# File Browser and use it in my project as component. After that I cannot change the Window Form icon (as same as I've done with others win form) when I browse the icon file Visual Studio become stop working. Moreover while I'm do the debugging with window form that have file browser, I try to test an function by browsing a file after I've browse a file VS also stop working. More and moreover sometime VS stop working by itself without any action by me. Anyone know where to seek for the cause or how to solve this.
I've solved the icon problem by using
this.Icon = new System.Drawing.Icon("icon.ico");
and set the properties of image:
Build Action: Content
Copy to output Directory: Always
after I've installed VS 2010 service pack 1 the icon problem can be solve, I can browse the icon file in properties but another fail on debugging still the same and I've got
exited with code -2147483645 (0x80000003).
which seem to be cause by the file browser library
I've recently had a lot of crashing going on also.
I was able to get my website solution functional again by deleting the Solution User Options files.
.suo files, under your profile ( OS dependent )
(My Documents\Visual Studio 2010\Projects\solutionName for xp, unless you have your .sln someplace else.)
(NOTE: You right click a solution on the start page, and open Containing Folder.)
solutionName.sln.docstates.suo
is one of them. This cleared up the problem i was experiencing, but then caused other issues.
and
solutionName.suo
Do realize, this will lose ALL settings you have made for this solution.
However, it can clear things up.
I believe that once you get a crash, you can get garbage in these files.
In some cases, it may also be necessary to delete the .sln file itself.
As always, keep a copy of these files just in case...

C# visual studio - Properties.Settings.Default.SomeValueOrAnother has me baffled

C# visual studio project: Properties.Settings.Default.SomeValueOrAnother has me baffled.
I have a relatively simple project. It saves a bunch of last-entered values between sessions, and restores them on next invocation. Was working fine. I changed a control so that the minimum allowed value was no longer 1, but was now 100. Last used value had been 3. On startup, it now complains that 3 is not a valid value.
Well, duh, of course – but hear the rest.
I have edited Settings in VS to default to 500. I have edited the exename.config file to contain 500 instead of 3. I have examined every possible config file (vshost.exe.config, the files in bin/debug, bin/release, obj/debug, obj/release. They all contain value=500. I have re-built repeatedly. I have copied just the exe and the config file to a separate PC, so that the development environment was not a factor. I still get this error message.
To further confuse me, on the dev PC, if I run (directly, not in the debugger) the exe in /obj/debug or /obj/release I do NOT get the error. If I run the ones under /bin I DO get the error. The config files have identical contents. If I copy the exe & config from /obj (the one that does not give an error on the dev PC) to another PC, I DO get the error.
I thought exename.config was all I had to deal with, but it looks like VS is doing something behind my back – at least something that I cannot find in the documentation. I imagine this is something trivial. If anyone can explain what I've missed I'd sure appreciate it. All I really want to do is reliably save some user settings from one run of the program to the next. And get this app to 'forget' that obsolete value.
TIA
Mickey
Look for *.settings files in your solution. That's where the value that's used when you build your project will be stored .
This was not the entire answer, but it did explain where the mystery values were being stored:
"This might help to some people dealing with Settings.settings and App.config: Watch out for GenerateDefaultValueInCode attribute in the Properties pane while editing any of the values in the Settings.settings grid in Visual Studio (VS2008 in my case). If you set GenerateDefaultValueInCode to True (True is the default here!), the default value is compiled into the exe (or dll), you can find it embeded in the file when you open it in a plain text editor. I was working on a console application and if I had defaults in the exe, the application always ignored the config file place in the same directory! Quite a nightmare and no information about this on the whole internet."
...in another post here. I am now individually testing values read from settings, rather than trusting it, and forcing them into valid range if required.
Truly an ugly, and well hidden, default. I haven't embedded data values in my executables since the days of CPM. Jeesh.
Thanks again, Microsoft.

Problem with "add reference" under Visual C# 2008 Express Edition after switching from XP to Windows 7

I suddenly have a big problem I didn't have before.
In my current project, I want to add a reference to "Microsoft.Office.Interop.OneNote". When I open the .NET tab of the "Add Reference" dialog, the "Microsoft.Office" assemblies aren't available like they used to be; on my machine, the next assembly after "Microsoft.JScript" is called "Microsoft.SqlServer.ConnectionInfo"; no trace of any of the "Microsoft.Office" assemblies. I used to be able to do this under Windows XP, but made the switch to Windows 7 a couple of weeks ago. I don't know whether that has anything to do with it.
I already checked whether the assemblies are installed on my machine, but I found all of the office assemblies safe and sound in "windows\assembly". Oddly enough, the reference to "Microsoft.Office.Interop.OneNote" in a previous project continues to work; I just can't add any new references with the "add references" dialog, as they aren't shown in the list of .NET references anymore.
Any help will be appreciated.
Kind regards,
Rainer
Pardon the perhaps stupid question.
Have you installed MS Office since you switched from XP to windows 7?
I'm only asking because I forgot to install it after the same upgrade and I spent a good half hour last week trying to figure out why my project that used Powerpoint was complaining.
the content of the dialog you see with ´Add Reference´ is actually not loaded from the GAC. It´s some registry-folder settings for visual studio.
Maybe you installed in such a way that the libraries are not part of this set. Then VS will not show them in the dialog.
for more info on how to add entries to your ´add reference´ dialog see
http://support.microsoft.com/kb/306149
I think I have got it. For the benefit of anyone who runs into the same problem, there was an interesting lesson to be learned about some lesser known features of Windows:
The link Marvin mentioned above...
http://support.microsoft.com/kb/306149
...says:
To display your assembly in the Add Reference dialog box, you can add a registry key, such as the following, which points to the location of the assembly
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\.NETFramework\AssemblyFolders\MyAssemblies]#="C:\\MyAssemblies"
where MyAssemblies is the name of the
folder in which the assemblies reside.
So I did just that, replacing "myAssemblies" with "C:\Windows\Assembly".
Nothing happened.
I changed the value of the empty standard key to "C:\Windows\Assembly".
Nothing.
I tried some variations of the theme: double backslashes, ending with a backslash, the return of the son of the backslash. No cigar.
So I tried to work the other way around by trying to copy the necessary dll from c:\windows\assembly into one of the directories that are being watched by the "add reference" dialog. On my machine, these paths are conveniently listed under
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft.NETFramework\v2.0.50727\AssemblyFoldersEx]
When I tried to copy the dll from c:\windows\assembly, there was no "copy" option in the context menu. Drag'n'drop didn't work either. For this problem, I found several alternative solutions here:
http://geekswithblogs.net/pavelka/archive/2006/05/05/WindowsExplorerAndTheGlobalAssemblyCache.aspx
I opted for solution 2:
Add DisableCacheViewer Registry Key
Another way to disable to create a new dword key under HKLM\Software\Microsoft\Fusion\ with the nane DisableCacheViewer and set it’s [DWORD] value to 1.
After I had done that, I could see the real directory structure below c:\windows\assembly; almost each and every dll has its own subdirectory. As soon as DisableCacheViewer was set, I could
traverse the real directory tree that was hidden under c:\windows\assembly
copy dlls and paste them to one of the directories listed under "AssemblyFoldersEx"
deduce the correct path to my dlls and create a fresh key to that path just below "AssemblyFoldersEx".
Thank you very much to everyone who answered, and a special thanks goes to hannes pavelka, whose blog entry helped to solve my problem.
P.S.: I'm almost certain that I never had to do this under Windows XP. IIRC, all of the interop assemblies were available without this kind of registry fumbling.

Categories