Visual Studio: Include PlugIn but leave out windows part - visual-studio

I am trying to use not the nuget package but the project itself from the media plugin for xamarin forms.
I am adding all the references and upon build (or even clean) i get :
Error: The specified language targets for uap10.0.16299 is missing. Ensure correct tooling is installed for 'uap'. Missing: '/Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/xbuild/Microsoft/WindowsXaml/v16.0/Microsoft.Windows.UI.Xaml.CSharp.targets' (Media.Plugin)
I beleive it is looking for the windows SDK which isnt isntalled on my mac and the project itself only supports android and ios.
Using the nuget package, I can check that I only want ios and Android and it works fine, but upon loading the project in as the project it gives me this error.
In the dependencies folder of the project it is still referencing this UAP 10.0.16299 but upon right click all I can do is "refresh".
How can I build my project and leave out this windows crap?

First include the whole project, then edit the CS proj file (right click on solution -> edit project file).
In the first few lines it says: <TargetFramworks...
Remove the unwanted dependencies. They will be gone in the main folder if you save.
Thats it.

Related

Package target doesn't include bin\x64 folder but VS2019 did

I think I have various beads on why this may be happening, but I can't quite put all the clues together.
We were building an ASP.NET app in VS 2019 with a nuget dependency (Microsoft.Data.SqlClient.SNI.1.0.19235.1 if it matters). I've used msbuild -t:package and in VS 2019, it would spit out bin\x86 and bin\x64 folders with the DLL from that nuget package. That package step would spit out a zip file and opening that up you can see the x86/x64 folders in there.
We upgraded to VS 2022 and the CPU arch folders are no longer there. I can see them get created in the working directory, but not in the package output.
Nothing in the project has changed. It's set to target "AnyCPU" and Framework 4.6.2. The command we're using to build hasn't changed either. As far as I can tell, it's just the upgrade to VS 2022.
I know VS 2022 is now 64-bit native, so I have a suspicion that's in play here. Any ideas on why those CPU-architecture folders are no longer included in the zip package? And how to get them back in there?
Thanks!
According to your description I make some test, hope it can help you:
Check your Configuration Manager under Build in the menu and add new Platform you need.
Build the project in Batch Build under Build in the menu.
We can see that .dll files are created in the same path so it will be covered.
Open the project file.(Right click on the project and Unload Project then right click again an choose edit project file)
You can see code like this:
Change the OutputPath to “bin\x64\Debug\”, ”bin\x64\Release\” and so on.
Reload the project and rebuild the project in Batch Build.
About how to Pack multiple platforms into one package you can see this(Pack multiple platforms into one package, using dotnet pack ).
If it helps anyone, since my problem was specifically with the SNI.dll not being emitted in the x64/x86 folders, my workaround solution was to upgrade the Microsoft.Data.* libraries to a newer version. The x64/x86 folders are still not emitted, but I now see Microsoft.Data.SqlClient.SNI.x64.dll and Microsoft.Data.SqlClient.SNI.x86.dll files in the root bin folder.
It doesn't answer the original question, but at least it got me moving.

Module Not in Gradle View [duplicate]

I've a big problem with Android Studio.
I have a project that depends on two other projects (as libs).
I followed the guide Problems importing project into Android Studio regarding ActionBarSherlock for import external modules.
I opened "Project Structure", imported the module, but after that I can't see it in the Modules area.
The Modules area contains only the root module, seems it is not refreshed (this is strange). So if I try to add the module as a Dependency, Android Studio doesn't find any module!
Then, if I try to re-import the module, it says that the module/project is already registered!!
Maybe I'm missing something, but I don't know what....! I have this problem both on Windows and MacOSX.
Thanks in advance,
Federico
Look around in your .idea directory for mentions of the problematic project. I had the same problem and resolved it by deleting the entry from .idea/sbt.xml.
In ij go to menu: View -> Tool Windows-> Gradle
Right click on the problematic module and click Refresh External Project, You should see the module in project explorer.
I had a similar problem with ABS and other library imports. The 'Project Structure' interface just wouldn't show the modules. On trying to import the modules, it would prompt, "The project is already registered". Seems to be an IntelliJ/Android Studio issue. Invalidate Caches option didn't help.
Reimporting the project after some cleanup did work for me.
As a precaution, take a backup of your project and store it safely
Ensure that your project builds via gradle command-line and you have all required dependencies specified in respective build.gradle files. Try building with: gradle clean && gradle build
Close the project in Android Studio (or close Android Studio)
Delete .iml files and .idea folders from all modules and the main project
Start Android Studio and reimport the project (Import project from external model > Gradle)
you should remove the project from respective gradle/sbt/maven/ant tab (used to be on right vertical line of Android Studio/Intellij IDEA)
See this answer: https://stackoverflow.com/a/30442195/907576
My issue was fixed when I restart IDEA.

