portable-class-library

Portable class library and .NET ConcurrentDictionary

こ雲淡風輕ζ 提交于 2019-12-08 15:45:36
问题 Looking at http://msdn.microsoft.com/en-us/library/dd287191(v=vs.110).aspx, it seems that ConcurrentDictionary and all of its friends in the System.Collections.Concurrent namespace are available for use in a Portable Class Library. However, when I create either an F# or C# Portable Class Library, even if I explicitly add a reference to mscorlib.dll , the compilation fails when using ConcurrentDictionary . Why? 回答1: The term "Portable" should be loosely applied right now. When you create the

how to fix Xamarin.forms System.IO.FileNotFoundException: Could not find file

99封情书 提交于 2019-12-08 12:10:13
问题 I am using xamrin.forms , and I am trying to access file and read it. I have lastusername.txt as text file and I set the build action for it as "Content", actually I am trying to read file as the following: var filename = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), "lastusername.txt"); if (filename != null) return System.IO.File.ReadAllText(filename);//error occurred here else return ""; I get the following Error: System.IO.FileNotFoundException:

Nuget Resolve dependencies from local files

混江龙づ霸主 提交于 2019-12-08 11:58:35
问题 I have a solution with four projects, three PCL and one WinRT. I've managed to create a nuget package for each one, individually, however, I want to do a single package for all of them, but there are external dependencies and also dependencies between them and I do not know how to resolve them. What I found for external dependencies is something of the like: <?xml version="1.0"?> (...) <dependencies> <dependency id="SampleDependency" version="1.0" /> </dependencies> (...) </package> But how

Portable class library - Reference to type 'MarshalByRefObject' claims it is defined in 'mscorlib', but it could not be found

半世苍凉 提交于 2019-12-08 11:26:26
I have a normal Class Library with a function that converts a Byte Array to an Image. Now I've deleted that Class Library and created a Portable Class Library with the same name and now the code does not seem to work anymore and gives me an error on the "FromStream"-function: Reference to type 'MarshalByRefObject' claims it is defined in 'mscorlib', but it could not be found using System; using System.Drawing; using System.IO; namespace App.Converters { public static class Converter { public static Image ToImage(this byte[] byteArray) { try { return Image.FromStream(new MemoryStream(byteArray)

Cannot add a reference to PCL from C++/Cli project

情到浓时终转凉″ 提交于 2019-12-08 09:09:50
问题 I have a Portable Class Library project, Net 4.5 platform activated. I can use it in other C# projects without problems. Now, I have a C++/Cli project and I need to use some classes of the above PCL project. When I add the reference to the PCL project, Visual Studio 2012 gives me an error because of different target platforms. Is there a problem to add references to PCL projects from C++/Cli projects? Thank you 回答1: This questionas was replied but for some unknown reason, the response has

Xamarin.forms how to Change the Nav Bar Color [duplicate]

南楼画角 提交于 2019-12-08 07:17:41
问题 This question already has answers here : How to change backGround color in Xamarin forms NavigationPage (3 answers) Closed 3 years ago . I am trying to change the nav BarBackgroundColor background color on portable class library project, so how to Change the Nav Bar Color on Xamarin.Forms 回答1: The NavigationPage has a BarBackgroundColor property which you can set. https://developer.xamarin.com/api/type/Xamarin.Forms.NavigationPage/ var nav = new NavigationPage(new ContentPage { Title = "Page"

Upload to dropbox using Restsharp PCL

你离开我真会死。 提交于 2019-12-08 06:28:18
问题 I am trying to upload a file to Dropbox using PCL using RestSharp.Portable. My code is public async Task<object> UploadFile(Stream fileStream, string fileName) { var client = new RestClient("https://api-content.dropbox.com"); client.ClearEncodings(); client.AddEncoding("gzip", new GzipEncoding()); var request = new RestRequest("1/files/dropbox/Apps/FileBolt", HttpMethod.Post); request.AddHeader("Authorization", string.Format("Bearer {0}", Token)); request.AddParameter("file", fileName); byte[

Portable class library - Reference to type 'MarshalByRefObject' claims it is defined in 'mscorlib', but it could not be found

心不动则不痛 提交于 2019-12-08 04:07:05
问题 I have a normal Class Library with a function that converts a Byte Array to an Image. Now I've deleted that Class Library and created a Portable Class Library with the same name and now the code does not seem to work anymore and gives me an error on the "FromStream"-function: Reference to type 'MarshalByRefObject' claims it is defined in 'mscorlib', but it could not be found using System; using System.Drawing; using System.IO; namespace App.Converters { public static class Converter { public

FileNotFoundException in Portable Class Library?

血红的双手。 提交于 2019-12-08 03:16:45
问题 I have 3 assemblies, a WP7 app (targeting 7.0), a Web Services project (running 4.0), and a Portable Class Library (built from the template & targeting WP7, SL4 & .NET 4.0) which contains a common type used between the first two. When run locally (in IIS Express) things work just fine, however when run against a deployed instance of the Web Services assembly (on a remote IIS server I have little control of) fails with the following exception: System.IO.FileNotFoundException: Could not load

Could not load assembly Microsoft.Threading.Tasks.dll

本小妞迷上赌 提交于 2019-12-07 23:06:46
问题 I am receiving the following error on iOS and Android project. Anybody has any workaround for this issue? This post recommends a workaround but the steps are vague. C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(2,2): Error: Exception while loading assemblies: System.IO.FileNotFoundException: Could not load assembly 'Microsoft.Threading.Tasks, Version=1.0.12.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Perhaps it doesn't exist in the Mono for Android