uwp - How to Resolve "Payload contains two or more files with the same destination path 'System.Diagnostics.Tools.dll' " -


i working on universal windows applications, in 1 of project want connect azure sql database had wrote below lines of code.

  try         {             sqlconnection connection = null;             string query = null;             //datetime datetime = datetime.now;             connection = new sqlconnection("data source=xxxxxx.database.windows.net;initial catalog=xxxxx_db;integrated security=false;user id=xxxxx;password=xxxxx;connect timeout=60;encrypt=false;trustservercertificate=true;applicationintent=readwrite;multisubnetfailover=false");             connection.open();             // converts image file byte[]             // byte[] imgdata = file.readallbytes(app.m_photostoragefile.path);             //query = "insert [dbo].[delivery_analytics.deliveryperson_information] (name,mobilenumber,companyname,deliveryaddress,image,timestamp)" +             //                "values ('" + nametxtbx.text + "','" + mobilenumtxtbx.text + "','" + comapanynametxtbx.text + "','" + deliveryaddress + "','" + picturetxtbx.text + "','" + datetime + "')";              using (sqlcommand cmd = new sqlcommand(query, connection))             {                 cmd.executenonquery();                 connection.close();             }         }         catch (exception ex)         {          } 

for sqlconnection class, added reference system.data.sqlclient 4.1.0 after added reference project have try rebuild project @ time got exception below.

severity code description project file line suppression state error payload contains 2 or more files same destination path 'system.diagnostics.tools.dll'. source files: c:\users\pradeep.nuget\packages\runtime.any.system.diagnostics.tools\4.0.1\lib\netcore50\system.diagnostics.tools.dll c:\users\pradeep.nuget\packages\system.diagnostics.tools\4.0.0\lib\netcore50\system.diagnostics.tools.dll sqlclientpoc

please tell me how resolve error possible.

we can't connect microsoft sql server directly uwp apps. system.data.sqlclient 4.1.0 package you've referenced .net core library. can use library in .net core apps (either asp.net core apps or console apps), however, can't use in uwp apps.

the common way access microsoft sql server database form uwp app host data service , app query data through rest api or wcf service. example, can check how access data sql server database in windows store app. video shows how create wcf service access data sql server database in windows store apps.

and since using azure sql database, can choose use azure app service particularly mobile apps in project. more info, please see create windows app, work .net backend server sdk azure mobile apps , how use managed client azure mobile apps.


Comments