<br />
<b>Warning</b>:  strpos() expects parameter 1 to be string, array given in <b>/home/theserverside/public_html/wp-includes/blocks.php</b> on line <b>20</b><br />
{"id":1360,"date":"2019-05-12T12:11:37","date_gmt":"2019-05-12T12:11:37","guid":{"rendered":"https:\/\/www.theserverside.technology\/?p=1360"},"modified":"2019-05-12T12:24:20","modified_gmt":"2019-05-12T12:24:20","slug":"azure-service-fabric-warning-per-incompatibilita-dellarchitettura-della-cpu-di-una-libreria","status":"publish","type":"post","link":"https:\/\/www.theserverside.technology\/it\/2019\/05\/12\/azure-service-fabric-warning-per-incompatibilita-dellarchitettura-della-cpu-di-una-libreria\/","title":{"rendered":"Azure Service Fabric: warning per incompatibilit\u00e0 dell'architettura della CPU di una libreria","raw":"Azure Service Fabric: warning per incompatibilit\u00e0 dell'architettura della CPU di una libreria"},"content":{"rendered":"<p>Sviluppando una applicazione per Azure Service Fabric e aggiungendo una libreria .NET Standard al progetto ci si potrebbe imbattere in una serie di warning di Visual Studio come questo<\/p>\n<div class=\"su-quote su-quote-style-default\"><div class=\"su-quote-inner su-u-clearfix su-u-trim\">Warning MSB3270 There was a mismatch between the processor architecture of the project being built &#8220;MSIL&#8221; and the processor architecture of the reference &#8220;C:\\[&#8230;]&#8221;, &#8220;AMD64&#8221;. This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project.<\/div><\/div>\n<p>Si tratta di un warning che indica che l&#8217;architettura selezionata per la CPU non \u00e8 l&#8217;unica supportata da Azure Service Fabric e cio\u00e8 <strong>x64<\/strong>. Probabilmente l&#8217;impostazione \u00e8 <em>AnyCPU<\/em> e la libreria funzioner\u00e0 correttamente ma per fare sparire i warning \u00e8 sufficiente modificare il target di compilazione nell&#8217;apposita sezione <em>Build<\/em> di Visual Studio:<\/p>\n<p><a href=\"https:\/\/www.theserverside.technology\/wp-content\/uploads\/2019\/05\/vs_target_x64.jpg\"><img loading=\"lazy\" class=\"aligncenter wp-image-1366\" src=\"https:\/\/www.theserverside.technology\/wp-content\/uploads\/2019\/05\/vs_target_x64-1024x377.jpg\" alt=\"\" width=\"799\" height=\"294\" srcset=\"https:\/\/www.theserverside.technology\/wp-content\/uploads\/2019\/05\/vs_target_x64-1024x377.jpg 1024w, https:\/\/www.theserverside.technology\/wp-content\/uploads\/2019\/05\/vs_target_x64-300x110.jpg 300w, https:\/\/www.theserverside.technology\/wp-content\/uploads\/2019\/05\/vs_target_x64-768x283.jpg 768w, https:\/\/www.theserverside.technology\/wp-content\/uploads\/2019\/05\/vs_target_x64-16x6.jpg 16w, https:\/\/www.theserverside.technology\/wp-content\/uploads\/2019\/05\/vs_target_x64-32x12.jpg 32w, https:\/\/www.theserverside.technology\/wp-content\/uploads\/2019\/05\/vs_target_x64-28x10.jpg 28w, https:\/\/www.theserverside.technology\/wp-content\/uploads\/2019\/05\/vs_target_x64-56x21.jpg 56w, https:\/\/www.theserverside.technology\/wp-content\/uploads\/2019\/05\/vs_target_x64-64x24.jpg 64w, https:\/\/www.theserverside.technology\/wp-content\/uploads\/2019\/05\/vs_target_x64-1000x368.jpg 1000w, https:\/\/www.theserverside.technology\/wp-content\/uploads\/2019\/05\/vs_target_x64-1200x442.jpg 1200w, https:\/\/www.theserverside.technology\/wp-content\/uploads\/2019\/05\/vs_target_x64.jpg 1217w\" sizes=\"(max-width: 799px) 100vw, 799px\" \/><\/a><\/p>\n<p>oppure impostare l&#8217;architettura target direttamente nel file <strong>.csproj<\/strong> del progetto:<\/p>\n<pre class=\"prettyprint lang-xml\" data-start-line=\"1\" data-visibility=\"visible\" data-highlight=\"3\" data-caption=\"PropertyGroup section inside .csproj file\">&lt;PropertyGroup&gt;\r\n    &lt;TargetFramework&gt;netcoreapp2.0&lt;\/TargetFramework&gt;\r\n    &lt;PlatformTarget&gt;x64&lt;\/PlatformTarget&gt;\r\n    &lt;RootNamespace&gt;Microsoft.*.Tests&lt;\/RootNamespace&gt;\r\n&lt;\/PropertyGroup&gt;<\/pre>\n<p>E&#8217; sufficiente salvare il file ed effettuare una nuova compilazione : non si dovrebbero visualizzare altri warning.<\/p>\n<p>Ovviamente bisogna ricordare che questa modifica render\u00e0 inutilizzabile la libreria nel contesto di una applicazione a 32bit.<\/p>\n","protected":false,"raw":"Sviluppando una applicazione per Azure Service Fabric e aggiungendo una libreria .NET Standard al progetto ci si potrebbe imbattere in una serie di warning di Visual Studio come questo\r\n\r\n[su_quote]Warning MSB3270 There was a mismatch between the processor architecture of the project being built \"MSIL\" and the processor architecture of the reference \"C:\\[...]\", \"AMD64\". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project.[\/su_quote]\r\n\r\nSi tratta di un warning che indica che l'architettura selezionata per la CPU non \u00e8 l'unica supportata da Azure Service Fabric e cio\u00e8 <strong>x64<\/strong>. Probabilmente l'impostazione \u00e8 <em>AnyCPU<\/em> e la libreria funzioner\u00e0 correttamente ma per fare sparire i warning \u00e8 sufficiente modificare il target di compilazione nell'apposita sezione <em>Build<\/em> di Visual Studio:\r\n\r\n<a href=\"https:\/\/www.theserverside.technology\/wp-content\/uploads\/2019\/05\/vs_target_x64.jpg\"><img class=\"aligncenter wp-image-1366\" src=\"https:\/\/www.theserverside.technology\/wp-content\/uploads\/2019\/05\/vs_target_x64-1024x377.jpg\" alt=\"\" width=\"799\" height=\"294\" \/><\/a>\r\n\r\noppure impostare l'architettura target direttamente nel file <strong>.csproj<\/strong> del progetto:\r\n<pre class=\"prettyprint lang-xml\" data-start-line=\"1\" data-visibility=\"visible\" data-highlight=\"3\" data-caption=\"PropertyGroup section inside .csproj file\">&lt;PropertyGroup&gt;\r\n    &lt;TargetFramework&gt;netcoreapp2.0&lt;\/TargetFramework&gt;\r\n    &lt;PlatformTarget&gt;x64&lt;\/PlatformTarget&gt;\r\n    &lt;RootNamespace&gt;Microsoft.*.Tests&lt;\/RootNamespace&gt;\r\n&lt;\/PropertyGroup&gt;<\/pre>\r\nE' sufficiente salvare il file ed effettuare una nuova compilazione : non si dovrebbero visualizzare altri warning.\r\n\r\nOvviamente bisogna ricordare che questa modifica render\u00e0 inutilizzabile la libreria nel contesto di una applicazione a 32bit."},"excerpt":{"rendered":"","protected":false,"raw":""},"author":8,"featured_media":1361,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_en_post_content":"While developing an application that will be hosted on Azure Service Fabric and adding a <strong>.NET Standard library<\/strong> or project, Visual Studio might display a warning like this one:\r\n\r\n[su_quote]Warning MSB3270 There was a mismatch between the processor architecture of the project being built \"MSIL\" and the processor architecture of the reference \"C:\\[...]\", \"AMD64\". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project.[\/su_quote]\r\n\r\nTurned out that the problem is that the only supported platform for Azure Service Fabric is x64 so you receive that warning when your target CPU for building is <em>AnyCPU<\/em>. The library will probably work anyway but to solve that problem you must either choose x64 as a target in the Build section\r\n\r\n<a href=\"https:\/\/www.theserverside.technology\/wp-content\/uploads\/2019\/05\/vs_target_x64.jpg\"><img class=\"aligncenter wp-image-1366\" src=\"https:\/\/www.theserverside.technology\/wp-content\/uploads\/2019\/05\/vs_target_x64-1024x377.jpg\" alt=\"\" width=\"799\" height=\"294\" \/><\/a>\r\n\r\nor set the target processor architecture inside the <strong>.csproj<\/strong> file:\r\n<pre class=\"prettyprint lang-xml\" data-start-line=\"1\" data-visibility=\"visible\" data-highlight=\"3\" data-caption=\"PropertyGroup section inside .csproj file\">&lt;PropertyGroup&gt;\r\n    &lt;TargetFramework&gt;netcoreapp2.0&lt;\/TargetFramework&gt;\r\n    &lt;PlatformTarget&gt;x64&lt;\/PlatformTarget&gt;\r\n    &lt;RootNamespace&gt;Microsoft.*.Tests&lt;\/RootNamespace&gt;\r\n&lt;\/PropertyGroup&gt;<\/pre>\r\nSave the file and build the library again: you should not see those warnings anymore.\r\n\r\nSwitching target processor architecture obviously makes that library unusable in 32bit context, something that you should be aware of.","_en_post_name":"azure-service-fabric-warnings-about-mismatched-processor-architecture","_en_post_excerpt":"","_en_post_title":"Azure Service Fabric warnings about mismatched processor architecture","_it_post_content":"Sviluppando una applicazione per Azure Service Fabric e aggiungendo una libreria .NET Standard al progetto ci si potrebbe imbattere in una serie di warning di Visual Studio come questo\r\n\r\n[su_quote]Warning MSB3270 There was a mismatch between the processor architecture of the project being built \"MSIL\" and the processor architecture of the reference \"C:\\[...]\", \"AMD64\". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project.[\/su_quote]\r\n\r\nSi tratta di un warning che indica che l'architettura selezionata per la CPU non \u00e8 l'unica supportata da Azure Service Fabric e cio\u00e8 <strong>x64<\/strong>. Probabilmente l'impostazione \u00e8 <em>AnyCPU<\/em> e la libreria funzioner\u00e0 correttamente ma per fare sparire i warning \u00e8 sufficiente modificare il target di compilazione nell'apposita sezione <em>Build<\/em> di Visual Studio:\r\n\r\n<a href=\"https:\/\/www.theserverside.technology\/wp-content\/uploads\/2019\/05\/vs_target_x64.jpg\"><img class=\"aligncenter wp-image-1366\" src=\"https:\/\/www.theserverside.technology\/wp-content\/uploads\/2019\/05\/vs_target_x64-1024x377.jpg\" alt=\"\" width=\"799\" height=\"294\" \/><\/a>\r\n\r\noppure impostare l'architettura target direttamente nel file <strong>.csproj<\/strong> del progetto:\r\n<pre class=\"prettyprint lang-xml\" data-start-line=\"1\" data-visibility=\"visible\" data-highlight=\"3\" data-caption=\"PropertyGroup section inside .csproj file\">&lt;PropertyGroup&gt;\r\n    &lt;TargetFramework&gt;netcoreapp2.0&lt;\/TargetFramework&gt;\r\n    &lt;PlatformTarget&gt;x64&lt;\/PlatformTarget&gt;\r\n    &lt;RootNamespace&gt;Microsoft.*.Tests&lt;\/RootNamespace&gt;\r\n&lt;\/PropertyGroup&gt;<\/pre>\r\nE' sufficiente salvare il file ed effettuare una nuova compilazione : non si dovrebbero visualizzare altri warning.\r\n\r\nOvviamente bisogna ricordare che questa modifica render\u00e0 inutilizzabile la libreria nel contesto di una applicazione a 32bit.","_it_post_name":"azure-service-fabric-warning-per-incompatibilita-dellarchitettura-della-cpu-di-una-libreria","_it_post_excerpt":"","_it_post_title":"Azure Service Fabric: warning per incompatibilit\u00e0 dell'architettura della CPU di una libreria","edit_language":"it"},"categories":[8,2],"tags":[114,379,391,324,251],"_links":{"self":[{"href":"https:\/\/www.theserverside.technology\/it\/wp-json\/wp\/v2\/posts\/1360"}],"collection":[{"href":"https:\/\/www.theserverside.technology\/it\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.theserverside.technology\/it\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.theserverside.technology\/it\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/www.theserverside.technology\/it\/wp-json\/wp\/v2\/comments?post=1360"}],"version-history":[{"count":14,"href":"https:\/\/www.theserverside.technology\/it\/wp-json\/wp\/v2\/posts\/1360\/revisions"}],"predecessor-version":[{"id":1376,"href":"https:\/\/www.theserverside.technology\/it\/wp-json\/wp\/v2\/posts\/1360\/revisions\/1376"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.theserverside.technology\/it\/wp-json\/wp\/v2\/media\/1361"}],"wp:attachment":[{"href":"https:\/\/www.theserverside.technology\/it\/wp-json\/wp\/v2\/media?parent=1360"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.theserverside.technology\/it\/wp-json\/wp\/v2\/categories?post=1360"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.theserverside.technology\/it\/wp-json\/wp\/v2\/tags?post=1360"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}