Xamarin forms portable library with obfuscation tool .Net Reactor - xamarin.forms

I am working on Xamarin forms project (with portable project)
I am trying to obfuscate the portable dll using .Net Reactor I have done that using a batch file which is set as a post build event for the portable project and everything works fine (i.e the generated dll is obfuscated successfully )
here is the script code
"C:\Program Files (x86)\Eziriz\.NET Reactor\dotNET_Reactor.exe" -project
"reactor.nrproj" -file "myProject.dll"
copy "myProject_Secure\myProject.dll" "myProject.dll"
the problem is when I build the droid project I got the following error
Exception while loading assemblies: System.IO.FileNotFoundException:
Could not load assembly 'Windows, Version=255.255.255.255,
Culture=neutral, PublicKeyToken='. Perhaps it doesn't exist in the
Mono for Android profile? File name: 'Windows.dll' at
Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(AssemblyNameReference
reference, ReaderParameters parameters) in
/Users/builder/data/lanes/5147/c2a33d8e/source/xamarin-android/external/Java.Interop/src/Java.Interop.Tools.Cecil/Java.Interop.Tools.Cecil/DirectoryAssemblyResolver.cs:line
220 at
Xamarin.Android.Tasks.ResolveAssemblies.AddAssemblyReferences(DirectoryAssemblyResolver
resolver, ICollection`1 assemblies, AssemblyDefinition assembly,
Boolean topLevel) at
Xamarin.Android.Tasks.ResolveAssemblies.Execute(DirectoryAssemblyResolver
resolver) myProject.Droid
I am sure that problem comes from the obfuscation because everything works fine without the obfuscation
Does anybody work with .Net reactor to obfuscate Xamarin forms projects?
BTW, I have un-check all the quick settings of the .Net reactor and the problem is still shows up

Obfuscating of Xamarin Android is useless its better to turn on "Embed assemblies to native code" which will convert all code into a binary .so file. so it will be difficult for hacker or reverse engineer to read that code and do reverse engineering.you can use AOT but that is in experimental and might create problem for some device after updated on play store. in order to play safe i would suggest to go with "Embed assemblies to native code"

You need to set "2. Protection Settings"->"Anti ILDASM"->"Suppress Decompilation" to "False" as it confuses the build process in this case. In case it still doesn't work set "1. General Settings"->"Project Targets Mono Framework" to "True".

Related

error when deployed to azure

When i Publish my project i m getting this error:
error CS0009: Metadata file
'D:\home\site\approot\packages\Microsoft.ApplicationInsights\1.1.1-beta\lib\net45\Microsoft.ApplicationInsights.dll'
could not be opened -- Invalid COR20 header signature.
(I m using asp.net core 1)
Did Someone knows or has experienced the same problem?
Thanks
This problem can occur when you have added a third-party DLL to your application and have not properly added it to your compiler’s project file or references list.
If that's the case this might work:
Open your project in Visual Studio .NET. Make sure the DLL exists and has been properly added to the reference list. If you are using VBC or CSC to compile your project, check your application’s CompileApplication.rsp file to make sure the DLL is in the /references list like the other DLLs.
Your DLL may not be compatible with .NET or with .NET’s 32-bit mode. Ensure that your DLL is .NET compatible.
If your project still won’t compile properly, try switching your application’s compiler selection in Iron Speed Designer’s Application Wizard from 'vbc.exe' or ‘csc.exe’ to Visual Studio .NET or vice versa. Using Visual Studio .NET will take longer to build than .NET’s VBC or CSC built-in compilers, but Visual Studio .NET will resolve all of the references properly without having to change your application’s CompileApplication.rsp file.

What is the purpose of Microsoft.AspNetCore.Razor.Tools?

What is the purpose of Microsoft.AspNetCore.Razor.Tools?
I'm using visual studio code on os x
From the git hub page https://github.com/aspnet/RazorTooling I can see
The Razor syntax provide a fast, terse, clean and lightweight way to combine server code with HTML to create dynamic web content. This repo contains tooling that interacts with the DNX Design Time Host to provide a Razor editing experience.
Does visual studio code use this assembly? What is a DNX Design Time Host? When would I need to include this assembly in a project?
I found a reference to it in the project.json of a web application project that I generated using yo aspnet.
At least here: https://www.nuget.org/packages/Microsoft.AspNetCore.Razor.Tools/ you can see a brief description of library:
TagHelper tooling for .NET Core CLI. Contains the dotnet-razor-tooling
command used to resolve TagHelperDescriptors for projects at
design-time.
And here you can find a bit more details: https://docs.asp.net/en/latest/mvc/views/tag-helpers/intro.html#intellisense-support-for-tag-helpers
On mac you can run the same command:
dotnet razor-tooling
but it doesn't make any sense because for now VS Code doesn't provide any intenseness for Razor views. So probably you can remove this dependency from project.json.

Is it necessary to manually add <AutoGenerateBindingRedirect> metadata to the Core project file to correctly reference assemblies?

I'm using Visual Studio 2013 and MvvmCross to create an Android application using Portable Class Libraries.
I notice in my first view model, CatalogViewModel, some code is highlighted as not referencing the correct assemblies or unable to be resolved (the code builds fine even with these issues).
Examining the .NET Portable Subset assembly in the Object Browser shows various System assemblies included (2.0.5.0 v2.0.50727 & v4.0.30319, 4.0.0.0, 5.0.5.0). Automatic binding redirection for assemblies in .NET Framework 4.5.1 can be enabled or disabled by adding this line to the .csproj file.
<AutoGenerateBindingRedirect>true</AutoGenerateBindingRedirect>
or
<AutoGenerateBindingRedirect>false</AutoGenerateBindingRedirect>
This seems to solve the referencing and redirection issues in the IDE. I haven't found any information about this manual modification to the Core project file in any of the MvvmCross info online I reviewed so I wanted to post a question here to see if anyone had some information or best practices.
No, you shouldn't need AutoGenerateBindingRedirect. This feature is intended to generate binding redirects for non-platform assemblies, such as NuGet packages. Platform assemblies should be unified automatically by Visual Studio / MSBuild.
Which seems to work, since you pointed out:
the code builds fine even with these issues
So this looks like a bug in ReSharper. The fact that adding AutoGenerateBindingRedirect fixes your ReSharper issues might be a side effect of something else.

generating an asp.net web application dll requirement list

I'm trying to set up a web app (32bit on ii7/win7, 32bit setting is enabled, everything is compiled to x86, using vs2008), but there's clearly some dll module loading issue happening. I've been watching procmon and fusion logs but I'm not seeing the name of the missing dll.
I'm a complete newbie to asp.net (but fairly heavy experience on other platforms).
I know I can call depends.exe on a binary to see what the dependancies are, but how do I do it for asp.net? specifically, is it possible to get a list of the dlls that iis7 loads for my application?
update: I manually blew away all of the binaries for my application and rebuilt (clean didnt seem to do the trick, I guess). it's now sort of working. or at least it's getting further and more detailed.
An asp.net web project dll shouldn't depend on anything that is not part of the default .net run-time or explicitly referenced in the project. I would start by reviewing the references. Noramlly an asp.net web project has a bin folder that contains the compiled website/webapplication and any dll's that it depends on (aside from the .net run-time). This is usually done by the programming tool used to create the project.
If you still don't find the culprit, you could try using Filemon (http://technet.microsoft.com/en-gb/sysinternals/bb896642.aspx) and use it to watch IIS to see what files it is looking for and isn't finding.
An additional option is to examine the web.config file that should have been included with the web site/application. Its an XML file and usually has an Assemblies section that lists assemblies that should be loaded. For example you might see:
<assemblies>
<add assembly="MySql.Data, Version=6.2.3.0, Culture=neutral,
PublicKeyToken=C5687FC88969C44D"/>
</assemblies>
This means that the code wants to use the MySQL.Data.dll, and specifically version 6.2.3.0 of that DLL. It is possible to have different versions of .Net dll files installed at the same time. So you might have the desired DLL, but not the correct version as specified in the Web.Config file.

multi-file c++/cli .net assembly in ASP.NET web site

I have a .NET assembly that I want to use in an ASP.NET web site. The assembly has the following characteristics:
written in C++/CLI
contains managed and unmanaged code
compiled to x86/x64 platforms (using the correct platform-specific assembly, so it's not believed to be an issue here)
compiled as a multi-file assembly linking several native dlls
When I try to compile I am getting an error stating:
Could not load file or assembly '...' or one of its dependencies. An attempt was made to load a program with an incorrect format.
I can use the library reference without problems in an ASP.NET web application (such as MVC), but when I want to use it in an ASP.NET web site, I get this compilation issue.It seems to be something specifically related to the ASP.NET compiler.
How do I get my website to compile with this dependency?
I don't see any compilation settings within Visual Studio to indicate one way or another...

Resources