class-library

.net load configuration in class library

一世执手 提交于 2019-12-02 10:20:55
let's say i have : 1) 1 WindowsForm on "A" Project 2) 1 WindowsForm on "B" Project 3) 1 class library (GAC) Condition Both of Project references is same Part 1 : I have my.settings in my class library to save configuration with public function Part 2 : I create value/configuration from "A" and store it in my class library. settings has been successfully saved, and load the value/configuration with no errors Question : 1). Why i can't load the value/configuration from "B" ? NullException shown First I think, to use my.resources in class library but, my.resources is readonly 2). What best

how to produce a mix of dll and exe in one C# project in visual studio or other build tools?

我与影子孤独终老i 提交于 2019-12-02 09:37:53
问题 how to produce a mix of dll and exe in one C# project in visual studio or other build tools ? Is it technically possible ? Yes I know it can done in 2 or more projects . 回答1: I'm not sure what the motivations for your question are, as you can reference a .Net executable as if it were a dll anyway, but you could consider copying the exe file to a dll file with the same name (yes it's a hack but not sure of your motivations). You can automate this process using a Visual Studio post-build event

Does setbuf() affect cout?

柔情痞子 提交于 2019-12-02 06:02:46
问题 Yet again, my teacher was unable to answer my question. I knew who may be able to... So, I've never really learned C. In C++, I would, obviously, use a cout statement all of the time. In a recent assignment, my teacher told us to make sure to put setbuf( stdout , NULL ); at the top of main() in order to get an unbuffered output, thus allowing us to see the output properly. My question is this: will this statement affect a cout statement, or simply a printf() statement that I call? Thanks in

how to produce a mix of dll and exe in one C# project in visual studio or other build tools?

谁都会走 提交于 2019-12-02 04:45:00
how to produce a mix of dll and exe in one C# project in visual studio or other build tools ? Is it technically possible ? Yes I know it can done in 2 or more projects . I'm not sure what the motivations for your question are, as you can reference a .Net executable as if it were a dll anyway, but you could consider copying the exe file to a dll file with the same name (yes it's a hack but not sure of your motivations). You can automate this process using a Visual Studio post-build event for your project. This will handle creating the dll copy each time you have a successful build: copy "$

Overriding methods values in App.xaml.cs

匆匆过客 提交于 2019-12-02 03:21:44
I am working on Windows 8 Phone application,I have 2 things here one is Library project and other is normal app,Let me first explain my code: In Library project class A { public static string empName ="ABC"; public static int empID = 123; public virtual List<string> ListOfEmployees() { List<string> empList = new List<string> empList.Add("Adam"); empList.Add("Eve"); return empList; } } I have referenced the library project in my child project, My child and Library project are in 2 different solution. In Child application class Properties : A { public void setValues(){ empName ="ASDF"

Does setbuf() affect cout?

妖精的绣舞 提交于 2019-12-02 02:27:39
Yet again, my teacher was unable to answer my question. I knew who may be able to... So, I've never really learned C. In C++, I would, obviously, use a cout statement all of the time. In a recent assignment, my teacher told us to make sure to put setbuf( stdout , NULL ); at the top of main() in order to get an unbuffered output, thus allowing us to see the output properly. My question is this: will this statement affect a cout statement, or simply a printf() statement that I call? Thanks in advance! By default, iostreams and stdio are synchronised. Reference. This doesn't mean that manually

Calling Javascript from a Class Library

ε祈祈猫儿з 提交于 2019-12-02 02:21:34
I have created a class library DLL to be referenced from any third-party application and it contains only one function that calls a JavaScript to read a local file and returns some values from the file to referencing application. I used: System.Web.HttpContext.Current.Response.Write but it writes the JavaScript function at the beginning of the referencing page so it can never be executed. Then, to write the JavaScript at the end of the referencing page I used: Dim CSM As UI.ClientScriptManager = System.Web.UI.Page.ClientScript and I used also: Me.Page.ClientScript CSM.RegisterClientScriptBlock

Missing xaml.xr of a class library file in UWP

我只是一个虾纸丫 提交于 2019-12-01 19:44:10
I have a class library project which I am using in a UWP project. If I add any usercontrol xaml file in the class library and build it it builds fine. But the UWP project gives an error that it cannot find the .xr file. Do I need to add the .xr file externally in any folder to my UWP project? Jay Zuo Yeah, for a class library with XAML files, if we want to reference the dll in other project, we need not only the dll itself but also the .xr.xaml file and some other files. Because in UWP environment, the resources are no longer embedded in the assembly but are placed next to the dll as content.

Can you use a class library if you don't reference all of it's dependencies?

∥☆過路亽.° 提交于 2019-12-01 16:42:57
Let me clarify: I have built a class library to be used in several projects. As part of this DLL I want to add a few different custom providers for Owin Cookies by extending CookieAuthenticationProvider so I need to include a reference to Microsoft.Owin.Security.Cookies. This is safe because the newer projects that will use my library also use Microsoft.Owin.Security.Cookies. However some of the projects are older and dont use Owin etc... Will they blow up if I include the library for other use? Or will they only blow up if I try to use the provider (which I wouldn't since they cant use it). I

Can you use a class library if you don't reference all of it's dependencies?

孤街醉人 提交于 2019-12-01 15:48:53
问题 Let me clarify: I have built a class library to be used in several projects. As part of this DLL I want to add a few different custom providers for Owin Cookies by extending CookieAuthenticationProvider so I need to include a reference to Microsoft.Owin.Security.Cookies. This is safe because the newer projects that will use my library also use Microsoft.Owin.Security.Cookies. However some of the projects are older and dont use Owin etc... Will they blow up if I include the library for other