Visual Studio 2017 Extension Development - c#

Hi I want to upgrade my extension to visual studio 2017 but I got Microsoft.VisualStudio.Shell.RegistrationAttribute error, but I have been already added this reference?I got this error in compile time. Is there any reference to be added or else? Any comment about that?
D:\Visual Studio 2017\VSSDK\VisualStudioIntegration\Common\Assemblies\v4.0\Microsoft.VisualStudio.Shell.Immutable.10.0.dll ,version :10.0.0.0
My Error is
Severity Code Description Project File Line Suppression State
Error CreatePkgDef : error : ArgumentException: No Visual Studio registration attribute found in this assembly.
Severity Code Description Project File Line Suppression State
Error The assembly should contain an instance of the attribute 'Microsoft.VisualStudio.Shell.RegistrationAttribute' defined in assembly 'Microsoft.VisualStudio.Shell.Immutable.10.0' version '10.0.0.0'
Severity Code Description Project File Line Suppression State
Error at Microsoft.VisualStudio.Tools.CreatePkgDef.ProcessAssembly(String fileName, Hive hive, PkgDefContext context, Boolean register, RegistrationMode mode) in f:\dd\src\vssdk\VSIntegration\Tools\src\CreatePkgDef\CreatePkgDef.cs:line 303

Add GeneratePkgDefFile as false like below in the csproj file
<GeneratePkgDefFile>false</GeneratePkgDefFile>

Finaly I found the solution,I remove all references of Microsoft.VisualStudio.****,after than I add my project a new vsix in visual studio 2017 that time I download all packages from nuget and my project is compile now.

Related

typescript upgrade 1.8.10 to 2.9.2 and 4.6.4 build error

I have an angular application, using typescript 1.8.10 and working fine. I like to try and upgrade typescript from 1.8.10 to 2.9.2. Once I change this setting in package.json and run npm install I get a lot of errors. Is there anything I need to do to use this version?
Version 2.9.2 Error
Severity Code Description File Project Line Suppression State
Error Build:',' expected. C:\WebProjects\ITF\Web\node_modules\typescript\lib\lib.es6.d.ts
Update I tried to update typescript to 4.6.4 but I am getting a different error about the same file
Version 4.6.4 Error
Severity Code Description File Project Line Suppression State
Error Build:Invalid 'reference' directive syntax. C:\WebProjects\ITF\Web\node_modules\typescript\lib\lib.es6.d.ts
Invalid 'reference' show when the package path is missing, or something's wrong with it. Deleting the entire node_modules folder and reinstall them with your package manager (npm or yarn).
npm install
If that doesn't work, I would suggest you to update your dependencies.
https://github.com/DefinitelyTyped/DefinitelyTyped/issues/10097

Method System.IO.Path.GetDirectoryName not found when creating an application installer WPF

Severity Code Description Project File Line Suppression State
Error MSB4186 Invalid static method invocation syntax:
"[System.IO.Path]::GetDirectoryName(C:\Users\emmet\OneDrive - CBRE,
Inc\Work\SourceTree\CBREDesktopApplication%28Net5Dev%29\CBRE
Application\CBRE Application.csproj)". Method
'System.IO.Path.GetDirectoryName' not found. Static method invocation
should be of the form: $([FullTypeName]::Method()), e.g.
$([System.IO.Path]::Combine(a, b)). Check that all parameters are
defined, are of the correct type, and are specified in the right
order. Application Installer C:\Program Files (x86)\Microsoft Visual
Studio\2019\Community\MSBuild\Microsoft\DesktopBridge\Microsoft.DesktopBridge.targets 602
When attempting to create an application installer for a WPF application, I get this error code on Visual Studio 2019. Any ideas? Project is .Net 5.0

CreatePkgDef Exception in VS 2019

I am trying to create a visual studio extension for my Roslyn analyzer in VS 2019. When I set the option Generate .pkgdef File to true I am getting the below exception:
CreatePkgDef : error : ArgumentException: No Visual Studio registration attribute found in this assembly.
The assembly should contain an instance of the attribute 'Microsoft.VisualStudio.Shell.RegistrationAttribute' defined in assembly 'Microsoft.VisualStudio.Shell.Framework' version '16.0.0.0'
at Microsoft.VisualStudio.Tools.CreatePkgDef.ProcessAssembly(String fileName, Hive hive, PkgDefContext context, Boolean register, RegistrationMode mode)
at Microsoft.VisualStudio.Tools.CreatePkgDef.DoCreatePkgDef(InputArguments inputArguments)
at Microsoft.VisualStudio.Tools.CreatePkgDef.Main(String[] arguments)
In my case, I had one project that was originally tasked with making a VSIX AND contained a lot of classes/views/viewmodels. I wanted to create a separate VSIX installer project and started receiving this 'CreatePkgDef : error : ArgumentException: No Visual Studio registration attribute found in this assembly.The assembly should contain an instance of the attribute 'Microsoft.VisualStudio.Shell.RegistrationAttribute' error.
What worked for me was editing the original project's .csproj file to change true to false in this element:
<GeneratePkgDefFile>false</GeneratePkgDefFile>
If the < GeneratePkgDefFile > element does not already exist, simply add it within the < PropertyGroup > element near the top.

Ambiguous use of System.Net.Http.HttpClientExtensions

Could you please help me to know why this error appear ??
error:Severity Code Description Project File Line Suppression State
Error CS0121 The call is ambiguous between the following methods or properties: 'System.Net.Http.HttpClientExtensions.SetBearerToken(System.Net.Http.HttpClient, string)' and 'System.Net.Http.HttpClientExtensions.SetBearerToken(System.Net.Http.HttpClient, string)' ImportTrustsApp C:\#Noha Basiony\NowInfinity Web\web\smsf.web\ImportTrustsApp\Program.cs 45 Active
It appears that older versions of System.Net.Http.HttpClientExtensions
assemblies have been cached and now they conflict with the newly installed assemblies. Please follow these steps, which should help you overcome the problem:
Delete your current System.Net.Http.HttpClientExtensions reference.
Add new System.Net.Http.HttpClientExtensions reference.
Close Visual Studio .
Clear the project's Bin and Obj folders.
Rebuild your application.

Visual Studio 2015 Community Edition: Error „lc.exe exited with code -1“

I try to use an old VS project with an external assembly.
I read that lc.exe is for licensing of external assemblies and most likely the license is no longer valid. I tried to install a trial of the external assembly, but the problem is still the same.
This error is quite common:
How to fix build error in Visual Studio: '"LC.exe" exited with code -1'
and many other google results tell to delete the licenses.licx file which will be regenerated during the next build – it is not regenerated during build in my project.
Is there any more detailed report of LC.exe then "error code -1"?
I have no idea how to handle this error.
EDIT:
The more detailed error is:
"licenses.licx(1): error LC0003: Unable to resolve type '', ''
where '', '' are the names of the components which I installed as a trial.
The solution I found is to throw the old 'licenses.licx' file out. I do this by manually deleting the file in the "Properties" folder of my project and removing the line referencing it in the *.csproj-file.
Look at this blog-post here.

Categories

Resources