I tried to open up one of my older projects (from about 8 months ago) and I can't open up the designer view for any of my windows. I think this probably has something to do with the fact that I used Jetbrains Rider instead of visual studio back then. Right now my solution explorer looks like this:
Is there any way to fix this or do I just have to recreate the whole project in VS and paste all of the code over
Nevermind, I feel kind of stupid. I opened the solution as a folder instead of as a project. Opening as a project fixed my problem
Related
I have been searching for a solution to this for the last 3 days. Please help.
I have tried opening my solution in VS 2015,17 and 19 and whenever I try to go to my namespace I get the error
"cannot navigate to the symbol under the caret"
None of these have helped me.
Failed : VS2019 ASP.NET MVC "Cannot navigate to the symbol under caret"
Failed : https://developercommunity.visualstudio.com/content/problem/505489/cannot-navigate-to-the-symbol-under-the-caret-3.html
I have also deleted my .vs folder, didn't work, someone also said delete your .user folder. But there isn't a .user folder in my project.
I also searched for the dot net compilers and found an update but the update made no difference.
It's only on my visual studio. Other people are not having this issue.
I had a similar problem some time ago, and the solution was to create a solution in visual studio with a new MVC project, and then add the source code files to the new project.
So Installing Resharper fixed my problem after I reloaded the solution in my Visual studio with Resharper installed.
https://www.jetbrains.com/resharper/
I used the trial version.
Note: It took a second to load though so make sure resharper has analyzed your files. You should see a progress bar at the bottom right of your Visual Studio when you restart your Visual Studio and open your solution.
Closed Visual Studio, then deleted ".vs" folder in the solution folder
I have a problem. The problem is, that when i make a second form inside of my project in Visual Studio 2017, the content from Form 1 will be in the 2nd form, interactible on build, but not movable or deletable in the editor. I don't know what to do to fix this.
If you know a way to fix this, let me know please. It really helps me out with stuff like this.
This is a bug of Visual Studio.
You should try cleaning the solution (from here:
In Solution Explorer, choose or open the solution.
On the menu bar, choose Build and then choose Clean Solution to delete any intermediate and output files. With only the project and component files left, new instances of the intermediate and output files can then be built.
Ok, sounds painful right? Here's the deal:
I can no long drag anything into the solution window of VS2017. I Have to put the files in the project folder physically then select ADD->EXISTING to get them into the solution. This is very odd. I Don't know when this stopped work (or actually if it ever did since I just install the 2017 version). Can anyone enlighten me to a solution to fix this? No, I was not debugging at the time. I just doesn't work.
Thanks!
I'm getting the following error
Could not find type 'My.Special.UserControl'. Please make sure that the assembly that contains this type is referenced. If this type is a part of your development project, make sure that the project has been successfully built using settings for your current platform or Any CPU.
But what doesn't make any sense is that My.Special.UserControl is in the same assembly as the form. What's more, if I view code on the Designer.cs file, There are references to My.Special.UserControl that seem to be fine. The assembly builds fine, and runs fine as well. It's the just the designer that's having issues.
As such we have to do all our design work by making adjustments to the Designer.cs file by hand. How can I make the designer work again?
The following procedure has worked for me:
Delete the /bin and /obj folders in your source code directory.
Restart VS (be sure the offending Form Designer is closed)
Compile
Open the Form in Designer again. The problem should be resolved.
I'm sure deleting both /bin and /obj are not necessary, but I haven't been able to reproduce the error and come to a more specific solution. (My projects are typically small enough that re-compiling the whole thing is no big deal.)
Usually, this error seems to occur after refactoring / renaming objects of the offending class. So my guess is that there is a VS bug that doesn't recompile the appropriate object file after a User Control or Custom Control is refactored.
Change the project type temporarily to x86, compile and open the Designer. Visual Studio is a 32 bit application.
There is propably an exception happening in the Load or Initialize Part of your Form / UserControl. Can you try to comment out any code there and retry opening in designer?
You can use another instance of Visual Studio to attach a debugger to your Visual Studio instance not letting you open the Form. Once an exception occurs you will be able to pinpoint the location where something goes wrong.
I had similar problem when shifted from VS 2017 community edition to professional.
Close VS
Go to Project folder
Delete .vs folder. Back up if you need.
Start VS
This should solve the problem
I have experienced the exact same problem. I am fairly certain that it is connected to the platform target x64. Here is a related post mentioning it as a bug in Visual Studio:
https://stackoverflow.com/a/11582828/7665665
How I deal with it: Although my solution is actually only x64, I have created another platform target x86 for the projects just to be able to use the designer. Now I switch the target to x86 in order to see my controls in VS Designer. For everything else, I switch back to x64.
I had the same problem with a user control which was derived from the standard .NET control within my form.cs. Nothing of the above worked for me (my solution is compiled as x64 because of other unmanaged components which only support x64).
I finally ended up with creating a separate project "Utils" and moving the offending derived controls to this project. This worked like a charm !
In my case I just unload project and reload again
Switching the project target to x86 was the only possible solution for me
This happened to me today. Cleaning, Rebuilding, restarting Vs and even rebooting did not help. Everything ran as expected, the only thing that would not work was the designer in VS.
In my case, since nothing lese worked, I went to designer file, removed the faulty control and then added a new one. Renamed, re-assigned event listeners and it worked.
Designer now works, but if this must be some kind of VS bug, I don't know.
This is not the answer I'd like to read when coming to SO, but I'll post it in case it helps anyone later.
For me, I deleted the .resx file for the form, and it built and showed up in the designer, no problem. Go figure....
I had a similar experience when I sub-classed DataGridView. The following procedure has worked for me:
Close the Form Designer tab
Close VS (2015)
Delete the /bin and /obj folders of the project
Restart VS
Rebuild the solution
I don't know which steps could be skipped as I have not taken the time to refine the process.
On my project, it only worked if I made the custom user control in a separate project in the solution:
Add new project "Class Library (.NET Framework)"
Add references to System.Windows.Forms & System.Drawing
Add the source of the new user control in the new project
Build the solution
Open the designer
Drag the new user control in the form
In my case the designer automatically added a reference to the new project when I dragged the custom user control in my form.
Hope this help others who stumble upon this question.
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.