I'm wondering why my Visual Studio missing "Remove unused references" on right click menu project and references both.
Please Don't tell me try Migrate packages.config to PackageReference, I just did it, but nothing change.
First of all you need to have an SDK style csproj like it is said here.
Example:
<Project Sdk="Microsoft.NET.Sdk"/>
Second, you must have it enabled like #Stan1k mentioned in his answer:
Microsoft says that the feature is off by default. You need to enable it from Tools > Options > Text Editor > C# > Advanced tab > Show "Remove Unused References" command in Solution Explorer (experimental).
And finally make sure you you run dotnet restore in the project console and build the projects (this was the issue for my why it was not showing).
Do you have an older Visual Studio Version? This Feature got released with Version 16.10.
Also notice this statement from the article
Microsoft says that the feature is off by default. You need to enable it from Tools > Options > Text Editor > C# > Advanced tab.
The option appears in Options>C#>Advanced and is on. When you right click on project the option does not appear making me think all references are being used. Perhaps depends on the project.
This utility was available for VB projects up until around VS2015 I think, maybe VS2013, then it got removed or limited for some reason. I've never seen it available in C# projects. And now it's not even available for VB unless your have an SDK project type. It's a bit ridiculous because often downgrading a NuGet package (eg RestSharp) will leave a load of "reference rubble" which you have to (carefully) clean up.
As an aside, whenever I install a new version of VS, it seems that much of their effort goes into UI look and feel rather than actual functionality improvements. Quite frustrating.
Related
I'm trying to build the minimal wxWidgets sample on Windows, using Visual Studio 2019 Commmunity Edition, following the instructions from this page for using wxwidget binaries
I opened the "minimal_vc9.vcxproj" file in Visual Studio. Visual Studio upgrades the project file.
I then added the wxwidgets.props property file to the property manager, and then tried to build ( Build | Build Solution )
It fails with the following error:
1>C:\Users\Administrator\Desktop\wxwidgets\include\wx\msw\chkconf.h(91,1):
fatal error C1189: #error: "wxUSE_UNICODE_MSLU must be defined."
I am trying to help a friend who knows C++ and uses Windows to set this up, but am not sure how to do so. Note both he and I are new to using Visual Studio as well, and I can't find any references on how to fix this by Googling.
Note I am using the project file that came with minimal (no solution file was there), and can see that in it's configuration that it says "Use Unicode Character Set" at `Project | Properties | Character Set"
EDIT: I'm attaching a picture of the IDE/files we downloaded, which I believe are the 3.1.5 version, ie release version as of Dec 4, 2021?
It looks like you're using wxWidgets 3.0, as support for MSLU was removed since v3.1.0 ~8 years ago. Please download 3.1.5 binaries and open minimal.vcxproj project file to build the sample, there is really no reason to use a 10 year old version if you're starting developing with wx.
Also, completely unrelated, but it's considered to be a bad idea to use administrator account for development. wxWidgets certainly doesn't require any special rights.
I
It is very easy to build the library yourself.
Download the source code archive and unpack it in, e.g. c:\wxWidgets
Start msvc, do ^File->Open", navigate to c:\wxWidgets\build\msw and open the file wx_vc15.sln
Select "Build->Batch Build...", click "Select All", then "Build".
When the build is finished successfully, open c:\wxWidgets\samples\minimal\minimal_vc9.sln, let msvc convert it and choose " Build->Build Solution".
Then when everything is ready, create a project as "desktop application", apply the properties file and start coding.
Thank you.
I'm trying to learn Fsharp.data with the example of JsonProvider, but I can not understand why I'm still running the program while compiling the error.
You may have clicked "Yes" when VS asked you if it should run the last successful build when compilation fails.
See here for how to change the setting.
There are plenty of issues like this with F# in Visual Studio, but the situation also improves all the time in VS 2017. I believe one possible workaround for this particular issue is to restart VS.
But there is also another way, which works better to avoid an inconsistent Error list pane in general. Change from "Build + Intellisense" to just "Build" in the dropdown in the Error list pane, and see how that works for you. It means you have to compile to refresh the Error list pane, but you still get (sometimes inconsistent) Intellisense help in the editor panes without having to recompile.
If you want to know more about F# issues in VS, this is where to look:
https://github.com/Microsoft/visualfsharp
I recently updated to Android Studio 3.0 and noticed that when I for example add any android:id, or create new drawable, or basically any resource, Android Studio does not update it in project until I build application. Every resource I create in xml, in class is marked as red and standard "Cannot resolve symbol ..." is shown. But surprisingly if you try to go to declaration, it correctly goes to the resource. Is there any option for this not to happen?
It's very irritating.
Edit:
It's still occuring sometimes, but I just got used to it. If someone fixed it I will be thankful for your answer.
I resolved this problem in this way:
Navigate to Android Studio Settings - Build,Execution,Deployment - Gradle
Choose "Use local gradle distribution" and "Offline work", click "Apply"
At last you'll find it's ok, and at this time you can also choose back to "use default gradle wrapper", it's normal
A workaround:
File > Invalidate Caches / Restart > Invalidate and Restart
I copied my grails app to another computer and now .gsp files do not open in the editor. They also show a G icon with an arrow next to them. Dragging and dropping or double clicking do nothing. Updating intellij didn't help either
As Dónal mentioned, Grails is not one of the frameworks supported by IntelliJ IDEA Community Edition (you need the Ultimate Edition). You can view the feature comparison here.
Hi I am probably answering now when u no longer need the answer but I bumped into the same issue yesterday and only solved it now. There are chances that you associated the .gsp file type with a program which cannot be opened by intellij in your case GOSU. To fix it go to: File>Settings>Editor>File Types
In the file types go to Gosu Program Source and *.gsp should be in the registered patterns. Remove it and apply changes then you are good to go.
Re-installing community version fixed and gsp files now open in the editor
Is there an easy way to step through the MVC 4 source from within my solution?
I found this question but the solution requires building the MVC 4 assembly from source. I would think a symbol look up from a server would be preferable but have not been able to make this happen.
Ideas?
Add the following symbol servers to your Visual Studio and you are good to go:
http://referencesource.microsoft.com/symbols
http://srv.symbolsource.org/pdb/Public
http://srv.symbolsource.org/pdb/MyGet
http://msdl.microsoft.com/download/symbols
Here's how mine look like:
Also you need to configure your debugger to use them:
Tools -> Options -> Debugger -> General.
Uncheck "Enable Just My Code (Managed only)"
Check "Enable .NET Framework source stepping"
Check "Enable source server support"
Uncheck "Require source files to exactly match the original version"
Oh and of course don't forget to revert those settings back when you no longer need to debug in .NET sources or otherwise debugging might become a painfully slow experience for you.