Method not found: 'Void Lucene.Net.Store.Azure.AzureDirectory..ctor(Microsoft.WindowsAzure.Storage.CloudStorageAccount, System.String)' - azure

I have the following solution deployed to Azure. It basically is a website to add and edit user information. It uses a Azure table storage for data access.
Recently I started adding search functionality using Lucene.net and more specifcally Lucene.Net.Store.Azure.
<package id="Lucene.Net.Store.Azure" version="3.0.5553.21100" targetFramework="net451" />
I have developed it locally against an existing Azure storage container and it works. I'm able to build the index and can query it.
I just published the new version to Azure, and it behaves differently from the local code. I now get a runtime error that it can't find a method, more specifically the constructor.
Method not found: 'Void Lucene.Net.Store.Azure.AzureDirectory..ctor(Microsoft.WindowsAzure.Storage.CloudStorageAccount, System.String)'
It is addressed (some code omitted for brevity), like this.
private AzureDirectory _azureDirectory;
CloudStorageAccount cloudAccount = CloudStorageAccount.Parse(settings.Endpoint);
_azureDirectory = new AzureDirectory(cloudAccount, "storagename");
it's from this nuget https://azuredirectory.codeplex.com/
Maybe someone can pinpoint me in the right direction.
Basically what is happening is that the version of Lucene.net.Store.Azure used by Azure is a different version than I'm using locally? Is this assumption correct, and how can I check the Azure version?
Is this because of the difference in .Net framework of the Azure server and my local development?
How can this be fixed?
any help appreciated

Related

EventLog access is not supported on this platform when calling dependency from Azure Function

