Only c# native classes are recognized - c#

I migrated a silverlight 5 project from vs2013 to 2015 (both professionnal edition).
This is not even a real migration, because there is nothing to change in the code, or configuration, and Visual Studio say nothing when opening the project with 2015 instead of 2013.
The weird thing is, in VS 2015, my classes are not recognized in the code, and so, I cannot use completion.
As you can see in the code below, the word RivoliView is still black, because it is not recognized like DemView. The consequences are, I cannot use adresseBDUChild and access it's properties, while RivoliView is in the same namespace and a public page (the same way that DemView 'public partial class), and therefore, should berecognized.
In fact, all the classes that are not c# native (by native I mean like int, string List<T>, Boolean) are not recognized there, whle it was in studio 2013.
I cannot access properties from my classes, cannot have autocompletion.
What happened?
The project compile perfectly, and work perfectly when running in debug in the browser. It works excalty the same way it was in vs2013. But the problem here seems to come from visual studio.
I tried to get the project directly from Team Foundation server. Nothing.
Tried clean, rebuild, build, deleting .pdb files etc... No errors, but change Nothing. It always run as it should, without probems. Still not recognized.
Is it a vs2015 configuration problem?
The namespaces are well defined, and used in the page. This is weird since the same code recognized this classes in visual studio 2013.
Any idea?
I hope my question contains all useful details that I thinked about. If I forgot, tell me how I can be more specific.
Edit : still searching, and got no clue. I think I will go back in 2013 if I can't find an answer.
Now I also tried :
EDIT > IntelliSense > Refresh Remote References
removing and re-adding project references, such as Microsoft.CSharp.
Adding and removing the project from solution.
Creating new solution and then add the projects.
Thank you.

Try to refresh IntelliSense cache
EDIT > IntelliSense > Refresh Local Cache
and/or
EDIT > IntelliSense > Refresh Remote References

It sounds funny, but you might want to try removing and re-adding project references, such as Microsoft.CSharp.
That can often give VS2015 the kick it needs to re-analyse the project.
Edit:
When I say remove and re-adding, I mean via References under the Solution explorer.
Open references, right click on Microsoft.CSharp, and choose remove.
Add a new reference, go to Framework and find Microsoft.CSharp and add it.
It seems to make a difference for me when I do this manually without using Resharper or Visual Studio to resolve the reference for me.

Related

Missing namespaces on new Visual Studio extension development installation

I need to change an existing Visual Studio 2017 extension development project. This project has everything set up just fine. However in three different computers I tried to install the necessary frameworks to build it as is and in only one of them I actually worked without issues.
I go to my Visual Studio installer and modify it by adding the workload for "Visual Studio extension development", I then open up the project and noticed a bunch of compile errors due to missing namespaces. I thought that maybe the references weren't set up properly so I went looking for what I need to add. However I can't find neither online or by browsing the libraries already in the system the ones I'm supposed to add. Even weirder is that I tried doing this in three different computers an in one of them it worked correctly without ever changing anything.
The following image is just an example of the libraries I'm missing:
I can't figure out for the life of me what am I missing here, supposedly these should be in the Visual Studio SDK that is installed with Visual Studio installer yet my system can't find it? I tried adding more workloads and components, tried uninstalling and installing again and nothing works and I can't find a single search result with this problem. Why would this work once out of three times with the exact same steps?
#magicandre1981 pretty much solved it for me. Installing that microsoft.visualstudio.editor nuget package installed almost all other dependencies as well with only other two missing that I found the reference online.
Since I actually tried it before with no success I now believe the reason that it was not working before was due to not picking the correct version like magicandre mentioned.

Intellisense not working for unit test project in Visual Studio Professional 2017

