‘Settings’ is not a member of ‘My’

SOLVED

Try adding the namespace, so:

My.Settings.conAName
becomes
[Namespace].Settings.conAName

Advertisements

Microsoft.Common.targets (1360): Found conflicts between different versions of the same dependent assembly

Problem

Warning : “Found conflicts between different versions of the same dependent assembly”

Not enough information

Solution – Method

The verbosity of builds may be changed in Visual Studio > Tools > Options > Projects and Solutions > Build and Run > MSBuild Project output verbosity. May need to go to at least detailed. Then use the output window to get more information.
The verbosity may also be changed in the VS-TFS build.

Then search in the Output for “conflict”, and underneath it states:

“References which depend on “… new version
“References which depend on “… old version

Make them match.

Solution – Binding Redirect

Optionally check-in the file containing the app.config.

If you double click on the warning then you may get a message:

“One or more dependent assemblies have version conflicts.
Do you want to fix these conflicts by adding binding redirect records in the app.config file?”

If you click OK, then use source code control to compare the app.config you will get a change in the newVersion setting

<runtime>
<assemblyBinding xmlns=”urn:schemas-microsoft-com:asm.v1″>
<dependentAssembly>
<assemblyIdentity name=”EntityFramework” publicKeyToken=”B77A5C561934E089″ culture=”neutral” />
<bindingRedirect oldVersion=”0.0.0.0-4.4.0.0″ newVersion=”6.0.0.0″ />
</dependentAssembly>
</assemblyBinding>
</runtime>

This Post History

VS-TFS Build was reporting this error for a long time, but not indicating precisely which file was causing the problem

C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets (1360): Found conflicts between different versions of the same dependent assembly

Generally have found the problem to be on a project which references another project, where both projects use the same references. One may get out of sync with the project being built.

Found the problem difficult to find. Not entirely sure what the problem was:
The build server had a copy of version 9 of Microsoft.VisualBasic.PowerPacks.Vs in c:\Program Files\Common Files\Microsoft Shared\…
instead of version 10.0 listed in some projects.
I checked that version 10 was installed on the build server, then removed the version 9 from this pc.
Could have perhaps considered making the PowerPack reference copy local.

Also try working out any references listed in the problem project which are also used by referenced projects and include a reference to the problem project. I have found that where Visual Studio builds projects without the referenced project references, MSBuild seems to need them in the target project as well. This was not in fact the case in my resolution here.

Example solved 15-Mar-2011 was System.Windows.Forms.DataVisualization was version 3.5.0.0 in a user control. Upgraded all to 4.0.0.0.

See http://stackoverflow.com/questions/1871073/resolving-msb3247-found-conflicts-between-different-versions-of-the-same-depend

ODBC connection to SQL Server 2008 R2

On ODBC  using SQL Native Client.
Many possible problems. But consider trying with Server Firewall off. If this is successful then consider the following changes on firewall which have worked for me.

Firewall settings on server are:

