I am getting the following warning and error message for a C# 2008 application I am working on:
Warning 17 The predefined type 'System.Runtime.CompilerServices.ExtensionAttribute' is defined in multiple assemblies in the global alias;
using definition from 'c:\Program Files (x86)\NLog\.NET Framework 2.0\NLog.dll' sample
Error 21 The type or namespace name 'Nlog' could not be found (are you missing a using directive or an assembly reference?) C:\Sample.cs 15 7 samplef
I am getting this error message since I am trying to add the NLog open source tool to the solution file for 3 different project files in this solution.
I am completing the following task:
1. I add a reference to this dll in the references section of each proejct file.
2. I then place a 'using NLog' statment in each proejct file.
Can you show me code and/or tell me how to fix this problem?
is it possible to know my password using MAPI in c#
Maybe if I put it another way. NO! It would be a massive security hole if you could. Massive as in the press would be screaming for someone's head. Questions would be asked by governments. The world will tilt off its axis. NO!!!
*pre-emptive celebratory nipple tassle jiggle* - Sean Ewington
I am getting the error message,"Error 19 'LogManager' is an ambiguous reference between 'Common.Logging.LogManager' and 'NLog.LogManager'".
In a C# 2008 application I am trying to add nlog open source logging tool to an application that is already using common.logging that was obtained from the following location: http://netcommon.sourceforge.net.
I have added a reference to the NLog file and I have added the Nlog to the using statement.
The problem is both tools use an object called 'LogManager'.
Thus can you tell me how to solve my problem so I can use both Logmanagers.
Can you tell me how to use the connection string value from the app.config file and not the hard codee values?
In a C# 2008 desktop/console application, I created the connections to the database using linq to sql. Everything worked fine until I moved the
code to point to a different database. Somehow the original database connections are being saved and the values from the app.config file
are not being used.
I tried to do what the following link: http://refat38.wordpress.com/2012/01/30/unpick-linq-to-sql-connection-string-from-application-settings/,
said to do however, I do not know what the following statement means to do from this link:
Now Right Click and open the Properties on your DAL or project containing your LINQ to SQL classes and remove the connection string “Application Setting” reference on the Settings tab.
I also tried to add the following to the *.designer.cs file:
base(ConfigurationManager.ConnectionStrings["esample.Properties.Settings.devtestConnectionString"].ConnectionString, mappingSource) and attached
a system.configuration file as a reference.
1. The following code isfrom the app.config file:
connectionString="Data Source=dev;Initial Catalog=devtest;Integrated Security=True"
Can you show me code and/or tell me how to solve this problem so I can obtain the value from the app.config file?
If you have the database code in a different project than the main project, the connection string could have been saved in that project, but is still using the app.config in the main project. I know I have seen this in Entity Framework.