I'm working on a Visual Studio solution using Visual Studio Professional 2017, the solution consists of four types of projects:
Several C++ projects
A C# project
Several C++ unit test projects
A C# unit test project
IntelliSense seems to be working for all, except for (at least) one of the C++ unit test projects, and it goes even further: for some tests inside that particular C++ unit test project, IntelliSense is working, but for some other, it isn't.
As mentioned in other Stackoverflow posts, I've already removed the *.cache files and there are no *.ncb files (so I can't remove them :-) ).
I also consulted the MSDN website, as proposed by Visual Studio:
Intellisense: 'No additional information available' (See 'Troubleshooting Intellisense in C++ Projects' for further help.)
I typed the mentioned sentence in MSDN search (learn.microsoft.com), and I got 229 results, which looked useless, and I got 0 results while searching for the exact phrase. :-(
Another approach : in my Visual Studio settings, I've maximised the messages, sent to the output window, I've rebuilt the whole solution, and afterwards I looked for the word IntelliSense in the output window. There was nothing. Then I typed something in order to launch IntelliSense, I verified the output window, but nothing was added.
In order to solve this problem, I need detailed information about IntelliSense itself:
I believe that IntelliSense is based on some files. Which ones?
I also believe that IntelliSense is keeping its own information in memory. Is this correct, is there a way to store this memory mapped information in files? If yes, which ones, and how can I force IntelliSense to refresh its information?
Whatever IntelliSense is doing (filling its information in memory, saving it in files, retrieving its information from those files, ...), what can I do in order to log those actions, so that I have an idea what might be going wrong?
In other words, does anybody have background information on the IntelliSense background task, which might explain what's going wrong, and how I can derive (from information in output window or other) what to do?
Thanks in advance
You can try resetting Visual Studio once
Devenv /ResetSettings
Sometimes Visual Studio has these gnawing bugs that just stresses you out for no reason.
Remove the hidden .vs folder from your solution. That would trigger index rebuilding.
Also you can try to install recent update for Visual Studio 2017, they seem to work actively on improving the indexing.

Visual Studio error when I right click UWP project not finding framework

I am having the exact same issue/error as this post from yesterday. Similar SO Post
SIDE NOTE...As you can see, I am new and therefore, only have 45 reputation. As such, I could not simply add a comment to the above existing post and had to create a whole new post even though they are the same issue....seems silly. But I digress....
I wanted to provide additional comments in the hopes to get an answer. My issue started suddenly the a few days ago. I made no major changes to references, VS updates, etc... However, when I right click my csproj in visual studio, I get the error and I have to click it five times before it goes away, at which point I finally get the menu.
Again, I have made no major changes BUT I went ahead and confirmed that:
My target version and Min version is Windows 10(10.0; Build 10586). That is the SDK version that I have installed and am using.
I verified that my NuGet updates are complete and that my Microsoft.NetCore.UniversalWindowsPlatform are installed and update to date (5.2.2 as of now).
I do have a reference also to "Universal Windows". This was created automatically when I created my project and I cannot remove this reference but it is there. When I select it, I do see that it is "UAP,Version=10.0.10586.0" so this should be good. I do notice a possible issue here. Again, this reference was created for me and I cannot remove or change it. However, it is pointed to a folder named
C:\Program Files(x86)\Windows Kits\10\References\Windows.ApplicationModel.Calls.CallsVoipContract\1.0.0.0\
Why did the Windows Universal reference default to that folder and only that folder? I am not using VoIP so I wonder why it chose this one? Also, what if I need some of the other references in the References folder?
I created a brand new Windows Universal project and the same error happens on a fresh project.
Please help, it is annoying. Project still seems to build and work fine though.
Thanks!
I found the issue in my case, it was an extension that I added on to Visual Studio provided by SyncFusion (which their installer actually creates 7 or se extensions in Visual Studio). After troubleshooting my issue and doing some of the same things to resolve (repairing .Net, SDK, Visual Studio) I then thought about the error a bit more. While it is cryptic (and has poor english "An Exception has been occured") these are all clues that it could be any of the frameworks that I have installed via extensions as well.
I also had another clue, the issue started happening a few weeks ago, around the time I updated my SyncFusion controls to the latest version.
So, I went to Tools > Extensions and Updates. I went to Installed > All and found all of the SyncFusion items (there are several) and disabled them all. After I disabled them, and restarted Visual Studio, the problem went away!!!
This is a workaround for now. In the meantime, I put in a support ticket with SyncFusion on the issue. I will certainly update this thread when I get a response from them. Also in the meantime, I then went back and re-enabled each of them again, one at a time, to see who the real culprit was. In my case it was the SyncFusion Web Conversion and Migration extension.
If any of you are not using SyncFusion but having odd Visual Studio issues such as this, I suggest doing something similar by going through your extensions and disable any that you added on, starting with the most recent add ons, especially if they were added around the same time you started having the problem until you find the culprit.
Hope this helps!

Visual studio cannot find my referenced DLL's namespace

This is a very frustrating problem. All of a sudden I cannot use referenced DLLs. I added an assembly reference to a project in the same solution and the namespace is unrecognised. I can even see the reference in the object viewer. I've also changed the projects to .NET 4 and 3.5 without the client profile to no avail.
Based on your screenshot, you have references to the same "ServerLibrary" DLL in multiple projects, however, it looks like one referenced version is compiled in .NET 3.5 and the other referenced version (the project reference it appears), is compiled in .NET 4. Make sure all projects point to the same version of the DLL and recompile all. That should fix your problem.
I faced this problem, and I solved it by closing visual studio, reopening visual studio, cleaning and rebuilding the solution. This worked for me. On some other posts, I have read the replies and most of users solved the problem by following this way.
I removed DLL name and namespace from the path where I was using it. And for some wierd reason it worked.
Make sure that the classes are public classes too. I had this issue when I couldn't find my model classes. Silly mistake but frustrating when unnoticed.
This is mostly cause becauese of using diffrent version of same packages at diffrent projects at same solution. I recommend to update all packages to lastest version at all projects.
Right click to project that has downgrade packages --> manage nuget
packages --> click the updates tab --> check the 'select all packages' checkbox -->
click the update
Do this for all prjects at solution.
I had this problem using Visual Studio 2019 with Resharper. I resolved it by clearing the Resharper cache.
Extensions\Resharper\Options
General Page
"Clear caches" button.
After clicking "Clear caches", I restarted Visual Studio and did a Clean/Rebuild.
VS2019 July 2022: I had to deal with same issue for more than a day.
The comment by JaredPar helped to resolve it :"most likely cause of
this problem is the referenced DLL is itself invalid. Have you tried
loading it in reflector to see if it contains members? –
So If you reference an assembly and IT DOES NOT CONTAIN at least ONE public type(Class, Property ,Enum, .. etc) still it does not show after the using keyword. This behavior makes 100% sense, because what is the point of referencing something which is useless?
However Microsoft could easily have added a Message/Warning in VS to make the life of the developer less Miserable.
Something like "Warning: Reference ABC does not contain any public members"`

Visual Studio 2010 issue with a class that doesn't compile

I have a Visual Studio 2010 C# webforms solution with various projects in it. There is a certain class in one of them that acts strangely. If I open some code in another project and then use the "go to declaration" command to get to the class in question, Visual Studio shows me meta data from the DLL instead. However, if I do the same for another class in the same project (while still using "go to declaration" from another project), I get to the actual code just fine.
Same thing happens when I try to compile. I alter code in this class to no avail, Visual Studio simply doesn't compile the changes. Again only for this one class, all the rest seems to work just fine.
Using "go to declaration" from inside the same project works.
I believe this was caused by our upgrading the solution from .net 3.5 to 4 recently, which brought about a variety of issues that we were able to fix though. This particular issue only seems to exist on my own machine currently, as the code in question is still in development and not checked in yet.
I don't think it matters, but for the sake of completeness: the class in question is an interface.
I've tried "clean solution" and deleted a variety of Visual Studio cache files, nothing seems to have helped so far. Any possible solutions very welcome.
It might be a problem with your references - it may be referencing the compiled assembly instead of the project.
Try deleting each reference to that assembly and add them back in as project references.

Categories

Resources