Missing namespaces on new Visual Studio extension development installation - c#

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.

Related

Unable to run a MonoGame project on a clean installation of Visual Studio and MonoGame

I recently got a new computer, and finally got around to installing MonoGame, as I worked with it a few months back on my old computer, and primarily use Unity for my game development when not working on 2D games. Their website says they have CLI templates that work with Rider, but I figured it would be best to get it installed with Visual Studio first. Following the exact steps listed on the MonoGame website, I got everything installed that I needed, and started a project from one of the Visual Studio MonoGame templates. Upon opening the project, and everything finishing loading, I am greeted to this miserable sight. I also had an error in the console relating to MonoGame, with the error code MSB3073. From what research I did, I found that it either had to do with my username having a space in it (it clearly does not, so that was out of the picture), or it had to do with using the Visual Studio templates, and I would simply need to create the project from the CLI templates, as seen here. However, creating a new project from the CLI templates does not change anything. I have tried uninstalling and reinstalling dotnet, I have tried uninstalling and reinstalling Visual Studio. I have, of course, powered my computer off and back on multiple times. Even trying to open the project in Rider after installing the proper MonoGame packages in the program has the same exact errors. But when I zipped the project up and sent it to a friend who works with MonoGame, he was able to run the project with no issues, so clearly it has something to do with my setup.
I have also cleaned my nuget cache, cleared my project temp folders, and cleared the visual studio cache. Eventually, the Microsoft dependencies stop having issues when I simply close and open the project again, but every time I open the project in Visual Studio, I get the same error in the console, and it prevents me from running/building the project.
Hoping someone on here will know what to do with the info I've given, as I'm completely out of ideas!
So I figured it out. I'm not very experienced with the command line, but I managed to find a very nice tutorial by someone who wanted to make games with MonoGame using only the command line. In it, I was able to attempt to build the project from the CLI, and it gave me an error message unlike what was in Visual Studio. It said that MonoGame only works on a 64bit OS, but I'm on a 64bit OS. So I went to look at what version of dotnet was being used, and sure enough, it was the 32 bit version! It took a while to figure out how to uninstall it, and how to use the dotnet-core-uninstaller tool in the command line. Then all I had to do was remove the Environment Variable in the System category for the Path variable that referenced the Program Files (x86) directory of dotnet.
Hopefully if anybody else comes across this issue, they'll find this post, as none of the others seemed to fully explain how to do anything that needed to be done to fix the problem :)

Script# - type or namespace name 'ScriptAssemblyAttribute' could not be found

I have a template project that uses Script# (downloaded from here: https://github.com/scottdurow/SparkleXrm). I've built and deployed this many times so not sure if this is an environmental issue or a version issue. I stripped the solution right down to 2 projects - ClientUi (which references Script#) and a CRMPackage where my HTML page is, but when I build I get the error:
The type or namespace name 'ScriptAssemblyAttribute' could not be found
...and I can't get rid of it. I'm on VS 2017, Windows 10, Project version is .net 4.0 (have tried changing it to 4.5, same problem).
Have tried reapplying Script# via NuGet, but it's just not happy with me and keeps throwing the error. Have tried clearing VS cache, cleaning the build and restarting visual studio, standing on my head, drinking wine, nothing seems to work. In fact I think the wine made it worse.
Help.
For future people hitting this, it's a Visual Studio version issue. Preview 2 broke ScriptSharp compilation. It's something to do with a mismatch in mscorlib versions.
https://developercommunity.visualstudio.com/content/problem/138986/1550-preview-2-breaks-scriptsharp-compilation.html
As per the above link, the fix is setting the following flag in the MSBuild project file:
<DisableHandlePackageFileConflicts>true</DisableHandlePackageFileConflicts>

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!

Only c# native classes are recognized

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.

Visual Studio ASP.NET Template Incomplete (MVC)

I got really weird problem. I am starting to learn MVC but my ASP.NET template seems to be incomplete and does not support MVC at all. It doesn't matter which version of .NET Framework I choose. Look:
What is more weird, my ASP.NET MVC 4 Template from previous version of visual studio works fine, without any issues (I can add views, controllers etc). BUT ONLY if I choose .NET Framework lower than 4.5.2.
What I already did:
I tried command: devenv /installvstemplates
I did repair installation of visual studio and its updates
I uninstalled all addons and extensions
What I do not want to do:
I dont want to clean reinstall Visual Studio
What I think I can do to fix this:
copy cache from someone and paste it to my \Common7\IDE, but I do not
have access to working cache files.
I would really appreciate your help guys.
/edit (I am sorry for my mistake with adding answer)
So I tried to fix it as i didn't receive any answer, I tried many things from google results, many pointing to this site but nothing worked.
I uninstalled visual studio, cleaned registry, used /uninstall /force with 2012, 2013 and all updates isos with no luck.
I tried this solution:
Can't create new MVC5 project or any other ASP .NET projects in Visual Studio 2013
but it didn't work either.
Does anyone has any idea? I will give you some reward if your answer help me.
I would really appreciate anything. Point me to some direction.
ONLY MVC 5 doesn't work, no templates are shown (in one asp.net
template) and if I download mvc 5 template from the web, or convert
my existing mvc 4 project to mvc 5 it stops showing "add controller,
add view options"
All MVC 4 projects and templates are working without any issues at all.
/edit 2
=== WORKAROUND ===
If someone tries to resolve this issue, basically I coudn't do it, but I found workaround which is ugly and simple:
Deleted every single extension AND every VS Update
Uninstalled Visual Studio
Uninstalled it again using /force method
Cleared its every trace and the registry traces I was able to found
Used TuneUp utilities to clear broken registry keys
Uninstalled SQL Server 2014
Uninstalled everything that was related to Visual Studio (Web Essentials, .Net Frameworks, Command Tools etc), check in Ccleaner,
it will be much faster.
Installed Visual Studio with Update 3 and... It was broken right after installation, missing files errors
I repaired the installation and everything seemed to work but... localization, language files didn't work, caused visual
studio to
show errors or simply hang.
I tried to reinstall language pack but I received error "this language is already installed". I couldn't uninstall it
either. I finally added language files manually:
in VS folder in Program Files searched for '1033' and 'en' folders
opened my acronis partition backup
added to every directory where one of the two folders was found, folder equivalents of my language '10xx' or 'xx'
WARNING: If you won't do it for EVERY folder, you will get assembly missing error, or your visual studio will have spikes (especially in .aspx files). Don't copy paste it all at once either cuz if you place localization files for assemblies, extensions you don't have, it will cause errors too.
TIP: If you don't have backup, simply take this files from someone else, they should generally work, no matter which update VS of the other person have.
Its unfortunate that no one had better answer for me but I do hope that this will at least help guys in similar situation.

Categories

Resources