I have a ASP.NET 5 NuGet package called Boilerplate.Web.Mvc6. I am unable to to reference the NuGet package in my ASP.NET 5 website. Here is my project.json file referencing "Boilerplate.Web.Mvc6": "1.0.11".
{
// Omitted
"dependencies": {
"Microsoft.AspNet.Mvc": "6.0.0-beta6",
"Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-beta6",
"Microsoft.AspNet.Server.IIS": "1.0.0-beta6",
"Microsoft.AspNet.Server.WebListener": "1.0.0-beta6",
"Microsoft.AspNet.StaticFiles": "1.0.0-beta6",
"Microsoft.AspNet.Tooling.Razor": "1.0.0-beta6",
"Microsoft.Framework.Configuration.EnvironmentVariables": "1.0.0-beta6",
"Microsoft.Framework.Configuration.Json": "1.0.0-beta6",
"Microsoft.Framework.Configuration.UserSecrets": "1.0.0-beta6",
"Microsoft.Framework.Logging": "1.0.0-beta6",
"Microsoft.Framework.Logging.Console": "1.0.0-beta6",
"Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0-beta6",
"Newtonsoft.Json": "7.0.1",
"System.Runtime": "4.0.20-beta-23109",
"Boilerplate.Web.Mvc6": "1.0.11"
},
// Omitted
}
When I add the package above, the references in the project shows an error and I get the following printed in the output window:
PATH=.\node_modules\.bin;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\External;%PATH%;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\External\git
C:\Users\Rehan Saeed\.dnx\runtimes\dnx-clr-win-x86.1.0.0-beta7-12364\bin\dnx.exe "C:\Users\Rehan Saeed\.dnx\runtimes\dnx-clr-win-x86.1.0.0-beta7-12364\bin\lib\Microsoft.Dnx.Tooling\Microsoft.Dnx.Tooling.dll" restore "C:\Temp\WebApplication2\WebApplication2" -f "C:\Program Files (x86)\Microsoft Web Tools\DNU"
Microsoft .NET Development Utility CLR-x86-1.0.0-beta7-12364
Restoring packages for C:\Temp\WebApplication2\WebApplication2\project.json
CACHE https://api.nuget.org/v3/index.json
CACHE http://MyGet.org/aspnetmaster/
CACHE https://az320820.vo.msecnd.net/v3-flatcontainer/boilerplate.web.mvc6/index.json
GET http://MyGet.org/aspnetmaster/FindPackagesById()?id='Boilerplate.Web.Mvc6'
Warning: FindPackagesById: Boilerplate.Web.Mvc6
Response from http://MyGet.org/aspnetmaster/FindPackagesById()?id='Boilerplate.Web.Mvc6' is not a valid NuGet v2 service response.
GET http://MyGet.org/aspnetmaster/FindPackagesById()?id='Boilerplate.Web.Mvc6'
Warning: FindPackagesById: Boilerplate.Web.Mvc6
Response from http://MyGet.org/aspnetmaster/FindPackagesById()?id='Boilerplate.Web.Mvc6' is not a valid NuGet v2 service response.
GET http://MyGet.org/aspnetmaster/FindPackagesById()?id='Boilerplate.Web.Mvc6'
Error: FindPackagesById: Boilerplate.Web.Mvc6
Response from http://MyGet.org/aspnetmaster/FindPackagesById()?id='Boilerplate.Web.Mvc6' is not a valid NuGet v2 service response.
----------
System.IO.InvalidDataException: Response from http://MyGet.org/aspnetmaster/FindPackagesById()?id='Boilerplate.Web.Mvc6' is not a valid NuGet v2 service response. ---> System.Xml.XmlException: 'doctype' is an unexpected token. The expected token is 'DOCTYPE'. Line 2, position 3.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.Throw(String res, String[] args)
at System.Xml.XmlTextReaderImpl.ThrowUnexpectedToken(String expectedToken1, String expectedToken2)
at System.Xml.XmlTextReaderImpl.ParseDoctypeDecl()
at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.Linq.XDocument.Load(XmlReader reader, LoadOptions options)
at System.Xml.Linq.XDocument.Load(Stream stream, LoadOptions options)
at Microsoft.Dnx.Tooling.Restore.NuGet.NuGetv2Feed.EnsureValidFindPackagesResponse(Stream stream, String uri)
--- End of inner exception stack trace ---
at Microsoft.Dnx.Tooling.Restore.NuGet.NuGetv2Feed.EnsureValidFindPackagesResponse(Stream stream, String uri)
at Microsoft.Dnx.Tooling.Restore.NuGet.NuGetv2Feed.<>c__DisplayClass25_0.<FindPackagesByIdAsyncCore>b__0(Stream stream)
at Microsoft.Dnx.Tooling.Restore.NuGet.HttpSource.<GetAsync>d__9.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at Microsoft.Dnx.Tooling.Restore.NuGet.NuGetv2Feed.<FindPackagesByIdAsyncCore>d__25.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Dnx.Tooling.RemoteWalkProvider.<FindLibrary>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Dnx.Tooling.RestoreOperations.<FindLibrary>d__9.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at Microsoft.Dnx.Tooling.RestoreOperations.<FindLibraryByVersion>d__8.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at Microsoft.Dnx.Tooling.RestoreOperations.<FindLibraryMatch>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Dnx.Tooling.RestoreOperations.<FindLibraryEntry>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Dnx.Tooling.RestoreOperations.<CreateGraphNode>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at Microsoft.Dnx.Tooling.RestoreOperations.<CreateGraphNode>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Dnx.Tooling.RestoreCommand.<CreateGraphNode>d__71.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at Microsoft.Dnx.Tooling.RestoreCommand.<RestoreForProject>d__70.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Dnx.Tooling.RestoreCommand.<>c__DisplayClass69_0.<<Execute>b__1>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Dnx.Tooling.RestoreCommand.<Execute>d__69.MoveNext()
----------
Restore failed
Response from http://MyGet.org/aspnetmaster/FindPackagesById()?id='Boilerplate.Web.Mvc6' is not a valid NuGet v2 service response.
NuGet Config files used:
C:\Users\Rehan Saeed\AppData\Roaming\NuGet\NuGet.Config
Feeds used:
https://az320820.vo.msecnd.net/v3-flatcontainer/
http://MyGet.org/aspnetmaster/
C:\Program Files (x86)\Microsoft Web Tools\DNU
What's going wrong?
UPDATE
These are my NuGet package feeds:
nuget.org - https://api.nuget.org/v3/index.json
My Get - http://MyGet.org/aspnetmaster
Microsoft .NET - https://www.nuget.org/api/v2/curated-feeds/microsoftdotnet/
UPDATE 2
I ran dnu restore --ignore-failed-sources and got the following output, where it still can't find my NuGet package. The strange thing is that I can reference 1.0.10 of the same package from my ASP.NET 5 project but not from an ASP.NET 5 class library.
Restoring packages for C:\Temp\WebApplication2\WebApplication2\project.json
GET https://api.nuget.org/v3/index.json
OK https://api.nuget.org/v3/index.json 130ms
GET http://MyGet.org/aspnetmaster/
OK http://MyGet.org/aspnetmaster/ 142ms
GET https://az320820.vo.msecnd.net/v3-flatcontainer/boilerplate.web.mvc6/index.json
GET http://MyGet.org/aspnetmaster/FindPackagesById()?id='Boilerplate.Web.Mvc6'
Warning: FindPackagesById: Boilerplate.Web.Mvc6
Response from http://MyGet.org/aspnetmaster/FindPackagesById()?id='Boilerplate.Web.Mvc6' is not a valid NuGet v2 service response.
GET http://MyGet.org/aspnetmaster/FindPackagesById()?id='Boilerplate.Web.Mvc6'
OK https://az320820.vo.msecnd.net/v3-flatcontainer/boilerplate.web.mvc6/index.json 103ms
Warning: FindPackagesById: Boilerplate.Web.Mvc6
Response from http://MyGet.org/aspnetmaster/FindPackagesById()?id='Boilerplate.Web.Mvc6' is not a valid NuGet v2 service response.
GET http://MyGet.org/aspnetmaster/FindPackagesById()?id='Boilerplate.Web.Mvc6'
Warning: FindPackagesById: Boilerplate.Web.Mvc6
Response from http://MyGet.org/aspnetmaster/FindPackagesById()?id='Boilerplate.Web.Mvc6' is not a valid NuGet v2 service response.
Unable to locate Boilerplate.Web.Mvc6 >= 1.0.11
Writing lock file C:\Temp\WebApplication2\WebApplication2\project.lock.json
Restore complete, 1210ms elapsed
Errors in C:\Temp\WebApplication2\WebApplication2\project.json
Unable to locate Boilerplate.Web.Mvc6 >= 1.0.11
NuGet Config files used:
C:\Users\Rehan Saeed\AppData\Roaming\NuGet\NuGet.Config
Feeds used:
https://az320820.vo.msecnd.net/v3-flatcontainer/
http://MyGet.org/aspnetmaster/
It might be a myget bug. I opened a bug on dnu anyway (see it here) and also pinged the myget folks.
The issue is that http://MyGet.org/aspnetmaster/FindPackagesById()?id='Boilerplate.Web.Mvc6' returns 200 OK and HTML when the package is not found and we try to parse it as XML.
You can pass --ignore-failed-sources to dnu restore to unblock yourself.
I have tried deleting the project.lock.json file and re-opening Visual Studio which usually solves this problem for me.
I have since retried installing version 1.0.11 of the package and it magically worked. Since previous versions were working and I made no changes to the project or my installation, I suspect this to be a NuGet package on-boarding problem. It has taken three days for NuGet to register the new version of the package.
Related
The command I'm executing:
var feature = await container.ReadItemAsync<CosmosNormalizedFeatureModel>(guid, new Microsoft.Azure.Cosmos.PartitionKey(partitionKey));
Throws an exception:
Response status code does not indicate success: Unauthorized (401); Substatus: 0; ActivityId: ; Reason: ();
I don't believe this is true, but I don't see anything wrong either.
when I use GetItemLinqQueryable I have no issues connecting to Cosmos
I've verified the partition key exists + set to correct property and returns data
I've verified the guid/id exists and returns data
I've verified the container is set to the correct container
Microsoft.Azure.Cosmos 3.20.1
Not sure what else I can check to troubleshoot the issue. Thanks!
Stack trace
at Microsoft.Azure.Cosmos.ResponseMessage.EnsureSuccessStatusCode()
at Microsoft.Azure.Cosmos.CosmosResponseFactoryCore.ProcessMessage[T](ResponseMessage responseMessage, Func`2 createResponse)
at Microsoft.Azure.Cosmos.CosmosResponseFactoryCore.CreateItemResponse[T](ResponseMessage responseMessage)
at Microsoft.Azure.Cosmos.ContainerCore.<ReadItemAsync>d__56`1.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
at Microsoft.Azure.Cosmos.ClientContextCore.<RunWithDiagnosticsHelperAsync>d__38`1.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at Microsoft.Azure.Cosmos.ClientContextCore.<OperationHelperWithRootTraceAsync>d__29`1.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at xxx.<GetFeatureByGuid>d__7.MoveNext() in D:\xxx.cs:line 183
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at xxx.<GetNormalizedILIReportFeatureByGuid>d__10.MoveNext() in D:\xxx.cs:line 280
Based on comments - you are using Bulk mode.
When using Bulk mode, operations are packed together to improve network performance (the operation type is not relevant, read operations can be packed with write operations) and sent as a single payload to the backend.
The payload is of a different type calling a different API (so the backend can unpack them and process them and return a packed response).
This API uses the Write keys (because inside the package there could be any type of operation). The fact that you are using the Read-only keys is what is causing the 401. Ideally the backend should be more explicit in the error it returns though.
The key being used to connect to cosmos is a read key, it appears that the point read requires a read/write key.
I am trying to upgrade the app version for one our SF solutions. But failed multiple times as one of the services is reporting an issue during start with the new version.
Here is what I see as 2 exceptions happening almost at the same time:
OnApply
Unexpected service exception. Type: System.TypeInitializationException Message: The type initializer for 'MyCompany.MyService.Interfaces.Models.MyUser' threw an exception. HResult: 0x80131534
Log record. Type: BeginTransaction LSN: 103498
at System.Fabric.Store.TStore`5.OnApplyAdd(TransactionBase txn, MetadataOperationData metadataOperationData, RedoUndoOperationData operationRedoUndo, Boolean isIdempotent, String applyType)
at System.Fabric.Store.TStore`5.<OnRecoveryApplyAsync>d__299.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Fabric.Store.TStore`5.<Microsoft-ServiceFabric-Replicator-IStateProvider2-ApplyAsync>d__237.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.ServiceFabric.Replicator.DynamicStateManager.<OnApplyAsync>d__106.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.ServiceFabric.Replicator.DynamicStateManager.<OnApplyAsync>d__105.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.ServiceFabric.Replicator.OperationProcessor.<ApplyCallback>d__36.MoveNext().
And
Exception in OpenAsync. Type: System.TypeInitializationException Message: The type initializer for 'MyCompany.MyService.Interfaces.Models.MyUser' threw an exception. HResult: 0x80131534. Stack Trace: at Microsoft.ServiceFabric.Replicator.RecoveryManager.<PerformRecoveryAsync>d__31.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.ServiceFabric.Replicator.LoggingReplicator.<PerformRecoveryAsync>d__137.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.ServiceFabric.Replicator.DynamicStateManager.<OpenAsync>d__109.MoveNext().
I would expect to see this kind of error in case any changes happened to the "MyUser" model, but it was not changed at all.
Not sure if it has to do with some kind of an issue with the SF version we are using: 5.7.198 as this is not the latest one.
Anyone faced something similar or have good ideas for a work around?
P.S. This is a production system with real customers. Being able to make upgrades and not loosing their data is a must. Hence re-creation of the SF/cluster is not an option.
I am using the In memory provider in a .Net 461 unit test project. I am using VS 2017.
var contextOptionsBuilder = new DbContextOptionsBuilder();
contextOptionsBuilder
.UseInMemoryDatabase("testmethod1");
var ctx = new ConfigStoreDbContext(contextOptionsBuilder.Options);
The packages.config contains the following package.
<package id="System.ValueTuple" version="4.4.0" targetFramework="net461" />
Here is the stack trace.
Test Name: TestMethod1
Test Outcome: Failed
Test Duration: 0:00:01.1170206
Result StackTrace:
at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.EntityGraphAttacher.AttachGraph(InternalEntityEntry rootEntry, EntityState entityState, Boolean forceStateWhenUnknownKey)
at Microsoft.EntityFrameworkCore.DbContext.SetEntityState(InternalEntityEntry entry, EntityState entityState)
at Microsoft.EntityFrameworkCore.DbContext.SetEntityState[TEntity](TEntity entity, EntityState entityState)
at Microsoft.EntityFrameworkCore.DbContext.Add[TEntity](TEntity entity)
at Microsoft.EntityFrameworkCore.Internal.InternalDbSet`1.Add(TEntity entity)
at Microsoft.ProjectConfig.Configuration.Sql.SqlConfigurationWriter`4.<AddOrUpdateSettingTypeImplAsync>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
at Microsoft.ProjectConfig.Configuration.ConfigurationWriterBase`4.<AddOrUpdateSettingTypeAsync>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
at Microsoft.ProjectConfig.Configuration.UnitTests.UnitTest1.<TestMethod1>d__0.MoveNext() in C:\Repos\ProjectConfig\UnitTestProject1\UnitTest1.cs:line 25
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.ThreadOperations.ExecuteWithAbortSafety(Action action)
Result Message:
Test method Microsoft.ProjectConfig.Configuration.UnitTests.UnitTest1.TestMethod1 threw exception:
System.IO.FileLoadException: Could not load file or assembly 'System.ValueTuple, Version=0.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
This issue is documented in the Entity Framework repository, here: https://github.com/aspnet/EntityFrameworkCore/issues/9046.
I'm catching the following exception on my cluster, randomly when an actor calls another one via ActorProxy:
System.Fabric.FabricObjectClosedException: The object is closed. ---> System.Runtime.InteropServices.COMException: Exception from HRESULT: 0x80071BFE
at System.Fabric.Interop.NativeRuntime.IFabricKeyValueStoreReplica6.CreateTransaction()
at System.Fabric.KeyValueStoreReplica.CreateTransactionHelper(KeyValueStoreTransactionSettings settings)
at System.Fabric.Interop.Utility.WrapNativeSyncInvoke[TResult](Func1 func, String functionTag, String functionArgs)
--- End of inner exception stack trace ---
at System.Fabric.Interop.Utility.WrapNativeSyncInvoke[TResult](Func1 func, String functionTag, String functionArgs)
at Microsoft.ServiceFabric.Actors.Runtime.KvsActorStateProvider.<>c__DisplayClass14.b__13()
at Microsoft.ServiceFabric.Actors.Runtime.ActorStateProviderHelper.d__61.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.ServiceFabric.Actors.Runtime.ActorStateManager.<ContainsStateAsync>d__17.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at PosteItaliane.Sin.StateManagement.ObservableState.SingleValueWrapper1.d__2.MoveNext() in C:\Users\maurosag\Source\Repos\Equitalia3\SIN\PI.Sin.StateManagement\ObservableState\SingleValueWrapper.cs:line 21
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at PosteItaliane.Sin.Utility.ServiceFabric.StatefulActor`1.get_State() ....
Searching on the web, i cannot figure out how to resolve it; the only discussions concern with Powershell exec:
“This means that this replica got demoted from primary to secondary. The client will re-resolve and reconnect to the new primary if you let the exception bubble up. The existing processing will drain on the primary. I am resolving the issue as "By Design". Please feel free to reopen if you still have question.”
Anyone can help me?
Thanks in advance.
We have a problem with a TFS 2015 installation, an upgrade from 2010. We ran into the following issue. This concerns a dry run, so we install everything on the same server, which is not a prefered method, we know.
• Installed new virtual server with Windows Server 2012 R2
• Added IIS feature
• Installed SQL server 2014
• Installed sharepoint foundation 2013 on the server
• Installed visual studio 2015 on the server
• Installed all the necessary .NET target frameworks
• Installed the prerequisites like MS Build tools 2015, Agents for Microsoft Visual Studio 2015
• Restored TFS2010 backups to new SQL server
• Installed tfs 2015 and ran the ‘Upgrade’ option in the setup
• Processed all the steps in configuration, like adding a build controller and build agent
• Dowloaded the Vso agent and ran the ‘ConfigureAgent.cmd’
• Configured the agent pool and queue in TFS
• Added an extra collection of team projects. So we have a collection of legacy upgraded projects from 2010, plus a collection of new team projects
• Administered the team projects, team members, etc.
• Created a XAML build definition, builds are done correctly on the server, tests are performed
However,
If I try to create a a new (non XAML) build definition using the deployment template (see images).
The problem occurs when we want to select a “Test Machine Group / Azure Resource Group”, for instance when selecting the location of testing. The select list is empty.
So we added machine groups using the ‘Manage’ option, and the machine group is available. However the dropdown list with machine groups stays empty, even after refresh (see images).
Next we checked the event logs fort his issue. On a refresh of the dropdownlist the following entries are made in the event log :
First :
- <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
- <System>
<Provider Name="Microsoft-Team Foundation Server" Guid="{80761876-6844-47D5-8106-F8ED2AA8687B}" />
<EventID>0</EventID>
<Version>3</Version>
<Level>2</Level>
<Task>1</Task>
<Opcode>10</Opcode>
<Keywords>0x8000000000000001</Keywords>
<TimeCreated SystemTime="2016-04-12T09:09:21.717163200Z" />
<EventRecordID>59666</EventRecordID>
<Correlation ActivityID="{6AD40FD3-10BA-4A7E-B6D9-F6926072DAB4}" />
<Execution ProcessID="3376" ThreadID="6484" />
<Channel>Microsoft-Team Foundation Server/Debug</Channel>
<Computer>KTBSV021.KTB.local</Computer>
<Security UserID="S-1-5-21-2105344776-4230907741-261866850-3716" />
</System>
- <UserData>
- <Info TraceId="{00000001-0001-0001-0000-000000000000}" xmlns="http://schemas.microsoft.com/TeamFoundation/2010/Framework">
<Tracepoint>0</Tracepoint>
<ServiceHost>{87670F79-6386-4363-9960-73B634419263}</ServiceHost>
<ContextId>10085</ContextId>
<ProcessName>w3wp</ProcessName>
<Username>KTB\tmpadmin</Username>
<VSID>{9E83242F-9944-4CBD-AF10-EF2D449A03B1}</VSID>
<Service>Web-Api</Service>
<Method>TaskDefinitionWebApiProxy.QueryEndpoint</Method>
<Area>DistributedTask</Area>
<Layer>WebApiProxy</Layer>
<UserAgent>Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko</UserAgent>
<Uri>/tfs/Default/_apis/distributedtask/endpoint</Uri>
<Path />
<UniqueIdentifier>{A9646429-41CB-4137-A39A-D4E29EDDC389}</UniqueIdentifier>
<UserDefined />
<ExceptionType>System.Net.WebException</ExceptionType>
<Message>System.Net.WebException: The remote server returned an error: (401) Unauthorized. at System.Net.HttpWebRequest.GetResponse() at Microsoft.TeamFoundation.DistributedTask.Server.WebApiProxy.HttpRequestProxy.ExecuteRequest(HttpRequestMessage requestMessage, IList`1 sourceDefinitions, DataSource dataSource)</Message>
</Info>
</UserData>
</Event>
Second:
- <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
- <System>
<Provider Name="Microsoft-Team Foundation Server" Guid="{80761876-6844-47D5-8106-F8ED2AA8687B}" />
<EventID>0</EventID>
<Version>3</Version>
<Level>2</Level>
<Task>1</Task>
<Opcode>10</Opcode>
<Keywords>0x8000000000000001</Keywords>
<TimeCreated SystemTime="2016-04-12T09:09:21.717163200Z" />
<EventRecordID>59667</EventRecordID>
<Correlation ActivityID="{6AD40FD3-10BA-4A7E-B6D9-F6926072DAB4}" />
<Execution ProcessID="3376" ThreadID="6484" />
<Channel>Microsoft-Team Foundation Server/Debug</Channel>
<Computer>KTBSV021.KTB.local</Computer>
<Security UserID="S-1-5-21-2105344776-4230907741-261866850-3716" />
</System>
- <UserData>
- <Info TraceId="{00000001-0001-0001-0000-000000000000}" xmlns="http://schemas.microsoft.com/TeamFoundation/2010/Framework">
<Tracepoint>103200</Tracepoint>
<ServiceHost>{87670F79-6386-4363-9960-73B634419263}</ServiceHost>
<ContextId>10082</ContextId>
<ProcessName>w3wp</ProcessName>
<Username>KTB\tmpadmin</Username>
<VSID>{9E83242F-9944-4CBD-AF10-EF2D449A03B1}</VSID>
<Service>Web-Api</Service>
<Method>TaskDefinitionWebApiProxy.QueryEndpoint</Method>
<Area>DistributedTask</Area>
<Layer>TaskDefinitionWebApiProxy</Layer>
<UserAgent>Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko</UserAgent>
<Uri>/tfs/Default/_apis/distributedtask/endpoint</Uri>
<Path />
<UniqueIdentifier>{A9646429-41CB-4137-A39A-D4E29EDDC389}</UniqueIdentifier>
<UserDefined />
<ExceptionType>Microsoft.TeamFoundation.DistributedTask.WebApi.ServiceEndpointQueryFailedException</ExceptionType>
<Message>Microsoft.TeamFoundation.DistributedTask.WebApi.ServiceEndpointQueryFailedException: The remote server returned an error: (401) Unauthorized. at Microsoft.TeamFoundation.DistributedTask.Server.WebApiProxy.HttpRequestProxy.ExecuteRequest(HttpRequestMessage requestMessage, IList`1 sourceDefinitions, DataSource dataSource) at Microsoft.TeamFoundation.DistributedTask.Server.Controllers.TaskDefinitionWebApiProxyController.QueryEndpoint(TaskDefinitionEndpoint endpoint) at lambda_method(Closure , Object , Object[] ) at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters) at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__0.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__0.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__0.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Filters.AuthorizationFilterAttribute.<ExecuteAuthorizationFilterAsyncCore>d__2.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Filters.AuthorizationFilterAttribute.<ExecuteAuthorizationFilterAsyncCore>d__2.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__0.MoveNext()</Message>
</Info>
</UserData>
</Event>
Fiddler reports it is the following request is failing :
POST http://localhost:8080/tfs/Default/_apis/distributedtask/endpoint HTTP/1.1
• Powershell Remote has been enabled on the server.
• The service account has been added to the role in the agent pool.
It is obviously a security issue. What are we forgetting or doing wrong ?
Your issue is kinda like this post. You may try the solution in this case to add TFS service account to C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys with full access so that the service can access all the certificates.
But first of all, try to re-deploy the agent with your account that should have been added as a team project collection administrator or an agent pool administrator.