Using NLog with ModernUI on Windows 8.1 - windows-8.1

Is it possible to use NLog with Windows 8.1 applications.
I have installed NLog using Nuget. After adding NLog to References I have the error:
Can not find type System.Collections.CollectionBase in module mscorelib.dll
If it is not possible which logger can you recommend for windows 8.1 applications ?

System.Collections.CollectionBase is not a supported namespace in WinRT:
http://msdn.microsoft.com/en-us/library/windows/apps/hh454064.aspx
There are a couple of solutions, neither of which I've used so I can't personally recommend, but you can try out:
1) https://code.msdn.microsoft.com/Logging-Sample-for-Windows-0b9dffd7
2) https://github.com/mbrit/MetroLog

Related

Async BCL and .net 4.0

I have a WPF application that targets framework v4.0 and uses async BCL. It seems that installing only .net framework v4.0 on fresh W7 OS is not enough, since as it seems, there was a bug which was corrected with later update. For example, installing update v4.0.3 solves the problem with using async BCL on framework v4.0.
My concern is this: On my developer machine (W8.1) I do not have this update installed (at least it is not registered in windows registry, nor under the windows updates). Still, my application is working just fine, which means that the update is somehow installed through some other method.
The question: how can I know that application that uses async BCL will work correctly on client's OS? Currently, when I install the application (wix 3.8), I check if .net 4.0 is installed, and I check if KB2600211 (4.0.3) is installed (by searching adequate registry keys). If not, I install them, but I am wondering if searching for KB2600211 is the right approach? Is there some other way to make sure that app will work correctly?
On your Windows 8.1 you have .NET 4.5.1 which is an in-place update for .NET 4.5 which is an in-place update for .NET 4.0. That means you no longer have plain .NET 4.0 (.NET 4.0.x, for that matter).
I recommend you to always test on the target environments. It can be as simple as having a VM.

how to check my pc is 32-bit (or)64-bit operation system using InnoSetup?and how can i check .net framework 4.5 is installed in my pc using innosetup?

I want to check whether my pc is 32 bit (or)64 bit operating system using inno setup.
And how can i check whether .net framework 4.5 is installed in my pc? if not installed how to give .net framework 4.5 package from my setup using innosetup?
And how to install .net framework 4.5 from web using innosetup?
Regards,
Lokesh.J
Detect OS is 32/64 Bit look at this.
how to detect 64bit platform by script.
To check what .NET Version is installed try use this script.
http://www.kynosarges.org/DotNetVersion.html
.NET Installer you can look at this.
http://www.codeproject.com/Articles/20868/NET-Framework-1-1-2-0-3-5-Installer-for-InnoSetup
Just search on Google and you will find all the answers you need. Hope this helps.

Can I reference .NET 4.0.3 runtime in MonoDevelop on a Mac?

In my question about using .NET 4.0.3 in a Portable Class Library I spoke a little too soon: I got the PCL working on my Windows machine, but now I can't get it working on the Mac. If the library is set to use .NET 4.03, I get compiler errors in MonoDevelop, saying that the framework is not supported. So I'm stuck on PCL for .NET 4.0, which is annoying because I need some features from 4.0.3.
So, is there a way to target .NET 4.0.3 in MonoTouch/MonoDevelop on the mac?
MonoDevelop (up through 3.0.6) is/was hard-coded to only work with PCL Profile1 (I think it was Profile1, anyway). As a workaround, you can try changing over to Profile1 and building that.
On MacOS, MonoDevelop simply links with MonoTouch (or Mono4Android) system assemblies and ignores the PCL profile constraints (other than verifying that the profile is Profile1). If MonoTouch has the 4.0.3 APIs that you are trying to use, then things will build fine.

Enable-Migrations fails for EF5

I am using .NET 4.0 and Visual Studio 2010 (which I will eventually upgrade, but not quite yet). I ungraded from EF 4.1 to EF 5 via NuGet and ran Enable-Migrations (via the Package Manager Console) but got this error
No context type was found in the assembly 'UI'.
I Googled around and found this SO post.
The scenario described by the poster is slightly different as he is using VS 2012 and .NET 4.5. Either way I'm not sure if this will solve my issues. Do I need to be using VS 2012 and .NET 4.5 to use Migrations? How do I solve my issue?
In order to NuGet commands work correctly, you should specify the default project:
So you should change the dropdown value from UI to Model (I presume). Actions should not depend on VS version.

Could not find assembly System.ServiceModel

I'm deploying a webpart on sharepoint and getting some errors. The webpart consumes data from a Web Service and displays a chart using Microsoft Chart (Framework 3.5). When I try to acces it, I get the folowing error:
Could not load file or assembly 'System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The system cannot find the file specified.
StackTrace: at
System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at
System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
methodName, Object[] parameters)
I tried copying System.Servicemodel.dll to the bin folder and registering it on the GAC, but the error does not change.
Any idea?
Thanks
To expand on the above answers:
It does sound like your site is running on asp.net 2.x. Being that System.ServiceModel is a 3.x component, the assembly will not load. You will need to install 3.5 on the server, or if you already have it set IIS to run the site under 3.5
I had a similar problem, but it was because my .NET framework got messed up/corrupted, so I'll post what fixed it for me. Maybe it's overkill, but it worked when nothing else would.
Get the “dotnetfx_cleanup_tool” from http://blogs.msdn.com/b/astebner/archive/2008/08/28/8904493.aspx (I think one of the download links fails, so use the other one)
Uninstall frameworks 2.0 and above (I did 3.5, 3.0, 2.0. 2.0 made me reboot).
IMPORTANT: Go to C:\WINDOWS\Microsoft.NET\Framework and delete or rename the folders for the versions of .NET you removed.
Then I installed .NET Framework 2.0 SP2 (reboot afterwards). The error was gone.
I also installed .NET Framework 3.5 SP1 (works without rebooting) and the error was still gone.
Is your website configured to use ASP.NET 2.0.5.something ?
Maybe this article can be helpfull:
Forcing ASP.NET 3.5 ON IIS
Try installing .NET Framework 3.5 on your sharepoint server.
It sounds like the Web Part itself was built against an older version of the System.ServiceModel assembly (probably a beta version). If you have access to the web part's source code, you should recompile it against the latest stable version. Otherwise you'll have to find the exact same version of System.ServiceModel and register that into your GAC.
EDIT: You could also try going into your web app's Web.config and replace your System.ServiceModel reference with this:
<Reference Include="System.ServiceModel">
<SpecificVersion>False</SpecificVersion>
</Reference>
The problem was within the Web Service, not the webpart.
The machine where the web service was deployed has framework 2.0 installed.
The exception was catched on the webpart and reported back.
Thank you all for your comments.
fire up your Visual Studio 2010 Command Prompt or browse to "C:\Windows\Microsoft.NET\Framework\ v4.0.30319". And run the following command from the command prompt:
aspnet_regiis.exe -iru
I came across this same problem with a Silverlight 4 app and solved it by switch off Debug Exception checks for
Common Language Runtime exceptions
in Debug => Exceptions
Hope that helps
Mike

Resources