Source Control on Domino Designer: Files not getting deleted on on-disk project - xpages

A weird one here. I've noticed that the 'Team Development - Sync with On-Disk Project' is not deleting files on my ODP. I'm not using automatic updating.
I've looked at the permissions on the odp/nsf folder, and I've noticed a little grey out checkbox which I can remove, but it pops back up immediately.
I've also tried opening up the security on the folder (right-click/properties/Security) and giving most groups superpowers, but no bananas.
Any help or hint would be appreciated.
Update: the deletions happen, but not immediately. I'm confused.

We have had issues not just with deletion but newly added files received via git, the only solution is to refresh both projects a few times and sync them both.

Another issue: I often lose some project settings, i.e. an additional source folder and a .jar file. It probably has something to do with replication, but it's impossible for me to find out exactly why this is happening.

Related

VS 2019 don't delete files immediately

I accidentally deleted a wrong file in Visual Studio 2019 before commiting the changes. I lost not a lot of work but I want to prevent this in future.
Can I setup VS 2019 somehow that files are not immediately deleted but kept in a cache for a while?
Supposedly there is already a backup folder which VS uses for deleted files, but this folder was empty in my case. And also the fact that VS moves files into the Windows bin doesn't help me because my repository is not on the system drive.
Do you know about any settings in VS or is there maybe an extension?
Not exactly what you are looking for but this extension could help you. It migth not prevent the deletion, but give you the opportunity to recover the code.
I haven`t tested it and I am also not sure if it will work with VS2019.
A visual source code plugin for maintaining local history of files.
Every time you modify a file, a copy of the old contents is kept in the local history. At any time, you can compare a file with any older version from the history. It can help you out when you change or delete a file by accident. The history can also help you out when your workspace has a catastrophic problem. Each file revision is stored in a separate file inside the .history folder of your workspace directory (you can also configure another location, see local-history.path).
https://marketplace.visualstudio.com/items?itemName=xyz.local-history
The answer here is to use a version control system (like git) and keep a full history of your project.
Even on simple personal projects it is worth doing.

Domino Designer error: "Resource already exists on disk" for service config file

we have a XPage project in the Domino Designer. The project contains a file [database.nsf]/Code/Java/META-INF/services/com.ibm.xsp.core.events.ApplicationListener, which configures an com.ibm.xsp.application.events.ApplicationListener2 (same with com.ibm.xsp.application.events.ApplicationListener) to be executed when the application is created, refreshed and destroyed.
When I clean and rebuild the project I often get the following error in the problem section:
The project was not built due to "Resource already exists on disk: '[database.nsf]/WebContent/WEB-INF/classes/META-INF/services/com.ibm.xsp.core.events.ApplicationListener'." Fix the problem, then try refreshing this project and building it since it may be inconsistent.
This message is correct: the file is than available at that location. (You have to use the Eclipse view "Navigator" to see it, because the directory /WebContent/WEB-INF/classes is hidden in the project explorer.). When I open the file, it is empty. When I open the properties of the file, the size is "-1 bytes" (yes, minus). When I delete the file and refresh the folder in the Navigator, sometimes the file come directly back again with size -1 bytes, sometimes not. Sometimes the bug is solved after next clean project, but sometimes it reoccurs.
When the Designer compiles the project without error, the file has the correct content. At runtime this file is read and the ApplicationListener is executed, all events are fired as expected.
When the error occurs I could copy the content by hand into the problematic file and save it, delete the error task in the Domino Designer. Than the application also works fine (?).
I tried to create a minimal example, with a new project (nsf database) with only the configuration file (/Code/Java/META-INF/services/com.ibm.xsp.core.events.ApplicationListener) and the application listener implementation. Unfortunately the error does not occur.
The reason may be, that our project has a lot of files. We had this problem only with the services definition file. The problem also occurs when I rename the file (I appended two underscores as test).
The problem occurs with Domino Designer 9.0.1 and Notes 9.0.1 FP3.
Our project has an associated on disk project. But I had the same problem after removing the association. After associate again the problem was there again.
Is there a solution, except removing the file? (Whithout the file our application will not work correctly.)
Thanks in advance
Stephan Koops
I have had the same issue. In the 'Problems' view it lists 'The project was not built due to "Resource already exists on disk .../WebContent/WEB-INF/Classes/... then a file with a long hex name ending in .js.
Even simple Xpage changes would not appear on the browser no matter what I did with clean/build etc
What I find works is:
Open the 'Package Explorer' view, and in the first Folder called Local you will see a series of *.js files as mentioned above.
Delete them all.
Clean and build.
Bingo, my xpage is now working again.

How to stop "Failed to delete the temporary file..." warnings from VS2012 compiler

I have two rather large solutions that both experience the same problem. The issue is that I am warned about an inability to delete temporary files. The messages all look like this:
Failed to delete the temporary file
"C:\Users\Don\AppData\Local\Temp\tmp07197280428445c484ba0cda58178903.exec.cmd".
The process cannot access the file
'C:\Users\Don\AppData\Local\Temp\tmp07197280428445c484ba0cda58178903.exec.cmd'
because it is being used by another process.
I have seen suggestions of using pre-build commands to first delete things, but that is a lot of projects, and I'm not going there.
Anyone know how else I might remedy this, that does not involve "fixing" each project individually?
If it makes any difference, I'm compiling C# .NET 3.5 projects.
My idea is, to write a small addin for Visual Studio, which can delete files on build. You could configure it with filepaths and then just run sth like this:
foreach (var item in paths)
File.Delete(item);
And the config you could put solutionwide.
I get that too - the problem is that the compilation system itself is holding onto the file when it attempts to delete it. I think it deletes it afterwards anyway as I've never seen the named files hanging around afterwards so its just an annoyance that can be ignored.
The files seem to be the command that VS is running that is built up from the build settings.
I assume its a .NET thing where the GC hasn't cleaned up the object that has the handle to the file when the system attempts to delete it. If so, directly shows the benefit of RAII over GC :-)
A likely source for the problem is that your antivirus software is busy scanning the file in question, which prevents the rightful owner deleting it. Curb the enthusiasm of the antivirus and your problem will be solved.
Unload the project from your solution, than reload it. It should create the missing files and be buildable again.
If you have installed any third party cleaner tool and activated the active mode (always running in background) this will lock the temp folder in the appdata so Visual Studio is unable to restore the Nuget package on build and there will be a build error.
Try uninstalling the cleaner and restarting the system. When I had this problem, that was how I fixed it.

VS2012 detects change made outside VS and mark files checked out

On my VS2012 I noticed that if i edit a file that is not checked out in a notepad and save it, in TFs it will be marked as checked out and edited. So far we haven't found too much of a problem of it, but potentially people can get careless and make/save changes unintended.
Is there anyway to turn off that feature?
What you're seeing is now default behavior for Local Workspaces. One way to 'undo' this is to set your workspace to a server workspace once more. But I suggest you first investigate the benefits of local workspaces before deciding to turn it off. People still have to check in files, so there is a gate between changing the file and actually committing them to source control.

Using local TFS workspace for non-VisualStudio source code

I am trying to use TFS storing non-VisualStudio source code. Working with Visual Studio 2012 and Microsoft's online Team Foundation Service.
I've setup a TeamProject and mapped its root to a local folder. All it contains at the moment is a BuildProcessTemplates folder in it. (which was created as part of the TeamProject)
I copied my source code externally (using windows explorer) into the TeamProject root folder on my hard drive and since my TFS workspace is NOT a server workspace but rather a local workspace, I was expecting VS to detect the folders/files and show them in Pending Changes window .... yet it doesn't.
Interestingly, new files in the root folder are detected as "Excluded Changes" but new folders are not detected.
What am I missing?
First make sure the newly added folders contains files.
Are there any Detected changes shown in the Excluded Changes section?
Pending Changes > Detected changes link > The Promote Candidate Changes dialog box appears > check the files you want and click Promote.
I can't say I have ever noticed nor expected TFS to automatically pick up files or folders added to a mapped directory as pending changes.
I always just add them manually using the 'Add existing items' option from the source control view.
It may actually do (or at least be meant to do) the auto-detection, but I can't say I've ever relied on it. I don't think it's something to fret too much about - adding them manually is easy enough, and the 'Add existing items' option is usually smart enough to show you which files are not already under source control, so even if you need to add even more files later, it shouldn't be too much extra effort.

Resources