Changes doesn't reflect on run time (code and design) - vb.net

Im developing a system using vb2022 its almost done but today the changes I made doesn't reflect on run time.
For example I added a button but when I run the program the button will not show.
Same as the code, i can write code but it doesnt reflect on run time
Plus im trying to change the startup form into form 2 (initial is form 1) but it doesn't reflect.
What should I do? I didn't change anything I just opened the file and write code. But suddenly this happened.

Most likely your build is failing and VS is automatically running the old output. When that happens, VS will prompt you whether to run the old output or not by default, but many people tell VS not to prompt them again without actually reading the dialogue. Use the Build menu to build your project/solution and pay attention to the Output and Error List windows to see whether it failed or not.
It may be that the compilation is succeeding but VS simply can't overwrite the output files because they are locked, which does happen sometimes. In that case, just delete the entire obj and bin folders from your project folder. You may need to close VS to do so. The next time you build, new output will be created and run.
If this happens regularly then you should probably repair VS and, if it continues after that, reinstall.

Related

Can't run different vb.net applications based on the same original app

I have a desktop Windows Forms application I built.
As we try out improvements to the program, I make the changes on a test version of the application, which connects to a test copy of the Microsoft SQL database on the back end.
Basically, to start out, I just copied the program to a different directory, re-named the assembly, created a different PublicTokenKey and used that.
The problem is when I try to run a the test copy and the live copy at the same time. It pretty clearly thinks they are the same program (when I click on the second one, the "busy" circle simple turns for a second, then the already-opened icon in the taksbar gets highlighted), even though they show up in the Task Manager as differently named applications.
What do I need to tweak in Visual Studio so Windows 10 will recognize them as different, separate programs?

Creating an updater; replacing files that are in use?

I am trying to create an updater for a screenshot application I have.
I've done the main part of downloading the update, but I now need to find a way to rename the new file the same as the existing one -
e.g. "NewFile.exe" > "ScreenshotApp.exe".
Also, I don't want to add another .exe solely for updating, just for the purpose of keeping it light and portable.
Is there any way of renaming a file that's in use?
Perhaps telling Windows to rename it AS SOON AS the application has closed itself?
Option 1:
Have launcher which most likely you want update that will handle updating your application as well as launching.
Option 2:
Have external exe monitoring updates and updating your app.
Option 3:
Cretate batch file that will update your app whenever your done using it.
Option 3 is the one you are looking for but it is the worst. If anything goes wrong the app wont work and if user can live without it, they wont reinstall.
Option 2 is mostly used by bigger players. They either work all the time or are scheduled.
I would do option 3, it is much easier than you think, and if you want single exe, just make your app a dll, you can update it whenever you want but launcher will stay the same. That way you can handle any errors, and fix them if there is need for it.
Option 4 would be to run installer with fresh update that will close app install update. That solution is better to buy. For $250 you can get neat stuff where it would take you a lot man hours to o something even remotely close.

How to close/stop a .NET application and re-execute it?

My application updates(running a vba script) an excel shared workbook, and since it is shared, there shouldn't be problems when someone else is using the same file at the same time. But for some reason, sometimes it simply freezes, without any error message, just freezes.
Is there a way to programatically make the application stops/closes automatically when frozen or after some minutes(In normal conditions, this updating process shouldn't take more than 1 minute)?
And, if possible, re-launch the app again automatically after some minutes for at least 5 attempts?
This way would ensure process completes succesfully.
I have had to do this same thing before but because I had an application that would look for updates to it's self on the network and then update it locally. Problem is, you cannot update the exe that is running.
What I did to get around it is to create another program that would wait a second, update the exe, then run the exe again.
Because I did this with a few different apps, I made my "Updater" generic so I could send some command line parameters and it would use those to copy and run.
If you want to try something else, you might be able to accomplish this same thing by creating a BAT file and running it. I'm not real good on BAT files so I can't help you there. But, it is another way to handle it.

VS 2012 invalid compile errors. Only way to fix is to wait like an hour

I am getting some really weird issues.
In VS2012:
I copy the code from an existing page to a new page, make some changes. Then change the referenced user control to a control that does not exist yet.
Then create the new user control and paste code from another control, make some changes and save.
VS will fail to build because of 'xxx' not declared errors. Which is bogus they are declared.
restart VS, restart machine, build, rebuild, clean and rebuild. All fails to fix the errors.
BUT, after a seemingly random amount of time (like, hours), the problem will fix itself.
I can't wait hours every time. How can I tell VS to stop being silly and build the project! Anybody know why it is failing?

Accurev - why not Auto-Update?

Why isn't it standard behavior for Accurev to automatically run an "Update" upon opening the program? "Update" updates a user's local sandbox with the latest files from the building/promoted area.
It seems like expected functionality that the most recent files should be synchronized first.
I'm not claiming that it should always update, but curious as to why an auto-Update wouldn't be correct.
Auto-updating could produce some very unwanted results.
Take this scenario: you're in the middle of a development task, but you've made a mistake and need to revert a file that you just modified. So you open AccuRev, but before you have a chance to "revert to most recent version", you are bombarded with 100 files that have been changed upstream including the one you want to revert. You are now forced into the position of resolving all the merge conflicts before your solution will build, including the merge of your (possibly unstable) code in progress.
Requiring the user to manually update keeps a protective 'bubble' around the developer, allowing them to commit (keep) changes within their own workspace without bringing down code changes that could destabilise the work in their sandbox. When the developer gets to a point where his code is ready to share with others, that is the appropriate time to do an update and subsequently build/retest the merged codebase before promoting.
However there is one scenario that I do believe auto-updating could be useful: after a workspace is reparented. i.e. when a developer's workspace is moved from one part of the stream hierarchy to another. Every time we reparent we have to do a little dance:
Accept the confirmation dialog that reminds us (rather verbosely) that we need to update our workspace before we can promote any changes.
Double-click the workspace to view its files.
Wait for AccuRev to do a "Pending" search, to determine whether any file changes are waiting to be committed.
And finally, perform the Update.
Instead of just giving us a confirmation dialog, it would be nice if AccuRev could just ask us if we want to Update immediately.
I guess it depends on preference. I for one wouldn't like the auto-update feature.
Imagine you have a huge project and you don't want to build it every time you start Accurev. But you also can't debug because the source files and debugging info no longer correspond.