MEF doesn't discover assemblies when published to live - mef

I have a WCF service which use MEF to discover assemblies used in bin folder. When i run the WCF service in local a client application can access it without problem all the assemblies are discovered by MEF but when i publish the WCF service to Live server MEF doesn't discover some assemblies at run time i get
Object Reference errors.Your help is very much appreciated

I actually resolved the issue using Mefx and log4net it was some dll weren't copied correctly to live when publishing and some access rights issues
If anybody get this issue they should use MEFx here is the links that helped me
http://msdn.microsoft.com/en-us/library/ff576068(v=vs.110).aspx
http://blogs.msdn.com/b/dsplaisted/archive/2010/07/13/how-to-debug-and-diagnose-mef-failures.aspx

Related

Service Fabric .NET Framework services and ApplicationInsights.config endpoints for Azure gov

I have a service fabric application that hosts api’s with app insights enabled. The api services are .Net framework 4.8 webapi projects and they are native fabric stateless and stateful services. I don’t use the app insights service fabric specific packages, but do have the standard app insights for webapi packages. I have always been in Azure commercial and logs have worked just fine there.
Now that we are in azure gov, the only way to point a .Net Framework app to the gov app insights endpoints is by modifying the ApplicationInsights.config file.
So I’ve modified the file as per msdn, verified it is deployed with the fabric deploy package and its there next to the rest of the dlls on the vms. Yet my services still won’t log to azure gov app insight instances. Nothing is coming through. We set the instrumentation key programmatically, not in applicationinsights.config, could that be an issue? I noticed some of the msdn examples showed instrumentationkey being included in the config file, but would think that is optional.
Had anyone had experience pointing .net 4.8 fabric services to gov app insights?
When using a government cloud, you need to use a connection string instead of an instrumentation key.
Important
Sovereign clouds, such as Azure Government, require the use of the
Application Insights connection string
(APPLICATIONINSIGHTS_CONNECTION_STRING) instead of the instrumentation
key. To learn more, see the APPLICATIONINSIGHTS_CONNECTION_STRING
reference.
More info here and here.
This ended up being an issue with my gov configuration file. The MSDN document wasn't very clear on where the new config sections go. It made it look like they are all nested under the top level node of the config file. Turns out the TelementyChannel override has to go inside the default TelemenySinks node. I contacted microsoft on github about clarifying this in their docs.
Link to the unclear documentation
https://learn.microsoft.com/en-us/azure/azure-monitor/app/custom-endpoints?tabs=net
Link to github issue to get it fixed
https://github.com/MicrosoftDocs/azure-docs/issues/80066

Deploy asp.net web app on local or remote IIS using PowerShell DSC

I am unable to find any help on how to use PowerShell for DSC and deploy asp.net web app on local or remote on premises IIS.
Can you please help me with the steps or any resources?
What's your preferred method of deploying code prior to using DSC? xRobocopy was created with this scenario in mind, but if you are packaging your solution using NuGet, you could also use the PackageManagement resource.
I started working on a NuGet based config script recently but it isn't ready to publish in the gallery yet:
https://github.com/Microsoft/NuGetIISAppServerConfig/blob/master/NuGetIISAppServerConfig.ps1

How to deploy ASP.NET MVC4 application with SQL Server CE to Azure website

I deployed a ASP.NET MVC4 app with SQL Server CE database, but I'm getting
Sorry, an error occurred while processing your request
I am using VS2012 to publish this app to azure website. How can I solve this issue? Thanks.
To summarize and so an answer can get marked on this to help the next person that comes by.
When running into issues on azure-web-sites FTP is a handy debugging tool which enables you to:
Verify that the dll exists in your bin directory
Sometimes the .gitignore file blocks directories from being checked in
Verify that your web.config file has the proper version of the assembly configured
NuGet can help, but it's ultimately up to you to verify your dependencies
Here is a good article to follow on the subject: http://www.dotnetcurry.com/showarticle.aspx?ID=883
Unfortunately with VS 2013 Compact edition is not supported any more, so things are somewhat tricky.

Hosting NuGet repository via Apache / http server

Is there any way that I can setup and host a NuGet repository on an Apache or related http server? I have code that I would like made available, and it turns out that I have an apache server as well. I know that there are public places that I could publish to, but I was curious about my own. Any ideas? Is it possible?
If you need it i made a little nuget server with php. It works on apache with mod_rewrite and IIS: http://www.kendar.org/?p=/dotnet/phpnuget :)
I needed this recently too and have started implementing it at https://github.com/grenade/apache-nuget-repo
There are some limitations, like you can't push to it (yet?). To have that, it'd need some server side upload handler and that would mean picking a technology like PHP, Node, Python, etc which compromises the current simplicity. I also haven't made any effort yet around NuGet api v3 support.
Right now it relies on some other copy process uploading the .nupkg files and triggering the manifest and html generators.
There's nothing stopping you come creating a NuGet server that runs on Apache, but I don't think there's anything currently available that'll do this.
The command-line nuget.exe runs on Mono, but I suspect getting the ASP.NET NuGet server running is a whole new ballgame :-(

Deploy WEB Service Consumer module

We have recently added some functionality to our web site that requires adding a service reference to an api in an external domain. Adding the reference to a VS2008 project createed a sub-folder in the "Service References" folder and added 18 files to that folder that appear to represent the classes in the api. The api provider also had me add custom binding and client references to system.serviceModel in my web.config file.
Do I have to deploy that entire folder with its 18 files to my production site to use the web service? Does some of it get compiled into my project dll? I can find all kinds of references to deploying a service, but not what is necessary to deploy a service consumption module.
Sorry for short, but I don't have the answer for you. But you can get this answer yourself. This is the only way Iwould get the answer. Deploy it without them, see if it works. If it doesn't deploy with. If it works, then you know.
The good news is that I have to deploy absolutely no files from the project have to be deployed to the production site. Everything the web service consumer application needs gets compiled into the application assembly.