Seeing the following build warning in command prompt,
D:\CxCache\MsBuild.Corext.14.0.23107.9\v14.0\bin\Microsoft.Common.CurrentVersion.targets(1819,5): warning MSB3245: Coul d not resolve this reference. Could not locate
the assembly "System.Fabric". Check to make sure the assembly exists
on disk. If this reference is required by your code, you may get
compilation errors.
followed by the error,
D:\CxCache\MsBuild.Corext.14.0.23107.9\v14.0\bin\Microsoft.Common.CurrentVersion.targets(1819,5): warning MSB3245: Could not resolve this reference. Could not locate
the assembly "System.Fabric". Check to make sure the assembly exists
on disk. If this reference is required by your code, you may get
compilation errors. For SearchPath
"{TargetFrameworkDirectory}".
Considered "D:\CxCache\DotNetFxRefAssemblies.Corext.4.6.0\System.Fabric.dll", but
it didn't exist.
Considered "D:\CxCache\DotNetFxRefAssemblies.Corext.4.6.0\System.Fabric.exe", but
it didn't exist.
My change,
From:
package id="Microsoft.ServiceFabric" version="5.2.207"
To:
package id="Microsoft.ServiceFabric" version="6.3.187"
I am new to Nuget and msbuild. Looking for starting pointers...Please help.
Okay, I did some research and nuget has Microsoft.ServiceFabric there are 2 ways to do this. Open the Package Manager (nuget) console, or open nuget package manager.
The Package Manager is located in visual studio (Tools > Nuget Package Manager > Package Manager) and/or around that area, that one is easy to look up. For installing you want to enter this into your package manager.
[Install-Package Microsoft.ServiceFabric -Version 7.0.466] or any version that follow in your visual studio project. Looking on nuget (dot) org you can find it easily and all the accepted versions, I already said this and I'll say it again. Be sure to be in your project when you do this and the reference will be added.
Related
Can someone help me understand this Visual Studio error message and suggest a fix?
I am getting the error message while scaffolding Identity.
This is the error message I get:
There was an error running the selected code generator: 'Error: An
assembly specified in the applciation dependencies manifest
(Intacct.deps.json) has already been found but with a different file
extension: package:
'Microsoft.VisualStudio.Web.CodeGeneration.Design', version: '3.1.0'
path: 'lib/net461/dotnet-aspnet-codegenerator-design.exe' previously
found assembly:
'C:\MyPath\Users\MyUser.nuget\packages\microsoft.visualstudio.web.codegeneration.design\3.1.0\lib\netcoreapp3.1\dotnet-aspnet-codegenerator-design.dll
The issue was occurred due to the NuGet manager already has a reference for Microsoft.VisualStudio.Web.CodeGeneration.Design. in the C:\Users\Lenovo\.nuget\packages\microsoft.visualstudio.web.codegeneration.design\3.1.1\ folder in C drive.
As well as the reference was also available in the Project package
Follow the below steps to resolve the error,
Goto your project and Expand Dependencies tab
Expand packages and search for Microsoft.visualstudio.web.codegeneration.design(3.1.1) package
Right-click on the package name and Remove the package.
Build the project and try.
Only reinstall package.
open Tools-> NuGet package Manager-> Package Manager Console
Update-Package -reinstall
I successfully installed 'LiveCharts.Wpf' & 'LiveCharts' packages from NuGet, I use them in my code but when I want to build the project I get this error:
Unknown build error, 'A strongly-named assembly is required. (Exception from HRESULT: 0x80131044)
Note that those packages have a strong name. You can see it in the attached image:
Thanks.
I had similar issue, after publishing and trying to build a newer version with VS2017. I switched, in the properties->publish -> application files, for the nuget settings to include. From:
To:
I still don't know what caused this problem, but I opened a new project and installed the packages with 'package manager console' and not from 'NuGet Package Manager' and it's work.
I have a project that use the nuget package EnterpriseLibrary.Common version 5.0.505.0, but when I restore the package in another computer the next warning message appear.
Could not resolve this reference. Could not locate the assembly
"Microsoft.Practices.EnterpriseLibrary.Common".
I look for the fisical path and I do not found the dll, there is only a xml file. "Microsoft.Practices.EnterpriseLibrary.Common.xml"
It should not be included in the nuget package?
or should be in GAC?
if so, how do I install it?
This is something specific to your environment. Normally if you have the nuget package EnterpriseLibrary.Common version 5.0.505.0 referenced in your solution and you open the solution on a new machine and restore nuget packages, the dll is also restored.
You can try running this in Package Manager Console:
Update-Package EnterpriseLibrary.Common -Reinstall
and hope that it helps. If it does not, the nuget package itself (*.nupkg) should be located in
packages\EnterpriseLibrary.Common.5.0.505.0\EnterpriseLibrary.Common.5.0.505.0.nupkg
Make a copy of this file and change the extension to .zip. Open it with your favorite archive manager (Windows Explorer will do) and find all the dlls it contains in the lib folder inside the archive. Microsoft.Practices.EnterpriseLibrary.Common.dll is one of them.
I have a service that was sending bad DateTime data due to use of the JavascriptSerializer. I used Nuget to add Newtonsoft to the project, and utilized that. Here's the only place it's utilized in the code (old way, then new):
374
- var messageString = new JavaScriptSerializer().Serialize(messageDetails);
374
+ var messageString = Newtonsoft.Json.JsonConvert.SerializeObject(messageDetails);
Below is an error that occurs during the Team City build:
Consumer\MetricTrackingMQServiceConsumer.cs(374, 49): error CS0122: 'Newtonsoft.Json.JsonConvert' is inaccessible due to its protection level
Consumer\MetricTrackingMQServiceConsumer.cs(374, 61): error CS0117: 'Newtonsoft.Json.JsonConvert' does not contain a definition for 'SerializeObject'
The project compiles fine locally. Why is it failing in Team City?
As you're using NuGet to include the dependency here's the workflow I strongly suggest to avoid these type of issues.
Ensure that your reference to the Newtonsoft DLL is pointing at the NuGet packages folder.
Exclude the NuGet packages from source control.
Add a "Nuget Installer" type build step before your solution build step to restore all the NuGet packages referenced by the solution.
This has a number of advantages but most importantly given your current issue, it ensures that the version of the DLL referenced by your solution is available and in the correct location.
The following steps fixed this for me:
On your nuget installer step in your build: You may need to "Disable looking up packages from local machine cache"
Uninstall the newtonsoft reference via nuget in your project. Open the csproj file in a text editor and manually delete any remaining references to newtonsoft in there. Save the csproj file, reload your project
Reinstall newtonsoft via nuget
post your changes to your repository (git or whatever you have)
Rerun the teamcity build
I created an MVC application in C#. I created a new project in my solution called PhoneDomain. The purpose of this is to separate my data and domain layer from the actual problem. I right clicked on the project and went to "Add Library Package Reference" and I attempted to add the EntityFramework package (version 4.3.1). It said "Operation Failed" "This package contains an init.ps1 file and needs to be installed from the Package Manager Console".
So I opened the Package Manager Console in Visual Studio and typed the following into the console window:
install-package EntityFramework -project PhoneDomain
After a couple seconds, it installed the package and said Successfully added 'EntityFramework 4.3.1' to PhoneDomain
The problem is, when I run my application, I get the following error message: Could not load file or assembly 'EntityFramework, Version=4.3.1.0, Culture=neutral' or one of its dependencies. The system cannot find the file specified.
The reference in the PhoneDomain is definately there and the the Copy Local property is set to True.
Can anyone tell me what is going on here?
Check your web.config for assembly references. There may be a rogue reference in there.
UPDATE:
Also make sure ALL projects have the necessary reference...