Visual Studio 2022 (fresh install). Using the latest WTelegramClient version: Builds just fine in both net5.0 / netstandard2.0 in debug and release mode. Tested the dll (great work!) and working very good.
Looking for hours why I don't get intellisense to work with the assembly. Intellisense is working perfectly for other assemblies, for system syntaxes, just not this one.
Imported the WTelegramClient.dll file in the project dependencies,
Added the Using TL declaration,
Even tried coding under TL and also WTelegram namespace.
Is there anything I'm missing? anything special to do when building the dll? I feel I'm coding naked without the developer's comments now that I would like to use it =( Thanks!
Related
I have a project which uses CsvHelper. This was developed on a computer with Visual Studio 2019 as a .Net Core 3.1 Console app. I have moved the code to a computer that only has Visual Studio 2017. The Framework version was changed back to 2.1 since that was all that is available without installing additional frameworks and shouldn't be an issue. (I have also tried a .Net Framework console app targeting 4.6.1 with similar results).
My previously working code no longer compiles with a CS 1545 error (this is from one of my MANY test cases but it is the same error):
Error CS1545 Property, indexer, or event 'CsvConfiguration.Delimiter'
is not supported by the language; try directly calling accessor
methods 'CsvConfiguration.get_Delimiter()' or
'CsvConfiguration.set_Delimiter(?)' ConsoleApp3 C:\Programming\ConsoleApp3\ConsoleApp3\Program.cs 16 Active
As noted above, the Framework version was set back to 2.1. I have also tried changing the LangVersion (various values including 7.0, latest, and 7.3) in the *.csproj since the error specifically refers to the language. I have also changed the Framework and LangVersion on the 2019 PC (to match the 2017 PC), and it compiles and runs fine. The code was originally written against CsvHelper version 21.3.0 and I have reverted back to that version, flushed the Nuget cache, deleted the bin and obj folders, and cleaned the solution (and all of those before starting with a new console app).
I'm tagging CsvHelper because that is what I am using, but I honestly don't think that is the culprit. I suspect there is an issue with Visual Studio / Nuget. Searching for CS1545 does not yield anything promising.
[UPDATE] - It looks like changing back to version 19.0.0 fixes the issue, so something broke after that. Maybe I was too willing to throw VS / Nuget under the bus.
I am using vscode to edit unity scripts, I've added Mirror for needs, which extends its own namespace, but the problem is that omnisharp can't find it's namespace. All Mirror's files are under Assets/Thirdparty/Mirror
Everything works in terms of compiling and the result, but I have no idea how omnisharp works and how to configure it.
Below you can see waving lines at everything that is extended by the namespace.
Sometimes I have that too, especially when I just updated VS Code or added a package in Unity. And sometimes this helps:
Press the Regenerate project files button in Project Preferences.
For me installing .NET Framework 4.7.1 Developer Pack fixed the problem.
For my master thesis I'm building a Visual Studio plugin that should perform some code-analysis of the current opened solution.
In order to do that I've decided to try to use Roslyn, using the corresponding nuget package.
Everything works fine (SyntaxTree for navigating the code,...) until I've tried to use MSBuildWorkspace.Create().
This last call causes the following exception:
Could not load file or assembly 'Microsoft.Build, Version=14.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its
dependencies. The system cannot find the file
specified.":"Microsoft.Build, Version=14.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a
I found this two posts:
Creating new Microsoft.CodeAnalysis.CustomWorkspace - got ReflectionTypeLoadException
MSBuildWorkspace.Create() throws exception
from which I understand that I need the MSBuild Tools for Visual Studio 14, which is in the related iso.
I do not want to install the full Visual Studio 14, this also because the plugin that I'm writing should run under Visual Studio 2013. From the two post it seems that I can install only this part of VS 14.
My question actually is: if I install MSBuild Tools for Visual Studio 14 what will happen with all other Visual Studio projects that I'm currently working on?
At the moment they use the MSBuild tool of Visual Studio 2013. It's possible to still use that?
Update
What I'm acctually trying to get is to find if a given method has references inside the project. The idea was to proceed as in this post.
When you say you're building a plugin for Visual Studio, if all you care about is getting the workspace for the currently open solution (i.e. the code the user is editing), you shouldn't use MSBuildWorkspace, really ever. That's a type for loading things outside of Visual Studio. What you can do if you're in the product is MEF [Import] Microsoft.VisualStudio.LanguageServices.VisualStudioWorkspace. That gives you live access to what the user has open, and avoids running MSBuild entirely.
Note you're still going to have to be careful about your choice of reference assemblies you build against: if you use the latest NuGet packages that won't work since those will differ in version (and also APIs -- we changed a bunch of stuff) than what was in the last Visual Studio 2013 preview.
The issue is that (unfortunately) the assemblies in the public Roslyn nuget packages have been compiled with a newer version of MSBuild than what you want.
However, it's pretty simple to fix so that it works on MSBuild 4.0 (VS2012+). I've provided them with a PR with the fix (at https://roslyn.codeplex.com/workitem/405), but also published a nuget package called DesktopAnalysis that contains all the assemblies for doing C# code analysis, that work on VS2012+ (MSBuild 4.0+): https://www.nuget.org/packages/DesktopAnalysis
Just do an install-package DesktopAnalysis -pre instead and you're done. The assemblies are the same, the code is the same, etc.
I'm using this to provide a code migration extension that works from VS2013 all the way to VS2015 Preview.
You could fork the Roslyn codebase, and compile with MSBUILD12 defined, which should still work, though we don't really test this much.
This is entirely possible, but not at all easy.
You need to make sure that you only ever load the version of the Roslyn assemblies that is in the VS version you're targeting, by removing those assemblies from your VSIX and handling AssemblyResolve to make sure you get the right ones.
You can see my code that does exactly that here, and you can read more about this technique in my blog post
Note that if you need to [Export] any interfaces defined in Roslyn assemblies, this will not work at all, since MEF will try to load them before you add your handler. (unless you add a module initializer by hand in ildasm)
The harder part is that you need to limit yourself to the intersection of the APIs in every Roslyn version you want to support.
When I include JetBrains-ReSharper my project using NuGet Package Manager, and then I try to rebuild the project, it shows an error.
Error 14 The type 'System.Threading.LazyInitializer' exists in both 'c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\mscorlib.dll' and 'Project\packages\JetBrains.ReSharper.SDK.8.2.1158\bin\System.Threading.dll' Project\Filters\InitializeSimpleMembershipAttribute.cs
Can anybody can help me to solve the problem ?
Sadly, because ReSharper is a .net 3.5 application, and due to the way the SDK is set up, it includes references to the .net 3.5 compatible System.Threading.Tasks.dll back port Microsoft initially released with RX. The unfortunate part is that this file is referenced even if your plugin is a .net 4 project, and so you get conflicts with the real System.Threading.Tasks.
You can change your project to be .net 3.5, but then (again, due to the way the SDK is set up) you'll get other warnings about .net 4 assemblies that are referenced, but shouldn't be. Essentially, you just have to ignore those warnings. We're working on fixing all of this for 9.0.
However, as #derigel mentions in the comments - adding the ReSharper SDK to an MVC project is a little weird, and frankly, won't work. The ReSharper SDK is for building ReSharper plugin extensions. If you want to install ReSharper, download it from here: http://www.jetbrains.com/resharper/download/
I have created two brand new solutions using the latest VS 2010:
C# console application
F# console application
I have referenced two x64 dll files: Kitware.VTK.dll and Kitware.mummy.Runtime.dll
(can be downloaded here: http://www.kitware.com/products/avdownload.php )
The C# VS 2010 finds the namespace when I write using Kitware.
The F# VS 2010 does not find the namespace when I write open Kitware.
The x86 version works fine in F#. Any idea why is that and how to make the Kitware x64 work in F#?
It's probably due to the bug described here:
F# project references not working when targeting x64 platform in Visual Studio 2010
They say it will be fixed in the next release of VS.
be well
-h-
F# console applications default to targeting x86 rather than Any CPU. If you haven't changed that, then the F# project won't work with an x64 library.
I think I may have a fix for that. It requires manually editing your fsproj file.
Add this after the <PropertyGroup> items and before the first <Import>.
<PropertyGroup Condition="'$(Platform)' == 'x64'">
<!--
Assembly resolution using msbuild is broken for the x64 platform in F# 2.0.
See https://connect.microsoft.com/VisualStudio/feedback/details/588317/f-project-references-not-working-when-targeting-x64-platform-in-visual-studio-2010
We use simple resolution with a hard-coded list of paths to look for the dlls instead.
-->
<NoStdLib>true</NoStdLib>
<OtherFlags>--simpleresolution</OtherFlags>
<ReferencePath>C:\Windows\Microsoft.NET\Framework64\v3.5;C:\Windows\Microsoft.NET\Framework64\v2.0.50727</ReferencePath>
</PropertyGroup>
Note that OtherFlags is overwritten, which was OK for me as it was empty. If it's used, you should probably append to the variable instead.
It would be nice to use Microsoft.Build.Tasks for the list of paths, instead of using a hard-coded list, but I haven't been able to get that to work.