How to update package reference in project C# by Visual studio - c#

I have a common source C# and this is inject in another project.
Now I have update this common source
But I don't know to update version in other source
How can I do this??
I want to update verion of common source that I have updated into another source

Related

My .NET Core uses different version of Library (Microsoft.Office.Interop.Excel). Is it possible to specify version number while referencing?

I am referencing a library like this on one of my .cs file.
using Excel = Microsoft.Office.Interop.Excel;
Is it possible to specify a version number because it is showing me an error
The type 'Application' exists in both
'Interop.Microsoft.Office.Interop.Excel, Version=1.9.0.0,
I know it doesn't make sense adding libraries with different versions, but project is being under development by large number of developers. After pull from git everyone has to remove the existing version and add library of compatible version.
Suggestion Required, thank you.
it seems the issue related to your package managment approach , one of the quick solution approach is to add folder for referenced Dlls in your git source control and add refrence to your project to that specific dll

Type exists in both error sharing project references and giving each project it's own DLL build of a library when building

I have multiple projects and everything was working ok prior, but I had to download a UI framework package + change the source. I decided to include the DLL's in each project, reference them per project, and now trying to build a solution that references multiple projects blows up saying "type is in both" but I don't understand the problem. Using DLL's, shared projects, why is Visual Studio and the build so confused and can't figure out how to handle this?
The reason I used shared project references too is so I can use code & classes from one project in another and we have class libraries too.
Is there an easy way to fix this? It worked fine as a nuget package so why does using built DLL's isolated per project present a problem, it's the exact same thing.
Seemed to be related to Visual studio caching and how packages are managed so I reverted by source code to start over again. I uninstalled/re-installed nuget packages, manually added my own DLL's, re-built everything from scratch, and it finally worked.

SQLite in WPF application

I'm trying to use a SQLite database file inside my WPF application.
I tried searching for a proper library that wraps the entire SQLite library.
I found the following SQLite library which allows a perfect functionality that suites me.
The problem is building it.
I tried adding it in a Visual Studio as a project and compile it to get a dll file.
That didn't work so much well because of dependencies missing inside the project and sub-projects.
If anyone anticipated or experienced any hard time with this library, I would really use the help and of course appreciate it alot.
Thanks heads up :)
You should install it as a nuget package. Right click on your project -> Manage Nuget Packages -> find SQLite.Net-PCL. You don't need source code for this, only released package and that is exactly what nuget will download for you and add as a dependency.
You can also install the package with Visual Studio's Package Manager Console:
Install-Package SQLite.Net-PCL
If you want to have source code, this library is contained inside a single file, so you can just copy SQLite.cs to your project and it will work.

System.IO.FileNotFoundException: Could not load file or assembly when using resources in 2 C# projects

I am currently working with 2 C# projects inside one VS 2017 solution. One project contains all the business logic and the other simply the UI. The UI, of course, references the Core project.
The Core solution uses RestSharp package on it's code, so I installed it using NuGet. When I run the solution and I reach the part of the code where RestSharp is used, the following exception is thrown: "System.IO.FileNotFoundException: Could not load file or assembly 'RestSharp'".
The problem gets solved if I also install 'RestSharp' package inside the UI project. But, I am trying to avoid that as the UI does not need to use that package.
Is there a way to avoid that? Regards
Check if Copy Local is set to true for the RestSharp reference. When it is set the RestSharp dll will be copied along with the Core dll.

Is there any way to find framework version of the project by means DTE or VSproject object?

I have an add in which is used to add dll to the project based on the framework of the project.for this i need to know the .NET Frame work of the project and i can achieve this by reading the .csproj file of the project. But what I am looking is Ways to get it via dte/vsproject object. is there any way?
Thanks,
You can get it from EnvDTE, using:
Project.Properties.Item("TargetFramework").Value
See:
HOWTO: Get the target .NET Framework of a Visual Studio 2008 project from a Visual Studio add-in or macro

Categories

Resources