We moved our projects (SQL Server and .Net) from Visual-Source-Safe to SubVersion.
We have installed Tortoise SVN and AnkhSVN clients on the location machine.
When I lock a file, the icon in Windows Explorer changes, but there is no indication in Visual Studio of any lock.
Visual-Studio
Windows Explorer
How do I fix this?
I figured it out!
I had added the Solution to SVN but not added the projects to SVN.
Funnily enough, when you add a Solution to SVN, it adds all the files to SVN, but it does not modify the project to manage them via SVN as well - this is a step you have to do manually.
Then the icons show up!
Make sure you have AnkhSVN as your currently selected source control plugin.
Tools -> Options -> Source Control.
add svn:needs-lock property in locked file to let AnkhSVN show file locked in Visual Studio, see:
http://ankhsvntips.net/post/2378796136/auto-locking-files
Related
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 :)
I made the mistake of changing a subroutine in a project and publishing it. Now I want to revert back to the older subroutine. Is it possible to find the older project and retrieve the older subroutine?
Team Foundation Server can do this for you. You can now be set up without any hassle on your developement machine. The integration in the VS Team Explorer is seamless. Very easy to handle. See this guide for working with source control projects
https://msdn.microsoft.com/en-us/library/ms181384.aspx
Even easier and not so much overhead on your machine: sign up for Visual Studio Online (free for a 5 user team). The cloud source control is set up in minutes. If you are not against saving your data in the cloud give it a try.
https://www.visualstudio.com/en-us/products/what-is-visual-studio-online-vs.aspx
The alternatives (SVN, GIT) are also very good (consider reading about the difference of central and decentral source control) but need a little more knowledge and a good workflow.
If you happen to have lost changes before installing version control there's nothing you can do in visual studio. You can try a restore on file level (the option would be previous versions in the windows explorer)
as source code is plain text. There`s a "previous version" mechanism of windows explorer! Just go to the properties of your project folder
Note: previous version / shadow copying must have been enabled before or else the tab will be blank.
No, it is not possible unless you have stored your code in source control. It sounds like you have not yet done this, so I suggest using this is a (harsh) lesson and make the next move the one to install some kind of SCM.
You can signup for a free version of TFS online from microsoft the will integrate directly into Visual Studio. That will allow you to instantly check in changes and view the history of files and in this case, get a previous version of a file.
https://www.visualstudio.com/en-us/products/what-is-visual-studio-online-vs.aspx
I just noticed the files I created (.cs, .xaml, etc) are not added to Git, so my commits+push wont upload them to the repository. I know I can go to the terminal and do git add path/to/file but I want to know how can I do this from within Visual Studio.
I tried right-click the file and search for Add to source control but the option is not listed. What do I do?
I already looked it up but every Microsoft documentation is for Team Foundation and it doesn't work for me
Make sure Microsoft Git Provider is selected as your Source Control plugin (assuming Visual Studio 2013):
In Visual Studio, on the Tools menu, click Options.
In the Options dialog box, click Source Control, then click Plug-in Selection.
Select the source control plug-in that you want to use (Microsoft Git Provider).
Click OK.
Locks should appear next to your files (assuming your project is a git repository), and you should be able to add your files.
Reference: https://msdn.microsoft.com/en-us/library/axafab5c(v=vs.90).aspx
Edit: Since you already have your plugin set correctly, you likely just need to perform a commit. I don't believe Visual Studio has a seperate interface for staging changes; when you go to commit, it should list your new files as "Included Changes", and the file should have a green plus next to it in the Solution Explorer.
Any files that aren't being committed should be listed under Excluded Changes or Untracked Files below that. You can add individual files to the commit from here.
If your file is missing the green plus, I'd check your .gitignore file to ensure it's not being ignored.
I am downloading a sample program for a barcode reader that I am using. Everytime I download the program and run it I am prompted with the error in my solution explorer (see image below).
Any suggestions? Everytime I right click and reload project, it reloads quickly and then reverts back to unavailable.
Suggestions?
EDIT: Here is the link to the project (scroll to the bottom, PC Sample Program)
http://www.barcodereader.com/download/connections.php
CS Project File Example
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SrEthernetSample",
"SrEthernetSample\SrEthernetSample.csproj", "{7A2F3660-184B-4553-ADEF-3071D718A501}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7A2F3660-184B-4553-ADEF-3071D718A501}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7A2F3660-184B-4553-ADEF-3071D718A501}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7A2F3660-184B-4553-ADEF-3071D718A501}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7A2F3660-184B-4553-ADEF-3071D718A501}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
I faced this problem recently. The procedure below worked for my solution:
Right click the project which is not loading, in VS Solution Explorer
Click on Remove and confirm the removing process
Right click the Solution and select Add > Existing Project
Browse to the .csproj file in the project folder
If the above procedure does not work, then check the .NET targeted framework.
May be Framework Incompatibility must be also one reason of the problem
If it shows error while you perform above steps then please check this
You do not have permission to access the IIS configuration file - Web app error
I was having the same problem on VS 2017 CE.
I opened a .sln and the solution was empty (unavailable).
This solved my problem:
open the .sln file in VS
right click on the project name (unavailable) in the solution explorer
click on "install missing..." (i don't remember the exact text)
Have you tried re-adding the project to the solution from within VS? That can fix an invalid path
Right-clicking the solution and selecting (Open with VS 2013), seems to have fixed it.
Thanks all
I had the same issue with VS 2013. Start Visual studio as administrator. Then open the project. Job done.
The most probably reason of not loading the solution may be because of the version incompatibility of the version of vs you are using and the one by which the solution(you are trying to load) was built.
For example - You may be using the VS 2013
And the solution was built using VS 2005.
The solution is creating new empty solution and adding all the files you downloaded to load it successfully.
Had similar problem with causing solution explorer to indicate file "unavailable".
Performed same fix as suggested above i.e. right clicked on file and selected reload. Got another message that in order run in Universal window had to install what was being offered which I did and everything working fine now.
Happened to me when I attempted to load a solution that contained projects that were built with a newer version of Visual Studio 2010 and slightly newer .NET Framework. In other words even though both Visual Studios were 2010 SP1, the original had all of the most recent VS patches applied, where the one I was trying to open did not. Set Windows Update to make sure to check for updates for other Microsoft Products, and apply all Visual Studio patches and Framework updates making it current. Reopen.
I had fixed this issue by run visual studio as administrator mode
Right click on the project and select reload project.
In my case , i am working on a xamarin forms application using visual studio 2015.
The project was not loaded initially and 2-3 times i close my IDE and later i did the above trick.
This works for me.
Sometimes Windows getting confused.
You should try:
Open C:/Users/[$username(change with yours)]/AppData/ directory.
And try to open Roaming folder.
If asks open as administrator, click Ok.
Had the same issue after making some changes to .csproj.
My .csproj was configured to use IIS which wan't installed.
Make sure that your .csproj doesn't contain bad parameters/non-extisting references/urls.
Mine did the same thing. I thought it was my hard drive, but one time I tried to load the program it didn't work. I left clicked my project and reloaded it. It asked me to install updates. I installed them and tried it again. It didn't work off the bat. I reloaded the project again and it worked!!!
I got this error when I open a project targeted on Windows 10.0.10240, I solved this by right click the project in the solution explorer and then choose Reload project.
I remove project by right click on the project and click remove. Then right click on the solution and add existing project you removed. If this didn't work then before adding the existing project delete csproj.user file and then add.
I had this problem after I was messing with NuGet packages. I was able to fix it by deleting the packages folder in my solution folder.
I'm getting this in a Single Page Application Web project. It was because I had the project setup to use IIS (not express).
Visual Studio needs to be opened using the right click on Visual Studio and choose Run as Administrator.
Hope this helps someone to save time.
I had the same issue and fixed it by opening the project in Administrator mode in the latest version of VS 2017. The solution was originally in 2010, but when I opened it in 2017 and reloaded it the projects loaded correctly and no incorrect information was posted in the output window.
if you opened the project in another version of Visual Studio and you see a message that the framework is different and closed the dialog will appear like this.
In the project solution, click right and then update.
Then the same window will appear again of version this framework and you can choose to use the recommended one if you do not want to download the framework version.
Close and open project again (optional)
You can see all the project folders again.
First, create a blank solution with the same name as your project.
On the File menu, select New and then click Project.
In the Project types pane, select Other Project Types and then select Visual Studio Solutions.
In the Templates pane, select Blank Solution.
Enter a name for the project (same as failing to load solution).
To change the location of the solution directory, choose Browse and specify a new location.
Select Add to Source Control if you want to add the solution to a source control database or repository.
Click OK.
After creating an empty solution, move your project folder to the same folder as your solution's folder.
Add your project to the new solution.
I must have done something wrong. I have a C# project in Visual Studio 2008. All of a sudden I see a lock on my classes and when I hover the class names on the top tab I see the class name as : C:\Myprojects\Oder.cs[Read Only] !
Has something weird like that happened to you before?
In my case it was a ReSharper 9.0/9.1 related issue. After clearing the ReSharper cache, I was able to edit files in my solution again.
Clearing the ReSharper cache can be done here: ReSharper -> Options -> Environment -> General and click: Clear Caches and restart your visual studio.
(The image is contained within the first of the linked JetBrains articles).
JetBrains instructions:
Ultimate Guide to Speeding Up ReSharper (and Visual Studio) - Performance degradation after ReSharper upgrade
ReSharper Online Documentation
A couple of possibilities spring to mind:
Have you added the project to source control?
Have you marked the project folder (and all it's sub folders) as read only?
Of course, someone else may have done either of these things if they have had access to your machine.
One Possible stupid thing.
Your project is still running and you forgot that. Stop debugging (CTRL + F5)
How do I know. Guess..
Restarting my computer worked for me. My project became read only in between compiles - suddenly I couldn't save changes to files, Visual Studio started presenting me with 'save as' dialog boxes, and SVN couldn't commit or clean the project because "sqlite could not write to readonly database." Checking the file properties on the files in Windows Explorer showed that none of them were marked read-only. I was able to make a backup copy of the project, then I restarted and it was fine.
Restart your Visual Studio and add the project again. Worked for me.
Close, then reopen the file.
Still a pain, but at least it's less costly than completely closing visual studio.
You can try: file -> Source Control -> Go online
IDE-integrated source control?
Sounds like your source files are or have been under source control. Many source control systems will set files to read-only when they haven't been checked out for editing.
Total Commander makes it really easy to change file attributes recursively, but most likely Windows can also do this :)
Much in line with what Morten Mertner said, (if you by chance are using TFS Source Control like I am) I did a manual checkout of the file and it resolved the issue for me.
For me the problem is that the files are locked while the application is running.
In this state, Visual Studio 2013 displays the lock icon in the file tab and when you try to edit the file, a dialog box with this message appears:
Changes are not allowed for this module as it was not built for changes while debugging or the target .NET runtime version does not support it.
In Visual Studio 2015 as well, the lock icon appears in the file tab when the application is running. but the dialog box and message are not displayed.
Stopping the application causes the file to become unlocked.