Where is Visual Studio storing Publish Profiles? - c#

I have a corrupted Publish profile.
I need to delete it. My other computer is fine, so I know it is local.
I have tried:
Clean checkout of codebase from Git (so nothing is local in my code directories).
Deleting C:/Users/<user>/AppData/Local/VisualStudio
Deleting C:/Users/<user>/AppData/Roaming/VisualStudio
Full text search of Profile Name 'MunicipalAgenda' through Registry
Full Text search through machine.
Creation of a new Windows User for Visual Studio Development.
Despite all of this, VS.NET is hanging onto that corrupted Publish profile.
Honestly I am at wits' end, and my next drastic step is to do a fresh reinstall of Windows 10. Please help before it comes to that!!!

Normally any publish profile store in particular project.
For that you have to look at following location.
Go to that project.
Project has special folder call Properties
Inside that there is a folder called PublishProfiles ( Something similar)

I also had some difficulty in getting my profile deletions to stick ... Visual Studio (2017) doesn't seem to be able to do it from Solution Explorer.
My latest attempt is to go to Source Control Explorer, open up the /Properties/PublishProfiles folder, and delete and commit the unwanted profiles from there. So far so good :)

Related

Visual Studio 2015 C# Deploy Application to Desktop

I have a C# application. It has multiple forms and multiple classes. I've been looking for ages on how to deploy my application and keep running into issues.
I've tried:
ClickOnce
Right click on my solution -> Publish
This is the data I've entered:
Specify the location to publish this application:
C:\Users\$USER\Desktop
How will users install the application?
Here I just want to be able to get an installation file that will install the app and all the assets. This is purely for testing, but I just want to be able to send a friend the .exe install via email (or some other means) so they can play around with it. I have not gotten any of these options to work thus can't continue.
File -> New Project -> Other Project Types -> Visual Studio Installer -> Setup Project
I right click on Application folder -> add -> Project Output
When doing this, it tells me I need to close my current solution (my application) and if I want to save. It looks like other people are able to get this project output project to show in the solution explorer along with their main application, but I can't seem to do that.
The entire Add Project Output Group is empty, including both dropdowns.
These are the two methods I've seen that seem to be the easiest, but I can't even seem to get them to work :s
I do also have my own website, and eventually I'd like users to install the application from a page on the website. If easier, I could set that up instead of dealing with just getting an install file, but I haven't looked into it as I assumed just getting this install file on my computer would be simpler.
Any help with this would be highly appreciated as I'm lost as of now.
So when I share my work with my a friend to review, what i generally do is send him them the .exe located in bin\Debug\app.publish\<name>.exe folder inside the project folder. Take care to place all the .dll, i.e class libraries that you have written into that folder, zip it, and share! Your friend should be able to extract and run.

Visual Studio not seeing all my files after git pull

I am working on a C# project from 2 computers. I made changes from one of the computers and committed the changes and then pushed them to gitHub. On my other PC I pulled the changes using git pull command.
Now I can see the new files added to the project in windows explorer. but visual studio doesn't see them for some reason.
I even deleted the whole project on the second computer and cloned the project again but that didn't help.
What am I missing? is this related to VS project settings?
Likely your changed project file was not saved or not committed. Check the commit has changes to the .csproj file. If not, save the changed project file, and make a new commit.
I have been bitten by this a few times, and now mash ctrl-shift-s (save all) in VS before committing.
Such of hundreds of problems:
Close solution and reopen it!
It

precompiledapp.config - how do I create it?

I'm having a problem with a web application where the events in the global.asax class aren't being executed when I build the application through our build server and publish the website. In Application_Start is a single line of code sets up our logging, and in Application_Error I have some error handling code. Locally it all works fine, and if I copy the files directly from my development folder to the server rather than publishing it via the build server everything works fine.
From loads of Googling it would appear that this is a problem with the precompiledapp.config file being missing - sure enough it doesn't exist anywhere. However, nowhere can I find out how I actually get the TFS Build Server, or Visual Studio (2010), to create this file so that I can publish it.
Any advice on how I can generate this file would be much appreciated.
EDIT: A bit more information. I've just tried publishing the website through Visual Studio 2010 rather than the build server and this created the precompiledapp.config file. I copied all the files across to the server (except web.config which I left intact) and it logs successfully (which suggests the global.ascx events are being fired). What I need to do now is try and get the build server to do the same thing - any ideas?
Make sure your custom config file is set as a content file and Copy To Output is set to Always in the config file properties in Visual Studio.
I seem to have resolved this issue now.
As I mentioned in the Edit of my original message, when I published the website through Visual Studio 2010 to a local folder it created the Precompiledapp.config file, and copying the folder contents to the test version of the application got everything working. As I can't seem to get the TFS Build server to create this file, I decided to try just copying the file from my local publish folder to the test application, along with the rest of the files from the tfs build, and everything seems to be working as it should.
So although I've not managed to figure out how to get the build server to generate this file, my main issue is resolved and I'm able to use the global.asax file again.
I'm late to this question BUT you should probably verify that you have the correct SDK that visual studio would use to build the precompiled app (I think it's Azure SDK even if not doing anything with Azure but not 100% on that).
If you have visual studio installed on the build server you can just install the web workload (opening the solution will prompt it). I did this with Visual Studio 2019 today. MSBuild was ignoring not only my *.pubxml settings but even passed in properties via command line arguments to msbuild.exe (which overwrite the ones in the *.pubxml file).
I opened Visual Studio, it prompted me to install the necessary workload and I did. Everything started working as expected after that.
To precompile, in your pubxml file make sure to have this:
<PrecompileBeforePublish>True</PrecompileBeforePublish>
Also, this post refers to your Edit comment about how to get the build server to do it when it works on your machine.

