C# UserCredential issue on refreshing token in Parallel context - linq

The web application is written with C# framework net45.
The credentials are retrieved by this code:
private Task<UserCredential> GetCredentialByJSONAsync(FileInfo clientSecrets)
{
using (var stream = new FileStream(clientSecrets.FullName, FileMode.Open, FileAccess.Read))
{
var secrets = GoogleClientSecrets.Load(stream).Secrets;
var credentialsDS = new FileDataStore(_credentials, true);
return GoogleWebAuthorizationBroker.AuthorizeAsync(
secrets,
_scopes,
"user",
CancellationToken.None,
credentialsDS);
}
}
In a LINQ parallel context I get recursively the list of files to recreate the structure of the directory but sometimes happens that I receive an error:
The process cannot access the file
'Google.Apis.Auth.OAuth2.Responses.TokenResponse-user'
because it is being used by another process.
The error stacktrace is this:
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess
access, Int32 rights, Boolean useRights, FileShare share, Int32
bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String
msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess
access, FileShare share, Int32 bufferSize, FileOptions options, String
msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding
encoding, Int32 bufferSize, Boolean checkHost) at
System.IO.File.InternalWriteAllText(String path, String contents,
Encoding encoding, Boolean checkHost) at
Google.Apis.Util.Store.FileDataStore.StoreAsync[T](String key, T
value) at
Google.Apis.Auth.OAuth2.Flows.AuthorizationCodeFlow.d__34.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
Google.Apis.Auth.OAuth2.Flows.AuthorizationCodeFlow.d__31.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 Google.Apis.Auth.OAuth2.UserCredential.d__22.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 Google.Apis.Auth.OAuth2.TokenRefreshManager.d__12.MoveNext()
--- End of stack trace from previous location where exception was thrown --- at
Google.Apis.Auth.OAuth2.TokenRefreshManager.ResultWithUnwrappedExceptions[T](Task1 task) at System.Threading.Tasks.ContinuationResultTaskFromResultTask2.InnerInvoke()
at System.Threading.Tasks.Task.Execute() --- 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 Google.Apis.Auth.OAuth2.TokenRefreshManager.d__10.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 Google.Apis.Auth.OAuth2.UserCredential.d__21.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.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult() at Google.Apis.Auth.OAuth2.UserCredential.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 Google.Apis.Http.ConfigurableMessageHandler.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 Google.Apis.Http.ConfigurableMessageHandler.d__69.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 Google.Apis.Requests.ClientServiceRequest1.d__34.MoveNext()
--- End of stack trace from previous location where exception was thrown --- at
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at
Google.Apis.Requests.ClientServiceRequest1.Execute() at Google.Apis.Requests.PageStreamer4.d__5.MoveNext() at
Imerys.Utilities.GoogleServices.Services.GoogleDriveService.GetFileList(FilesListOptionalParams
optional)
Do I need to manage the credentials file or does a solution already exist?

Related

System.Runtime.InteropServices.COMException in visual studio log file