http://technet.microsoft.com/en-us/library/ms175043.aspx

  • On the Start menu, click Run, type firewall.cpl and then click OK.
  • In the Windows Firewall dialog box, click the Exceptions tab, and then click Add Port.
  • In the Add a Port dialog box, in the Name text box, type SQL Server <instance name>.
  • In the Port number text box, type the port number of the instance of the Database Engine, such as 1433 for the default instance.
  • Verify that TCP is selected, and then click OK.
  • To open the port to expose the SQL Server Browser service, click Add Port, type SQL Server Browser in the Name text box, type 1434 in the Port Number text box, select UDP, and then click OK.
    NoteNote
    To allow named pipes access through the firewall, you must also enable File and Printer Sharing through the firewall.
  • —————

    Also Firewall on server must add program SQLServer.exe which is at <program files><Microsoft SQL Server><MSSQL10_50.Instance Name\MSSQL\Binn\sqlservr.exe

    ————-

    Prefer not using older ODBC SQL server, but if do then on client configuration dynamically chosen ports is relevant

    Installing SQL Server 2008R2 on SBS 2008 Standard

    SBS Server Standard 2008 has SQL Server Management Studio Express tools on it.
    When installing SQL Server 2008 R2 Standard one of the checks was for the above and would not let you pass until this was removed. My approach was to uninstall SSMS Express. Checks then passed.

    As SBS is using SBSMonitoring as a database, websites suggest installing SQL Server as a new instance. I installed it as SQL2008 instance. SUCCESS.

    How do I … work with Guid in ADO.Net?

    How do I … work with Guid in ADO.Net?
    ( in this case to support SQL Server replication using dataset )

    26-Dec-2011
    Hypothesis: That DataSet could act unaware of replication column (do not import it on datatable creation) (or delete it after). Then use default in SQL Server (newsequentialid())
    Experiment: Worked out of the box – straight away

    During creation of SQL Replication, SQL Server will add a rowGuid column which is a uniqueidentifier and places a default of (newsequentialid()) onto this column
    Insert statements for replication must include all columns, except the rowGuid column.

    ERROR
    However if you then add a new row to this table in ADO.Net then program will give error message ‘Column rowGuid does not allow nulls’

    SOLUTION
    [MyDataTable].rowguidColumn.DefaultValue = Guid.NewGuid

    EXPLANATION
    SQL will have inserted a Unique index on rowGuid. However when the table is dropped onto the dataset the unique key is not there. Therefore although the above default set once will give each new row the same Guid, the ADO.net sees no errors. Because the insert statement does not insert the Guid, SQL does, then ADO.Net immediately returns the correct newly applied Guid from the database. This is because the Dataset insert statement also has a SELECT statement on it to get table updates immediately after the INSERT.

    SQL Server Replication

    Updating ERROR
    Updating columns with the rowguidcol property is not allowed.
    The transaction ended in the trigger. The batch has been aborted.

    Removed the rowguid column from the dataset update sql and it worked. Found no online instruction for this in short search.

    Theory of Constraints – TOC – The Goal – Eliyahu M. Goldratt

    http://en.wikipedia.org/wiki/The_Goal_(novel)

    https://www.amazon.co.uk/Goal-Process-Ongoing-Improvement/dp/0566086654/ref=sr_1_3?ie=UTF8&qid=1297223569&sr=8-3

    http://en.wikipedia.org/wiki/Theory_of_Constraints

    Great book on Theory of Constraints told as a piece of fiction with a story of a Production Manager who is always expediting jobs.

    At the end of the book the ‘hero’ asks the consultant, paraphrased here ‘.. and would you have not been able to have told these conclusions at the beginning’
    The answer to this was that no, if he had done that then you would never truly understood the solution. Too many paradigm shifts to work through.

    TOC includes bottleneck management and line-balancing.

    The underlying premise of Theory of Constraints is that organizations can be measured and controlled by variations on three measures: throughput, operational expense, and inventory. Throughput is the rate at which the system generates money through sales. Inventory is all the money that the system has invested in purchasing things which it intends to sell. Operational expense is all the money the system spends in order to turn inventory into throughput

    SQL Server Replication

    PUBLISHER
    SQL Server Agent account must be running on publisher
    Snapshot folder must be a UNC folder which is shared

    SUBSCRIBER
    Agent process account could be Subscriber Computer or Domain name \ User Name
    Distributer connection and Publisher connection I used a SQL Authentication account which will already work for normal login

    ERROR: On Subsciber
    Msg 14058, Level 16, State 1, Procedure sp_addmergesubscription, Line 381
    Cannot create the subscription because the subscription already exists in the subscription database. Only one subscription to the same publication is allowed in each subscription database. Drop the subscription and add it again if necessary. If the problem persists, replication metadata might be incorrect; see Books Online for troubleshooting information.

    SOLUTION: On Publisher
    SELECT * FROM sysmergesubscriptions
    DELETE FROM sysmergesubscriptions WHERE subscriber_server = ‘ServerName’

    ERROR: On Publisher
    Unable to start execution of step 2 (reason: Error authenticating proxy ComputerName\UserName, system error: Logon failure: unknown user name or bad password.).  The step failed.

    SOLUTION: On Publisher
    Agent Security use a windows account. Password is the windows password for that account.
    This account must have at least db_owner for the database being published.
    It must also have write permissions on the publication folder.
    http://msdn.microsoft.com/en-us/library/ms186515(v=SQL.105).aspx
    STATUS: Should now have files on Publisher in Snapshot folder

    ERROR: On Subsriber
    the schema script ‘….sch’ could not be propagated to the subscriber
    Go to subscriber view job history. Message in there may be above plus
    ‘The process could not read file ‘…\MSSQL\ReplData\unc\…’ due to OS error 3.

    SOLUTION: On Publisher
    Use a UNC path on the publication. To do this > Publisher > Publication > Right click properties > Snapshot > Put files in the following folder
    Then use \\ server or computer name \ .. \ MSSQL \ReplData or which ever folder
    Should now work

    Build server automated tests fail SQL authentication

    If unit tests are testing against the database using Integrated Security then when these automated tests are put onto the build machine authentication may fail.
    SOLUTION. Create a SQL login for a machine which is possible.
    CREATE LOGIN [MyDomain\MyComputer$] FROM WINDOWS;
    http://social.msdn.microsoft.com/Forums/en/sqlsecurity/thread/315b5780-c131-4867-88b9-ebac82e68d77

    SQL Server Agent will not start

    Believe this problem is because I had SQL Server 2008 on my machine and then added SQL Server 2008 R2. Today I had renamed the old MSSQL10 directories with a zz at front to mark them as old. Then SQL Server Agent did not start.
    First I had:
    Error message when you use SQL Server Configuration Manager to restart the SQL Server Agent service in SQL Server 2008:
    “The request failed or the service did not respond in a timely fashion”
    http://support.microsoft.com/kb/955494
    Suggested using Start > Administrative Tools > Services or Services.msc and start from there.

    This led to next problem
    The SQL Server Agent (MSSQLSERVER) service on Local Computer started and then stopped.  Some services stop automatically if they have no work to do, for example, the Performance Logs and Alerts service.
    http://blogs.msdn.com/b/sqlserverfaq/archive/2009/06/12/unable-to-start-sql-server-agent.aspx
    Found that the registry entry
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.1\SQLServerAgent
    ErrorLogFile key was pointing at a location which was 2008 not 2008 R2
    Chnaged the key value and SQL Server Agent started OK

    SOLVED

    SQL Database Restore: Cannot access the specified path or file on the server

    “locate backup file cannot access the specified path or file on the server. Verify that you have the necessary security privileges and that the path or file exists.

    If you know that the service account can access a specific file, type in the full path for the file in the file name control in the locate dialog box.”

    Solution:
    Start > Programs > SQL Server Conifguration Manager > SQL Server Services
    Find SQL Server in list and identify the Log On As account

    Then go to the backup file location and give permissions to that account. Should now work