Sharing a JSON file between iOS and Android projects

I have inherited a Xamarin project (not Xamarin.Forms) and right now it has three major components.
An iOS project, an Android project and finally a Shared Project (not a PCL and not a .Net Standard project).
Despite the Shared Project, the application reads a json file included within the assets folders of each project. The file is a duplicate. I feel like this file should be in the Shared Project
To clarify, this is the structure:
Shared Project
No Assets
iOS
Resources/test.json
Android
Assets/test.json
I believe the test.json file should exist as one file in the Shared Project. My first step was to make this move and I changed the file to Build Action=Content which worked for the iOS project. It seems however the Android project does not get this file. I cannot find it anywhere in the compiled and archived .apk file.
Is there anything I can do about this, or do I need to accept this design flaw and build a .Net Standard library or PCL? If so, how exactly do you make a .Net Standard or PCL for a non-Xamarin.Forms project.
What is your use case? If you just need to read the test.json at runtime and parse it using .NET code, you can use embedded resources, details here: https://developer.xamarin.com/guides/xamarin-forms/application-fundamentals/files/
If you need the file to go into iOS reosurces / Android assets folder, you can keep the test.json file only once in the solution (either in shared project or as a solution item) and add it as link to both iOS and Android project - here is screen shot how to do it in Visual Studio.
You can do it also in Visual Studio for Mac - right click on the containing folder in solution explorer, choose Add Files and you will get the following prompt - choose Add a link to the file

Tesseract for WinRT UWP

I need to use Tesseract on a Windows 10 app for phones. Already found an intent made by Yoisel . I've tried to build the project for test, but i'm kinda new to Visual Studio dependencies and usage.
What i've done so far is to open the tesseract_winrt.sln on the VS2015 folder.
After that i copied leptonica project to root directory of tesseract_winrt so it can be loaded inside the solution. Once that everything is loaded i click build solution and get this errors:
I'm not sure what i'm doing wrong or how to properly set the dependencies
Any idea would be appreciated.
There are now binaries for the project that you can use:
https://github.com/yoisel/tesseract_winrt/releases/tag/v0.1-alpha
It is a set of Visual Studio Extension SDKs, you can install the one for UWP projects on your system and add a reference to it in your project using the "Extensions" tab:
Disclaimer: This project was merely a proof of concept and I strongly recommend not to use it as is in a production scenario

Unable to alter PCL library Target Frameworks

I am running Visual Studio 2012 plus Xamarin.iOS with the latest version of each. I have Portable Class Libraries in which I want to select the latest "Xamarin.iOS" release as a build target (instead of MonoTouch). In Visual Studio I open up the Project's Properties, select the Library tab, and click on Change under Target Frameworks. However, I am unable to modify any of the checkboxes. Any checkbox I change instantly closes the "Change Target Frameworks" dialog. If I change one of the dropdowns (for example, change from .NET 4.0+ to 4.5) then when I go to click OK the changes do not get reflected in the Target Frameworks list.
Anyone have any idea how to resolve this issue?
I was able to resolve this by changing the TargetFrameworkProfile in the XML of the csproj file. I was on Profile104 which is no longer supported, so I manually removed this and left this blank in the XML, and then was able to re-add the profile targets (after using the dialog it put me on Profile136).
I've encountered a similar problem , while trying to add MvvmCross Nuget Package. I've to change PCL profile to 259 , it didn't allow me ( Xamarin Studio on iOS) , Ok and Cancel buttons are not present.
I opened the .csproj file in TextEditor.
Removed the PCL profile information. Reopened the project.It gave me build error.
So added following string manually
Profile259
It Started working.Hope this information helps.

Resources