assembly-references

Reference not added for NuGet package

徘徊边缘 提交于 2019-12-10 22:54:05
问题 I've a custom NuGet package (My.Resources) containing an assembly and a dependency on another custom NuGet package (My.Base). If I install the package, the installation finishes successfully, but the assembly reference is not added. Here is the full output from a Install-Package command: Attempting to resolve dependency 'My.Base (≥ 1.0.0)'. Installing 'My.Base 1.0.0'. Added file 'My.Base.dll' to folder 'My.Base.1.0.0\lib\net45'. Added file 'My.Base.1.0.0.nupkg' to folder 'My.Base.1.0.0'.

Why does the compiler when using an overload in another assembly sometimes require you to also reference a subassembly?

情到浓时终转凉″ 提交于 2019-12-07 05:17:32
问题 There are quite a few questions/answers about the compiler error mentionend below and how to resolve it, but the question here is asking about some insights why in this case this is required. Why does a project A which uses an overload of a method of another referenced project B, which uses an object of project C in one of it's overloaded signatures require, that you reference project C from project A, even if you never use the object from project C? I guess it must have to do with the

Twitterizer 2 and C# - Namespace could not be found

我与影子孤独终老i 提交于 2019-12-05 17:16:12
问题 I have a silly problem with Twitterizer2 and probably me :) . I add the reference twitterizer 2.3.1 from my downloads directory along with the newtonsoft one by right clicking on references and browsing to find them. I then add using Twitterizer; lo and behold all my squiggly red underlines go away on all this sort of code: OAuthTokens tokens = new OAuthTokens(); when I go to run it(with debug), I get an error: Error 2 The type or namespace name 'Twitterizer' could not be found (are you

Why does the compiler when using an overload in another assembly sometimes require you to also reference a subassembly?

人盡茶涼 提交于 2019-12-05 16:49:33
There are quite a few questions/answers about the compiler error mentionend below and how to resolve it, but the question here is asking about some insights why in this case this is required. Why does a project A which uses an overload of a method of another referenced project B, which uses an object of project C in one of it's overloaded signatures require, that you reference project C from project A, even if you never use the object from project C? I guess it must have to do with the resolving of which overload to use, but I'd like to understand the concept behind. Here's an example: Put

Why do ASP.NET resolve assembly references differently?

北慕城南 提交于 2019-12-05 07:04:56
I really tried hard to find a similar issue to get some leads, but no one seems to describe the case we are having, so here it goes. Background We have a product with the following general design: [Local installation folder] Contains a set of .NET assemblies, implementing the bulk of our product functionality. Example: Implementation1.dll , Implementation2.dll [GAC] ClientAPI.dll. Our client assembly, to be referenced from end user Visual Studio projects. Has strong references to the implementation dll's in the local installation folder. In ClientAPI.dll, we have an entrypoint we require end

How to include reference to assembly in ASP.NET Core project

不打扰是莪最后的温柔 提交于 2019-12-04 02:57:34
I have this line string sConnectionString = ConfigurationManager.ConnectionStrings["Hangfire"].ConnectionString; And it requires to include System.Configuration In which place of the project I have to add reference to System.Configuration because I cannot find a classic place to do it under References ? The tutorial your're following is probably using Asp.Net Core targeting the full .Net Framework (4.6) that is capable of relying on System.Configuration (that is not portable and not supported in CoreFX). .Net Core projects (being cross-platform) use a different configuration model that is

Twitterizer 2 and C# - Namespace could not be found

荒凉一梦 提交于 2019-12-04 02:27:21
I have a silly problem with Twitterizer2 and probably me :) . I add the reference twitterizer 2.3.1 from my downloads directory along with the newtonsoft one by right clicking on references and browsing to find them. I then add using Twitterizer; lo and behold all my squiggly red underlines go away on all this sort of code: OAuthTokens tokens = new OAuthTokens(); when I go to run it(with debug), I get an error: Error 2 The type or namespace name 'Twitterizer' could not be found (are you missing a using directive or an assembly reference?) Now using Twitterizer; becomes in error(red and

Could not load file or assembly or one of its dependencies. The system cannot find the file specified. (No GAC allowed)

依然范特西╮ 提交于 2019-12-02 05:17:24
I have the "Main" program which loads my own "plugin.dll" file dynamically using reflection. The "plugin.dll" file references to the third party "device.dll" by using visual studio references. As long as the "device.dll" and "plugin.dll" are in the same folder as the "Main" program or the "Main" program has the reference to the "plugin.dll" everything works fine. But as soon as I move the "device.dll" file to another folder I get the following error message: "Could not load file or assembly or one of its dependencies. The system cannot find the file specified." The problem occurs because the

How are references located in .NET?

泄露秘密 提交于 2019-12-01 20:16:59
What process does .NET use to locate a referenced assembly at runtime and is it different than the process used to locate a referenced assembly during compilation? I am specifically interested in the locations that are searched and their search order and any parameters/configuration settings that might affect the outcome. There are three types of references that can be made in a .NET application. This answer will only cover the first two in the list below. File references. Project references Service references. Every reference must be resolved. Reference resolution is the process of locating a

Why my C# does not have System.ServiceProcess Library?

£可爱£侵袭症+ 提交于 2019-12-01 02:22:19
This is the code. I just wanna test the library of System.ServiceProcess library. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.ServiceProcess; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { Console.WriteLine("hi"); var srv = new ServiceController("MyService"); Console.WriteLine("MyService Status {0}", srv.Status); if (srv.Status != ServiceControllerStatus.Running) srv.Start(); System.Threading.Thread.Sleep(1000000); } } } However, when I run the C# code, its says: Error 1 The