I use visual studio 2019. When I open my solution, sometime I can see this alert:
If I click by Open log btn, I can see a log with the following exception:
System.AggregateException: One or more errors occurred. ---> System.Runtime.InteropServices.COMException: Element not found. (Exception from HRESULT: 0x80070490)
at Microsoft.VisualStudio.Setup.Configuration.ISetupConfiguration.GetInstanceForCurrentProcess()
at Microsoft.VisualStudio.ProjectSystem.VS.DotNetCoreProjectCompatibilityDetector.<IsPrereleaseAsync>d__44.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.VisualStudio.ProjectSystem.VS.DotNetCoreProjectCompatibilityDetector.<IsPreviewSDKInUseAsync>d__43.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.VisualStudio.ProjectSystem.VS.DotNetCoreProjectCompatibilityDetector.<CheckCompatibilityAsync>d__47.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.VisualStudio.ProjectSystem.VS.DotNetCoreProjectCompatibilityDetector.<<InitializeAsync>b__40_0>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.VisualStudio.ProjectSystem.ProjectMultiThreadedService.<>c__DisplayClass31_0.<<Fork>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.VisualStudio.ProjectSystem.CommonProjectSystemTools.Rethrow(Exception ex)
at Microsoft.VisualStudio.ProjectSystem.ProjectErrorReporting.<>c__DisplayClass6_0.<SubmitErrorReport>b__0()
at Microsoft.VisualStudio.ProjectSystem.ExceptionFilter.<>c__DisplayClass2_0.<Guard>g__action|0()
at GuardMethodClass.GuardMethod(Func`1 , Func`2 , Func`2 )
--- End of inner exception stack trace ---
---> (Inner Exception #0) System.Runtime.InteropServices.COMException (0x80070490): Элемент не найден. (Exception from HRESULT: 0x80070490)
at Microsoft.VisualStudio.Setup.Configuration.ISetupConfiguration.GetInstanceForCurrentProcess()
at Microsoft.VisualStudio.ProjectSystem.VS.DotNetCoreProjectCompatibilityDetector.<IsPrereleaseAsync>d__44.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.VisualStudio.ProjectSystem.VS.DotNetCoreProjectCompatibilityDetector.<IsPreviewSDKInUseAsync>d__43.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.VisualStudio.ProjectSystem.VS.DotNetCoreProjectCompatibilityDetector.<CheckCompatibilityAsync>d__47.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.VisualStudio.ProjectSystem.VS.DotNetCoreProjectCompatibilityDetector.<<InitializeAsync>b__40_0>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.VisualStudio.ProjectSystem.ProjectMultiThreadedService.<>c__DisplayClass31_0.<<Fork>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.VisualStudio.ProjectSystem.CommonProjectSystemTools.Rethrow(Exception ex)
at Microsoft.VisualStudio.ProjectSystem.ProjectErrorReporting.<>c__DisplayClass6_0.<SubmitErrorReport>b__0()
at Microsoft.VisualStudio.ProjectSystem.ExceptionFilter.<>c__DisplayClass2_0.<Guard>g__action|0()
at GuardMethodClass.GuardMethod(Func`1 , Func`2 , Func`2 )<---
===================
So, actually, it was not a problem for me, before this time. Now I need to install this plugin. And it seems to me, this error prevent for correct installation.
I go to Extensions -> Marketplace -> type "typewriter" - plugin name. Then I press Download. After this I try to restart Visual Studio. Finally, I see the following message:
"Элемент не найден" - means: element not found.
I press on the View install log and again, I see exception about COM:
08.10.2020 16:38:48 - System.Runtime.InteropServices.COMException (0x80070490): Элемент не найден. (Exception from HRESULT: 0x80070490)
в Microsoft.VisualStudio.Setup.Configuration.ISetupConfiguration2.GetInstanceForPath(String path)
в VSIXInstaller.LocationBasedSKU..ctor(String appidInstallPath, String appidName, Version vsVersion, String edition, String rootSuffix)
в VSIXInstaller.LocationBasedSKU..ctor(String appidInstallPath, String appidName, Version vsVersion, String edition, String rootSuffix, IntPtr alternateUserToken)
в VSIXInstaller.ExtensionService.GetInstallableDataImpl(IInstallableExtension extension, String extensionPackParentName, Boolean isRepairSupported, IStateData stateData, IEnumerable`1& skuData)
в VSIXInstaller.ExtensionService.GetInstallableData(String vsixPath, String extensionPackParentName, Boolean isRepairSupported, IStateData stateData, IEnumerable`1& skuData)
в VSIXInstaller.ExtensionService.ComputeInstallableExtensions(IStateData stateData, Boolean isRepairSupported, Boolean isExtensionPack, IDictionary`2 skuDataMapping, IList`1 installableExtensionsPaths)
в VSIXInstaller.App.Initialize(Boolean isRepairSupported)
в VSIXInstaller.App.Initialize()
в System.Threading.Tasks.Task`1.InnerInvoke()
в System.Threading.Tasks.Task.Execute()
So what is wrong?
Full visual studio reinstall solved my problem! And don't remove installation cache according to this

Operation is not valid due to the current state of the object

An error has occurred.
Operation is not valid due to the current state of the object.
System.InvalidOperationException
at
Microsoft.Bot.Builder.Dialogs.Conversation.<>c__31.<ResumeAsync>b__3_0()
at
Microsoft.Bot.Builder.Dialogs.Internals.ReactiveDialogTask.<Microsoft-Bot-Builder-Dialogs-Internals-IPostToBot-PostAsync>d__31.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.Bot.Builder.Dialogs.Internals.ScoringDialogTask1.<Microsoft-Bot-Builder-Dialogs-Internals-IPostToBot-PostAsync>d__31.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.Bot.Builder.Dialogs.Internals.PersistentDialogTask.d__31.MoveNext()
--- End of stack trace from previous location where exception was thrown --- at
Microsoft.Bot.Builder.Dialogs.Internals.PersistentDialogTask.<Microsoft-Bot-Builder-Dialogs-Internals-IPostToBot-PostAsync>d__31.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.Bot.Builder.Dialogs.Internals.SerializingDialogTask.d__41.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.Bot.Builder.Dialogs.Internals.ExceptionTranslationDialogTask.<Microsoft-Bot-Builder-Dialogs-Internals-IPostToBot-PostAsync>d__21.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.Bot.Builder.Dialogs.Internals.LocalizedDialogTask.d__21.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.Bot.Builder.Dialogs.Internals.PostUnhandledExceptionToUserTask.<Microsoft-Bot-Builder-Dialogs-Internals-IPostToBot-PostAsync>d__51.MoveNext()
--- End of stack trace from previous location where exception was thrown --- at
Microsoft.Bot.Builder.Dialogs.Internals.PostUnhandledExceptionToUserTask.d__51.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.Bot.Builder.Dialogs.Internals.LogPostToBot.<Microsoft-Bot-Builder-Dialogs-Internals-IPostToBot-PostAsync>d__31.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.Bot.Builder.Dialogs.Conversation.d__51.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.Bot.Builder.Dialogs.Conversation.<ResumeAsync>d__31.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
BotApplication.Controllers.OAuthCallbackController.d__0.MoveNext()
in
C:\BotApplication\BotApplication\Controllers\OAuthCallbackController.cs:line
55 --- 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.Threading.Tasks.TaskHelpersExtensions.d__3`1.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.ApiControllerActionInvoker.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.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.Dispatcher.HttpControllerDispatcher.d__1.MoveNext()
This is happening when i'm trying to resume a conversation after user authentication.
I call authentication this way :
In my first dialog :
var message = context.MakeMessage();
await context.Forward(new SecondDialog(), HandleOptions, message, CancellationToken.None);
Then in my SecondDialog have this :
var message = await argument;
MyStaticModel.toId = message.From.Id;
MyStaticModel.toName = message.From.Name;
MyStaticModel.fromId = message.Recipient.Id;
MyStaticModel.fromName = message.Recipient.Name;
MyStaticModel.serviceUrl = message.ServiceUrl;
MyStaticModel.channelId = message.ChannelId;
MyStaticModel.conversationId = message.Conversation.Id;
await context.Forward(new SimpleFacebookAuthDialog(message), ResumeAfterLogIn, message, CancellationToken.None);
In my Facebook Dialog i make resumption cookie this way :
public SimpleFacebookAuthDialog(IMessageActivity msg)
{
ResumptionCookie = new ResumptionCookie(msg);
}
And when user authenticate i handle authentication :
public async Task<HttpResponseMessage> OAuthCallback([FromUri] string userId, [FromUri] string botId, [FromUri] string conversationId, [FromUri] string channelId, [FromUri] string serviceUrl, [FromUri] string locale, [FromUri] string code, [FromUri] string state, CancellationToken token)
{
//Get the resumption cookie
Address address = new Address
(
// purposefully using named arguments because these all have the same type
botId: FacebookHelpers.TokenDecoder(botId),
channelId: channelId,
userId: FacebookHelpers.TokenDecoder(userId),
conversationId: FacebookHelpers.TokenDecoder(conversationId),
serviceUrl: FacebookHelpers.TokenDecoder(serviceUrl)
);
//var resumptionCookie = new ResumptionCookie(FacebookHelpers.TokenDecoder(userId), FacebookHelpers.TokenDecoder(botId), FacebookHelpers.TokenDecoder(conversationId), channelId, FacebookHelpers.TokenDecoder(serviceUrl), locale: locale);
var resumptionCookie = new ResumptionCookie(address, userName: null, isGroup: false, locale: locale);
// Exchange the Facebook Auth code with Access token
var accessToken = await FacebookHelpers.ExchangeCodeForAccessToken(resumptionCookie, code, SimpleFacebookAuthDialog.FacebookOauthCallback.ToString());
// Create the message that is send to conversation to resume the login flow
var msg = resumptionCookie.GetMessage();
msg.Text = $"token:{accessToken.AccessToken}";
// Resume the conversation to SimpleFacebookAuthDialog
await Conversation.ResumeAsync(resumptionCookie, msg, CancellationToken.None);
It falls on the last line of code. When Resuming conversation.
Any help ?
I got the same error when I run tests in vs 2019.
I could solve this by cleaning the solution ,closing vs and deleting temp files anf re launching vs-2019.
I followed the link https://developercommunity.visualstudio.com/content/problem/875545/xunit-test-net-core-project-with-vs-2019-is-throwi.html
I fix this guys.
I don't know what the real reason is, but when i used to await for argument and store it as a message, later, parameters were wrong in resumption cookie.
Now, i cast argument as activity :
var message = (Activity)context.Activity;
And it works properly.
Problem solved :)
I got this error message when attempting to display adaptive cards. It turned out I had added the json files to the solution as content and not as embedded resources. After switching them to be embedded resources they displayed fine.

