How to add a 3rd Party dll Reference in visual studio code - visual-studio-code

I am using visual studio code on mac, i just trying a sample application where i am adding some dll to a new asp.net project using visual studio code, but i am getting this error
/projects/lalkitab.guide/Controllers/HomeController.cs(6,7): error CS0246: The type or namespace name 'dal' could not be found (are you missing a using directive or an assembly reference?)
where dal is the dll name
can somebody tell me how to resolve it

Related

Azure Devops Services Pipeline build fails. Builds successfully through Visual Studio and the msbuild command prompt

I have solution with 2 projects both targeting .Net Framework 4. The solution builds successfully in Visual Studio 2015 and 2017 as well as the msbuild command line.
However, when it builds in Azure DevOps Pipeline with Agent Specification vs2015-win2012r2 the first project fails with the following errors. The NuGet restore step shows it successfully installed the NuGet EntityFramework 5.0 package.
The type or namespace name 'Infrastructure' does not exist in the namespace 'System.Data.Entity' (are you missing an assembly reference?)
The type or namespace name 'DbContext' could not be found (are you missing a using directive or an assembly reference?)
The type or namespace name 'DbModelBuilder' could not be found (are you missing a using directive or an assembly reference?)
When I change the Agent Specification to vs2017-win2016 the first project builds without error but the second project fails with the following errors:
The type or namespace name 'Description' does not exist in the namespace 'System.Web.Http' (are you missing an assembly reference?)
The type or namespace name 'Http' does not exist in the namespace 'System.Net' (are you missing an assembly reference?)
Error CS0234: The type or namespace name 'Http' does not exist in the namespace 'System.Net' (are you missing an assembly reference?)
I do have the NuGet package Microsoft.Asp.Net.WebApi.Core.4.0.20710.0 referenced in the csproj file which contains the System.Web.Http.dll.
I have turned the debug option on. Here are links to the NuGet Restore Log https://drive.google.com/open?id=1lJWflXTjYTN_MQyLOnwMUr-8LKoR5JRo
and the Build Log
https://drive.google.com/open?id=1ypAVWxniDLfBOBHc4gODdAoQOCQnphYg
According to your log, there is a warning message.
warning MSB3267: The primary reference "System.Net.Http", which is a framework assembly, could not be resolved in the currently targeted framework. ".NETFramework,Version=v4.0". To resolve this problem, either remove the reference "System.Net.Http" or retarget your application to a framework version which contains "System.Net.Http".
Some differences are in effect when executing a command on a local machine and when a build or release is running on an agent. If the agent is configured to run as a service on Linux, macOS, or Windows, then it is not running within an interactive logged-on session. Without an interactive logged-on session, UI interaction and other limitations exist. And there are some troubleshooting steps which was provided by Microsoft.
There is a simple method that you can try to resolve the error. Delete the reference under the project's references, and then juse add it back in again.The reference was to a namespace in a local project to the solution. For some reason it was being found locally but not found when checked into and built on VSTS.

How to add system.servicemodal package in asp.net core vscode

i'm new to .NET core and trying to consume WCF service.Generated the proxy class using svcutil in Microsoft SDKs/Windows/v7.0A/Bin when i use the generated proxy class and config and tried to run using dotnet run getting error as
error CS0246: The type or namespace name 'Order' could not be found (are you missing a using directive or an assembly reference?)
error CS0234: The type or namespace name 'MessageContractAttributeAttribute' does not exist in the namespace 'System.ServiceModel' (are you missing an assembly reference?)
error CS0246: The type or namespace name 'IsWrapped' could not be found (are you missing a using directive or an assembly reference?)
error CS0234: The type or namespace name 'OperationContractAttributeAttribute' does not exist in the namespace 'System.ServiceModel' (are you missing an assembly reference?)
Tried to add System.ServiceModel.Primitives in vscode but no luck getting error
error NU1100: Unable to resolve 'System.ServiceModel.Primitives (>= 4.5.3)' for '.NETCoreApp,Version=v2.1'
Tried below steps
How to add assembly references in Visual Studio Code?
i can't find the system.serviceModal assembly
anyone assist to fix these issue

Xamarin PCL compile issues

I am getting XAML compiler error in my PCL project
Cannot resolve Assembly or Windows Metadata file 'System.Core.dll
Type universe cannot resolve assembly: System.Runtime,
Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.
error CS0518: Predefined type 'System.Object' is not defined or
imported
Could you please help me or tell me any workaround for this.
Am using VS 2017 Enterprise edition and doing Xamarin Mac.

ServiceStack4+LLBLGen4.2: Templates will not compile 'ServiceHost' is undefined

We are a licensed user of ServiceStack and I am using the latest version. I've created an LLBLGen project and added the latest ServiceStack LLBLGen templates. I am able to generate the LLBLGen projects, but the XXXXProject.Services class library fails to compile:
Error 1 The type or namespace name 'ServiceHost' does not exist in the namespace 'ServiceStack' (are you missing an assembly reference?) C:\PROJECTS\ServiceStack\XXXXService\XXXXService.ServiceModel\DAL\ServiceGeneric\Validators\VendorValidator.cs
Are the templates compatible with ServiceStack v4? If not, do you know when they will be compatible or what I need to change to make them work with the latest version of ServiceStack?
Thanks,
Mike

Build fails in Release mode but works fine in Debug - Entity Framework 6.0 related issue

I build my application and run it in debug mode. Everything is ok. I can test the functionality and everything is working. Its a multi tier MVC application using Entity Framework 6.0.
Now, when I change the build from Debug to Release and build the projects. I get a few hundreds build errors. All the errors are in the Data Access layer where I use the Entity Framework 6.0. The errors are in the form of:
Error 388 The type or namespace name 'DbSet' could not be found (are you missing a using directive or an assembly reference?)
Or
Error 201 The type or namespace name 'Schema' does not exist in the namespace 'System.ComponentModel.DataAnnotations' (are you missing an assembly reference?)
I have tried cleaning the solution and rebuilding but always same. Not sure why this can happen? Any suggestion will be appreciated.
many thanks