Use two NuGet packages with the same .dll name in Visual Studio - c#

I'm trying to use two NuGet packages in my Visual Studio project which has the same output path; so, when I try to build, Visual Studio gives me
Payload contains two or more files with the same destination path 'MyNugetPackage.dll'
Is it possible to change the output .dll name of a NuGet library? If it's, how can I do this?
Thank you
EDIT: If someone is wondering why I want to load two version of the same package, that's because I'm trying to use ApplicationInsights in WP 8.1 Silverlight and RT projects with some shared code. I'm also using background tasks. The SL app uses the same bgtask as RT, so I need to load at the same time the RT and the SL packages of ApplicationInsights for the SL app.

Related

Windows Application Packaging Project Trying to Package Two of Same File Causing Error

I have created a Windows Application Packaging Project in Visual Studio to package a UWP Application and a Console Application together. Everything in the project compiles just fine, and I am able to create an AppPackage for the UWP application by itself.
However, when I attempt to make an AppPackage for the Windows Application Packaging Project I get the following error:
You can't add both "C:\Users\jhogle.nuget\packages\acr.userdialogs\7.0.1\lib\uap10.0.16299\Acr.UserDialogs\Platforms\Uwp\ActionSheetContentDialog.xaml" and "C:\Users\jhogle\Documents\Git\sMARt\Client\Client.UWP\bin\x86\Release\ilc\Acr.UserDialogs\Platforms\Uwp\ActionSheetContentDialog.xaml" to the output file as "Acr.UserDialogs\Platforms\Uwp\ActionSheetContentDialog.xaml"
I know that Arc.UserDialogs is a nuget package that I am using in the UWP application. However, I don't understand what is causing this file to be added twice.
The UWP app is the only project in the solution that references Arc.UserDialogs. It seems to be trying to add the file in question from both the nuget install location, and the output of the UWP application.
What am I doing wrong here?
Edit:
As per Sunteen Wu's comment, I am adding the contents of ActionSheetContentDialog.xaml They can be found here.

Issue when I try to open my partner's solution (WPF application)

I made a WPF project on Visual Studio 2015. This project include some nuget package like LiveCharts, LiveCharts.WPF, MaterialDesignThemes, Newtonsoft.JSON and RestSharp.
I share my project to my partner but when he opens the solution he has got three errors :
We check some solutions on the web but nothing worked.
Thanks !!
Windows has limitations on file path length, you need to move the project to folder that has smaller path length.

xamarin.forms with VS 2015

I start learning the Xamarin with the latest of VS 2015 (enterprise)
I create a a cross platform project with the 'blank xml app'
I got a solution with 5 projects created: portable, droid, ios, UWP and windows 8.1. All of them cannot get compiled at all, since the "initializecomponent" missing
After I've updated the package Xamarin.forms to the latest version, almost of them can be compiled without any errors, except the windows 8.1. I tried around but got no luck, please advise which packages I need to install to?
Edited: add an image "cannot install the package xamarin.forms for the two.windows"
Try to right-click the Two.Windows project -> click Manage NuGet Packages -> in the Installed packages tab, if Xamarin.Forms is listed, uninstall it -> Now click on the Online tab -> search for and install Xamarin.Forms only in your Two.Windows project
After that, I would completely close Visual Studio, click save if asked, delete all files and folders in each project folder's /bin/ and /obj/ folders, reopen the solution and rebuild the Two.Windows project.
If you still have issues after that let us know and also post a new image of the references listed under your Two.Windows project.
Edit: Here is a list of references that I see in my default Windows 8.1 project:
.NET for Windows Store app
Identity: .NETCore,Version=v4.5.1
Path: C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETCore\v4.5.1\
Windows 8.1
Identity: Windows,Version=8.1
Path: C:\Program Files (x86)\Windows Kits\8.1\References\CommonConfiguration\Neutral\
Xamarin.Forms.Core
Xamarin.Forms.Platform
Xamarin.Forms.Platform.WinRT
Xamarin.Forms.Platform.WinRT.Tablet
Xamarin.Forms.Xaml
The I also have the reference to my shared project in there as well as Newtonsoft.Json, but I am not sure if that came by default or not.
Edit #2: Now that we know you are on Windows 7, we know why the Windows Phone 8.1 project is failing. Refer to this answer for more information but the short of it is that you cannot install the Windows Phone 8.1 SDK on Windows 7 nor can you deploy WP 8.1 apps using Windows 7. The answer also gives some alternatives you might be able to use. I think the upgrade is free from what I remember.

How to best share c# dlls in web app?

I'm building a web app project and want to reference a few dlls from a desktop c# project. Both projects are pretty big.
This has all grown organically, so what we've done so far is include the dll projects in the web app solution which makes it easy for debugging. So at the moment all our code (desktop apps and web apps) sit in one big git repo and we build the web app and copy the code to a web server via Jenkins.
The time has come to manage the code better and split the repo into two. The problem I'm having is that I can't build the code anymore as is via Jenkins as the desktop app code (and dlls) will be gone from the Jenkins working directory (unless I create a common working directory).
I just want to get some ideas how to best manage the code:
- How do I best include the desktop c# dlls in my web app solution?
- Is there any way to still being able to debug the dlls if I don't include the dll projects in the web app (when debugging the web app)?
- How do I keep the dlls in the web app solution up to date (say if I put them into the bin folder)?
- Is there a way to not include the dlls in the repo, but have Jenkins rebuild and copy the dlls?
You can host your shared DLLs in a nuget package in its binary format and have it referenced by both the desktop and the web application.
I don't know about the Jenkins part, but a quick google said that there is a plugin that support nuget.
Creating nuget packages is an easy and straight forward process with adding some meta data about the nuget in a nuspec file and calling nuget.exe with some parameters to create the package (nupkg) for you, that you can later reference in your project.
Hosting nuget packages to be found and used later, you will need to create a feed. it can be as simple as storing files in a folder somewhere and configuring your build tools (visual studio, MSBUILD, etc.) where to look to find nuget feeds.
referencing a nuget is done in visual studio via nuget package manager plugin.

How do I get an Installer project to AutoUpdate like the app project publish wizard?

I have a .net solution with 2 projects:
The app
The installation project
The installer is set up in order to copy various additional assets into the project folder for use in the app during runtime (they cannot be embedded resources).
VS 2010 gives us the great capability to publish and app with the ability to use AutoUpdate for free, however I can't work out if I can use the same option when generating the installer through the installation project.
Does anyone know how?

Categories

Resources