Visual Studio 2013 gives error message when try to save

I am using Visual Studio 2013. A couple of days ago, my computer shutted down accidentally after that I always get error when I try to save my visual studio files.It saves but it gives error message.
The log file is
27.5.2016 09:47:43
Recoverable
System.AggregateException: One or more errors occurred. ---> Microsoft.Assumes+InternalErrorException: An internal error occurred. Please contact Microsoft Product Support Services.
at Microsoft.Assumes.Fail(String message, Boolean showAssert)
at Microsoft.Assumes.NotNull[T](T value)
at Microsoft.VisualStudio.ProjectSystem.Designers.ProjectDirectoryTreeProvider.<ProcessFileEventsAddFileAsync>d__5c.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.VisualStudio.ProjectSystem.Designers.ProjectDirectoryTreeProvider.<ProcessFileEventsAsync>d__4c.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.VisualStudio.ProjectSystem.Utilities.Designers.ProjectTreeProviderBase.<>c__DisplayClass9.<<Initialize>b__5>d__b.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.VisualStudio.ProjectSystem.Utilities.CommonProjectSystemTools.Rethrow(Exception ex)
at Microsoft.VisualStudio.ProjectSystem.ProjectErrorReporting.<>c__DisplayClass5.<SubmitErrorReport>b__3()
at Microsoft.VisualStudio.ProjectSystem.ExceptionFilter.<>c__DisplayClass2.<Guard>b__0()
at GuardMethodClass.GuardMethod(Func`1 , Func`2 , Func`2 )
--- End of inner exception stack trace ---
---> (Inner Exception #0) Microsoft.Assumes+InternalErrorException: An internal error occurred. Please contact Microsoft Product Support Services.
at Microsoft.Assumes.Fail(String message, Boolean showAssert)
at Microsoft.Assumes.NotNull[T](T value)
at Microsoft.VisualStudio.ProjectSystem.Designers.ProjectDirectoryTreeProvider.<ProcessFileEventsAddFileAsync>d__5c.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.VisualStudio.ProjectSystem.Designers.ProjectDirectoryTreeProvider.<ProcessFileEventsAsync>d__4c.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.VisualStudio.ProjectSystem.Utilities.Designers.ProjectTreeProviderBase.<>c__DisplayClass9.<<Initialize>b__5>d__b.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.VisualStudio.ProjectSystem.Utilities.CommonProjectSystemTools.Rethrow(Exception ex)
at Microsoft.VisualStudio.ProjectSystem.ProjectErrorReporting.<>c__DisplayClass5.<SubmitErrorReport>b__3()
at Microsoft.VisualStudio.ProjectSystem.ExceptionFilter.<>c__DisplayClass2.<Guard>b__0()
at GuardMethodClass.GuardMethod(Func`1 , Func`2 , Func`2 )<---
===================
27.5.2016 10:00:24
Recoverable
System.AggregateException: One or more errors occurred. ---> Microsoft.Assumes+InternalErrorException: An internal error occurred. Please contact Microsoft Product Support Services.
at Microsoft.Assumes.Fail(String message, Boolean showAssert)
at Microsoft.Assumes.NotNull[T](T value)
at Microsoft.VisualStudio.ProjectSystem.Designers.ProjectDirectoryTreeProvider.<ProcessFileEventsAddFileAsync>d__5c.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.VisualStudio.ProjectSystem.Designers.ProjectDirectoryTreeProvider.<ProcessFileEventsAsync>d__4c.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.VisualStudio.ProjectSystem.Utilities.Designers.ProjectTreeProviderBase.<>c__DisplayClass9.<<Initialize>b__5>d__b.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.VisualStudio.ProjectSystem.Utilities.CommonProjectSystemTools.Rethrow(Exception ex)
at Microsoft.VisualStudio.ProjectSystem.ProjectErrorReporting.<>c__DisplayClass5.<SubmitErrorReport>b__3()
at Microsoft.VisualStudio.ProjectSystem.ExceptionFilter.<>c__DisplayClass2.<Guard>b__0()
at GuardMethodClass.GuardMethod(Func`1 , Func`2 , Func`2 )
--- End of inner exception stack trace ---
---> (Inner Exception #0) Microsoft.Assumes+InternalErrorException: An internal error occurred. Please contact Microsoft Product Support Services.
at Microsoft.Assumes.Fail(String message, Boolean showAssert)
at Microsoft.Assumes.NotNull[T](T value)
at Microsoft.VisualStudio.ProjectSystem.Designers.ProjectDirectoryTreeProvider.<ProcessFileEventsAddFileAsync>d__5c.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.VisualStudio.ProjectSystem.Designers.ProjectDirectoryTreeProvider.<ProcessFileEventsAsync>d__4c.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.VisualStudio.ProjectSystem.Utilities.Designers.ProjectTreeProviderBase.<>c__DisplayClass9.<<Initialize>b__5>d__b.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.VisualStudio.ProjectSystem.Utilities.CommonProjectSystemTools.Rethrow(Exception ex)
at Microsoft.VisualStudio.ProjectSystem.ProjectErrorReporting.<>c__DisplayClass5.<SubmitErrorReport>b__3()
at Microsoft.VisualStudio.ProjectSystem.ExceptionFilter.<>c__DisplayClass2.<Guard>b__0()
at GuardMethodClass.GuardMethod(Func`1 , Func`2 , Func`2 )
<---
===================
I wonder if there is any solution.
Thank you