I am trying to create an azure function (v2) but it needs to reference an existing class library which is built for .netframework and is currently used for a .net web project. In the referenced library a lot of code is wrapped in try / catches where we log the exception to the EventLog.
My question is, how can I make it so that the referenced library handles the EventLog code or is this something that is not possible?
I have tried calling event log directly from a simple function (i.e. EventLog.WriteEntry(...) but that causes the same error: EventLog access is not supported on this platform. I take it, this is because its expecting me to use the built in ILogger instance to perform the logging...
I've read that we can add the Nuget package for compatibility and also one for EventLog. Tried both and still no luck...

Azure Functions V1 linking wrong version of the RestSharp.dll

Guys I know that the azure functions cli has a dependency with RestSharp.dll and I think that is conflicting with one of my Azure Functions.
I am getting a runtime type exception
System.TypeLoadException: 'Could not load type 'RestSharp.IAuthenticator' from assembly 'RestSharp, Version=105.2.3.0, Culture=neutral, PublicKeyToken=null'.'
Now my azure function is dependent on RestSharp nuget Version 104.4.0.0. There is no reference in my project to Version 105.2.3.0. Here is the interesting thing. In my despair I searched my entire computer for the culprit dll version 105.2.3.0 and I found it at AppData\local\Azure.Functions.Cli\1.0.12
Is that it ? Is the Azure functions runtime trying to link with its RestSharp.dll version instead of the dll version of my project ?
Runtime should technically load version 104.4.0.0. However it is still loading the version referred by the runtime (105.2.3.0). I was able to verify this behavior. Have filed a bug for this https://github.com/Azure/azure-functions-host/issues/2832.
In the meantime is it possible to do one of the following:
Update the code to use 105.2.3.0, I see RestSharp.IAuthenticator type is present. It is under a different namespace. There should be another method exposing the same functionality
If the function app is not being used in prod. You could use the beta runtime. You should not encounter this issue in beta runtime (v2.x)

Azure Web Deploy "Could not find a part of the path 'D:\home\site\wwwroot\bin\roslyn\csc.exe'."

I've been browsing the web for a couple hours now looking for an answer to my problem. I am trying to deploy a Web API on Azure Web App Service using VS2017. Everything builds and works fine when running locally but once deployed on Azure (through VS2017) I get this error:
D:\home\site\wwwroot\bin\roslyn\csc.exe
My project is an ASP.NET Web Application (Using Azure Web API template) .NET Framework 4.6.1. I use Microsoft.CodeDom.Providers.DotNetCompilerPlatform Version=1.0.6.0
I also made sure that csc.exe is located in:
Visual Studio 2017\Projects\DeviceManagementAPI\DeviceManagementAPI\bin\roslyn
Just had the same problem and it seems it's a known issue with Microsoft.CodeDom.Providers.DotNetCompilerPlatform 1.0.6 and 1.0.7.
Downgrading to 1.0.5 solves the problem.
Upgrading Microsoft.CodeDom.Providers.DotNetCompilerPlatform to 1.08 worked for me
After a while I simply uploaded manually the roslyn file directly into the server through Kudu. It seems to solve the problem but I still don't know why it won't upload automatically.
Same issue might be caused by missing or incorrect relative packages path. If you're changing solution folder structure make sure all imports have proper path's to avoid missing Roslyn files.
Generally suggest to replace auto-generated ../../../packages/... rabit hole with parameter which will point to correct Nuget folder.
<Import Project="$(NugetPackagesPath)\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.8\build\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props" Condition="Exists('$(NugetPackagesPath)\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.8\build\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" />

Xamarin Forms unable to resolve Azure storage from nuget package

I'm trying to upload a blob to azure using a shared access signature. I have the token and added the nuget package WindowsAzure.Storage to my project. I've tried both version 7.0.0 and 7.0.1-preview.
For some reason I'm unable to resolve the reference when creating an instance of CloudBlobContainer. Also I've tried to just type the using statement but no luck. All azure documentation points to a version 4.4.0-preview, is this the one I should be using?
azure doc ref https://azure.microsoft.com/da-dk/documentation/articles/storage-xamarin-blob-storage/
Best regards
I would just guess that the docs are outdated with the 4.4.0-preview link instead of a link to the NuGet package:
https://www.nuget.org/packages/WindowsAzure.Storage/
CloudBlobContainer seems to be within the Microsoft.WindowsAzure.Storage.Blob namespace.
I would check to ensure that you actually installed the NuGet package as it may have failed silently with other projects.
EX: http://screencast.com/t/FLhztkeu
Changing the PCL profile worked for me. Bizarre.
After installing the NuGet package, you actually need to change the profile on your Xamarin project. You can do this by going to the shared project -> Options -> General – > C#
Change the Current Profile to PCL 4.5 – Profile111 (I have no idea
of what this does.)
You need to retarget your NuGet packages for this new profile now.
Right click on Packages within the shared project, and you’ll have 5
options here.
Retarget will be available. Click that. (Not shown here, as I’ve
already retargeted)
Rebuild your project
How I figured this out
I stumbled across this Xamarin forum post, where someone had the exact same issue. One user pointed us towards a bug report, where PCL references were not added automatically via NuGet package installation. They recommended retargeting, and it worked! Now I can include the using Microsoft.WindowsAzure.Storage.Blob; namespace.
I have a blog post with more info on this.

Missing Documentation for web.config for a Node.js application on Azure Website

I'm running a Node.js server as API for my mobile app on a Windows Azure Website. And I'm having some trouble with it due to the needed web.config - but I couldn't find any really helpful documentation about it. Everything I can find is googling for specific problems on it and with a bit luck I can use the config snippets.
is there any general documentation about the contents the web.config can contain and their meaning?
in the start I had the problem that errors were modified by IIS to a general error. But since it's a REST API I want the HTTP status codes to be returned. I got around that with the <httpErrors existingResponse="PassThrough" /> element, but it doesn't seem to work for every error.
The only documentation I found so far are example configuration files of the iisnode module.
If you see the following error:
web.config not found in project, to create a project to deploy to
Windows Azure you must create a Windows Azure Node.js project.
....you may have created the wrong type of Visual Studio Project. You want a "Windows Azure Node.js Application" not a "Node.js Web Application". The former creates a few extra files that are needed for Azure (Web.cloud.config & Web.config).
You may be able to create a dummy VS project of the correct type and then copy these files into your existing project. Alternatively create a new project of the correct type and copy your source files into the new project.
Create Azure Basic Node.js Express Application

Resources