My Local Fileshare ClickOnce Update Is Not Working, Help?

I have a C# application that I'm trying to get to update automatically via ClickOnce. After publishing newer versions of software, I see the new versions in my publish folder, but when I open the application, it checks for updates, and does nothing (even though there are new files in the publish folder).
What do I need in place for updates to be made automatically?
Edit
What version of Visual Studio are you using?
Visual Studio 2008
Are you deploying the upgrades to the same location as the old version?
They are being published to the same location (not sure about deployed)
Is the installation URL the same? Have you incremented the version number?
Yes
In the Updates dialog reached by clicking the Updates button in the Publish page, do you have "The application should check for updates" checked?
Yes
Do you have "Before the application starts" selected?
Yes
How are you deploying the files?
Not sure
Are you copying them over to the file share or publishing the directly?
Publishing directly
What version of Visual Studio are you using?
Are you deploying the upgrades to the same location as the old version?
Is the installation URL the same? Have you incremented the version number?
In the Updates dialog reached by clicking the Updates button in the Publish page, do you have "The application should check for updates" checked?
Do you have "Before the application starts" selected?
How are you deploying the files?
Are you copying them over to the file share or publishing the directly?
If you are copying them over there, are you also copying the deployment manifest (whatever.application) for that version to the top of the deployment folder structure?
This is the file that indicates which version should be installed. If you are using VS2008/2010, there is a copy of each version's deployment manifest in each versioned folder (yourapp_a_b_c_d) that you can copy to the root if you are deploying manually.
This is where it gets a bit trial and error, since it seems like you're correctly configured. So it must be something to do with your environment.
Is the publish URL different from that which you initially installed it?
This is particularly pertinent if you're talking about this behaviour on your local dev machine whereby you probably first ran from a different location. Such that it'll keep looking for updates in the initial activation path. Suggest trying a full uninstall/reinstall and see if it persists... You could test by looking at ApplicationDeployment.CurrentDeployment.ActivationUri.
If worst comes to absolute worst, then maybe manually check and run updates?
Useful links:
http://msdn.microsoft.com/en-us/library/s22azw1e.aspx
http://bloggingabout.net/blogs/dennis/archive/2007/11/05/manual-check-for-updates-with-clickonce.aspx

Do I need the bin\debug\appName.vshost.exe and appName.vshost.manifest in my SVN code repository?

I am building an application which is based on a sample application,
written in C# on .NET 2, and is built on VS2008. This application is mostly a wrapper for a COM application.
However I compile it in .NET 3.5.
The sample application came with the following files in it's bin\debug:
appName.vshost.exe
appName.vshost.exe.manifest
I noticed that I can delete the files and VS re-builds vshost.exe, and the vshost.manifest file appears with modification date the same as the deleted file as if VS has copied in from somewhere.
My question is, should I put this files in my SVN code repository?
Those two files you list implement the Visual Studio "hosting process". It is a hosted version of the CLR, designed to improve the debugging experience. It takes care of some security issues, the most visible side-effect is that it redirects output written with Console.WriteLine() in a GUI app to the Output window.
These files are not part of your project and do not get deleted when you use Build + Clean. In fact, you cannot delete the .exe file, it is always running while you've got the project opened in Visual Studio. You can disable the hosting process feature with Project + Properties, Debug, scroll down, "Enable the Visual Studio Hosting process" tick. There's no compelling reason to do so.
There's no need to check these in, Visual Studio re-generates them when you check-in a project and load it in VS. In general, you never need to check anything in from the bin subdirectory, its content is always re-created by building your project.
Everything in the debug (or release) folder is generated. Everything that's generated shouldn't be checked in.
When in doubt, just make a fresh checkout to some other folder (or even machine), and try to build from that. If something is missing, this will find it.
I do not think you should. They are for VS use only.
Here are the files I ignore when creating C# projects. You really only want to store the source code in the repository and not the outputs. Similarly you probably do not want to store the user based information that goes along with VS solutions.
*.csproj.user
*.suo
bin (folder)
obj (folder)

Categories

Resources