Nhibernate - Unable to query IN operation

Here is my requirement
I have a list of location Ids. I need to return all entities where entity.Location.Id in [list of Location Ids]
Query used
var res = from m in queryable
from id in locations
where m.Location.Id == id
select m;
queryable is IQueryable<Entity> returned from NHibernate Repository
locations is an integer list of IDs.
The above query throws an error.
"Specified method is not supported."
Any help appreciated.
System.RuntimeMethodHandle.InvokeMethod(Object target, Object[]
arguments, Signature sig, Boolean constructor) at
System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj,
Object[] parameters, Object[] arguments) at
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags
invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at
System.Web.Http.OData.Query.InlineCountQueryOption.GetEntityCount(IQueryable
query) at
System.Web.Http.OData.Query.ODataQueryOptions.ApplyTo(IQueryable
query, ODataQuerySettings querySettings) at
System.Web.Http.QueryableAttribute.ExecuteQuery(Object response,
HttpRequestMessage request, HttpActionDescriptor actionDescriptor) at
System.Web.Http.QueryableAttribute.OnActionExecuted(HttpActionExecutedContext
actionExecutedContext) at
System.Web.Http.Filters.ActionFilterAttribute.OnActionExecutedAsync(HttpActionExecutedContext
actionExecutedContext, 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.Filters.ActionFilterAttribute.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.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.Runtime.CompilerServices.TaskAwaiter`1.GetResult() at
System.Web.Http.Filters.ActionFilterAttribute.d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown --- at
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at
System.Web.Http.Filters.ActionFilterAttribute.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.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.
The correct way of doing what you want is:
var res = from m in queryable
where locations.Contains(m.Location.Id)
select m;

VS2013 Update2 RC Support for SCSS

VS2013 Update 2 claims SCSS support, and indeed I get intellisense which is great. However, scss files are not built into either .css or .min.css files. Is there a step I'm missing or something else I need to install?
The project was originally a VS2011 project where I was using VisualWorkbench for SCSS. This is a new VS2013 install and the project has been upgraded, however, the same thing (no output) seems to happen in a file-new-project scenario.
EDIT
I see now that I need to add the webessentials extension to get compilation. However, this now throws an exception on compilation
17/04/2014 10:43:35: SCSS: Compiling beko_v6.scss
17/04/2014 10:43:36: SCSS: beko_v6.scss compiled.
17/04/2014 10:43:42: An exception was thrown when compiling C:\Data\LocalProjects\Beko2011Azure\Beko2011Azure\Website\Content\beko_v6.scss: System.NullReferenceException: Object reference not set to an instance of an object.
at MadsKristensen.EditorExtensions.CssSourceMap.CorrectionsForScss(String cssFileContents)
at MadsKristensen.EditorExtensions.CssSourceMap.CollectRules(String targetFileName)
at MadsKristensen.EditorExtensions.CssSourceMap.PopulateMap(String targetFileName, String mapFileName)
at MadsKristensen.EditorExtensions.CssSourceMap.Initialize(String targetFileName, String mapFileName, IContentType contentType)
at MadsKristensen.EditorExtensions.CssCompilerResult..ctor(String sourceFileName, String targetFileName, String mapFileName, Boolean isSuccess, String result, IEnumerable`1 errors)
at MadsKristensen.EditorExtensions.CompilerResultFactory.GenerateResult(String sourceFileName, String targetFileName, String mapFileName, Boolean isSuccess, String result, IEnumerable`1 errors)
at MadsKristensen.EditorExtensions.NodeExecutorBase.ProcessResult(Process process, String errorText, String sourceFileName, String targetFileName, String mapFileName)
at MadsKristensen.EditorExtensions.NodeExecutorBase.d__1.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 MadsKristensen.EditorExtensions.Compilers.NodeCompilerRunner.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 MadsKristensen.EditorExtensions.Compilers.CompilerRunnerBase.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 MadsKristensen.EditorExtensions.Compilers.EditorCompilerInvoker.d__0.MoveNext()
17/04/2014 10:43:42: An exception was thrown when compiling C:\Data\LocalProjects\Beko2011Azure\Beko2011Azure\Website\Content\beko_v6.scss: System.NullReferenceException: Object reference not set to an instance of an object.
at MadsKristensen.EditorExtensions.CssSourceMap.CorrectionsForScss(String cssFileContents)
at MadsKristensen.EditorExtensions.CssSourceMap.CollectRules(String targetFileName)
at MadsKristensen.EditorExtensions.CssSourceMap.PopulateMap(String targetFileName, String mapFileName)
at MadsKristensen.EditorExtensions.CssSourceMap.Initialize(String targetFileName, String mapFileName, IContentType contentType)
at MadsKristensen.EditorExtensions.CssCompilerResult..ctor(String sourceFileName, String targetFileName, String mapFileName, Boolean isSuccess, String result, IEnumerable`1 errors)
at MadsKristensen.EditorExtensions.CompilerResultFactory.GenerateResult(String sourceFileName, String targetFileName, String mapFileName, Boolean isSuccess, String result, IEnumerable`1 errors)
at MadsKristensen.EditorExtensions.NodeExecutorBase.ProcessResult(Process process, String errorText, String sourceFileName, String targetFileName, String mapFileName)
at MadsKristensen.EditorExtensions.NodeExecutorBase.d__1.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 MadsKristensen.EditorExtensions.Compilers.NodeCompilerRunner.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 MadsKristensen.EditorExtensions.Compilers.CompilerRunnerBase.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 MadsKristensen.EditorExtensions.Compilers.EditorCompilerInvoker.d__0.MoveNext()
#vulcanRaven (and Mads via twitter) are right. The nightly build avoids this. To install
http://vswebessentials.com/download#nightly
As well as those instructions you also have to go back into "Extensions and Updates" then online then install the WebEssentials from the newly created WebEssentials Nightly feed.

Resources