Website builds but publish to Azure fails after deleting files - asp.net-mvc

Using Visual Studio 2019 to build a .Net Core website and publish to Azure was working fine up until I just deleted a DataContext file and an Entity class through Visual Studio. I can build and bring the site up locally without any issue but when I try to publish the site to Azure I get an error that the two files I deleted could not be found. I've checked in my code along with the solution file. The message is correct, those files are no longer available but I'm not understanding why it's looking for them since I deleted them through VS and the solution/project file should have been updated. I've done some searching but can't find anything that specifically address this. I guess I could roll back to right before I deleted the files but then I'l have to update some code. Anyone know if I can look somewhere that is referencing these files for publishing so I can delete the reference? I've searched the whole solution for the name of the files hoping I could find a reference but it isn't finding anything.

Related

Why is TFS not updating my project?

We have an ASP.Net MVC Core project solution in TFS.
And there is an error icon at the top of the solution explorer that says "Package restore failed".
And if I open up the project.json I see the red sqigglies:
"The dependency ... could not be resolved" for several dependencies.
The developer who created this error has since fixed it. And all the other developers on the team get latest and the error goes away.
But it won't go away for me.
I get latest and the error icon at the top of the solution explorer and the errors within the project.json are still there.
I blew away the folder, got latest from Team Explorer, and the errors are still there while gone for the other errors.
Anyone know why this is happening?
I'm stumped. I don't understand what is happening.
First, you could try to do a force update for the specific error fixed changeset.
To force a update, use the "Get Specific Version" command with the
"Overwrite all... " option checked.
You could also clear TFS and VS cache, delete old workspace(back up changes first), create a new one, then do a fresh getting latest files from TFS source control. Which should do the trick.
If the issue still exist, you will have to check your local environment if you are missing some thing. Do a simply compare of the environment with other developers on the team.
It turns out this was a combination of the way .Net Core stores nugget packages and of being in a government environment.
We log into our computer with one account that does not have admin priveledges and this is the one I develop with in order to connect to TFS. But there seems to be a lock on the users folder for this account. So when I start up the solution and project.json tries to resolve all the packages, if one is missing it can't download it and put it in that folder. I then have to start Visual Studio as an Admin and open the project. Then the missing package is downloaded to the nugget package folder under my Admin user's folder. Then I read the resolution failure output at the top of the solution explorer next the the red circle with the X in it to see which package is missing and copy it over. It may be more than one so you have to close VS open back up as the non admin account and look for the next one that fails.

compile web service tfs build

I'm using tfs 2015.3 and I'm trying to compile a web service project (.asmx).
Now, my build failed because of this error: It is an error to user asection registered as allowDefinition='MachineToApplication' beyond application level
I looked online for solutions and found that there is a problem at the build when 2 web.config is at the same project (one at the root and one is somewhere at the project's folders). Then I saw that a folder named PrecompileWeb was created with content of another project from the solution.
I tried to build the project at vs2013/2015 and the folder does not get created, as opposed to with msbuild (which tfs probably uses).
How can I prevent this folder from appearing? I saw a solution that suggested giving a property of '/p:PreBuildEvent=' or something like that, but it's not working.

TFS checkin error VS2013 - The process cannot access the file

Consistently getting a checkin error via VS2013 for a MVC project. Have been spending quite some time but still dont get whats happening.
The project is cleaned. Checked that Application Experience is set to automatic. I am running on Windows 7
Any help ?
There is a file in your solution that does not exist on disk. Maybe it was deleted manually. If you know the file you can go looking for where it is referenced in your project hierarchy. It should be listed with a yellow triangle.
Either remove it or replace it.
If you don't have a local copy but it is still on the server you can find it in the Sourfe Explorer and do a Get Specific | Latest to recreate it.

Where does the VS2012 Publishing Wizard get its file references?

I am having an issue where when I select to publish my MVC project to the file system so I may upload it later via FTP to my Web Host, it fails complaining of missing files.
Believing that it may think these files are required to compile the project, I copy them to the locations that it expects and it resolves the error but produces yet another error about another missing file.
These files incidentally are not required to run my Web Application but were simply files used during the initial test phase of my project. More specifically, picture files.
The next step I took to resolve the issue was to Clean and rebuild the Solution and Project Entirely with all those files it was referencing in the errors removed. The Project builds successfully and runs as expected.
I then attempt to publish to the file system and again it complains of those files as if its getting that information from somewhere other than obvious places within my Project.
I have deleted the object directory content, cleaned and rebuilt; again it references these files that don't exist anywhere within my Solution.
So my question is, Where exactly does the Web Publishing Wizard get the information it uses to copy the required files to the Target Location? I've checked the .pubxml file but there's nothing in there that would provide the information.
For instance, if I'd initially built my site using reference to a .png file then later use a .jpg file. The Wizard seems to be getting the metadata for the initial build somewhere and insists on inclusion of the .png file when it is no longer needed.
I believe I have Upgraded to the latest build and patches for VS2012. I am Currently running version 11.0.50727.1 and using .NET 4.5
I cannot find any relevant information on this problem so it may be a quirk in my Environment so I'm searching for some feedback.
If no answer can be provided, if I could simply know what folders and files are required to deploy an MVC site; I'll perform the deploy manually and trash the Wizard concept. I just thought it would be the most appropriate way to deploy but if its going to be a pain; I don't need it.
This is the Error:
Error : Copying file <relative path>\image.png to obj\Release\Package\PackageTmp\<relative path>\image.png failed.
Could not find file '<relative path>\image.png'.
The new file that replaced the old file is actually image.jpg and its in there. I could alleviate this error by copying the old file back to its initial location, but why should I if its no longer required?

TFS changes visible by some users but not all

This is probably some caching issue but I’m not sure how to fix it. We have TFS 2010 and a situation that some people with same level of permissions see the recent change but others do not (I’ve checked permissions 10X and I’m 100% sure they have exactly the same permission).
More specifically - this happened several times when I (admin account) added new iterations to one of the projects. Some people inside the project can see the change but others can’t.
Any ideas how to handle such issues?
We had same problem several times and we always managed to successfully solve it by deleting application caches on the TFS Server itself.
Just got to TFS installation folder on the TFS application tier and find folder
C:\Program Files\Microsoft Team Foundation Server 2010\Application Tier\Web Services_tfs_data . Inside this folder you’ll find folder that looks like this “cde96d50-b143-4a28-b280-1cd24fa95525” – just go ahead and delete that folder. This is where TFS keeps its cached application data.

Resources