Error loading a 3.0 framework dll Unity - dll

I am trying to load a managed dll into my project. C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.0\System.ServiceModel.dll
Its an Empty project. I paste this dll into my Asset/Plugin folder. I compile for Windows8 (Universal App)anyway it fails with all SO. I change API Compatibilty level to 2.0. It seems its load without problem. As soon as I play Unity the following mistake appears:
SpritePacker failed to get types from System.ServiceModel,
Version=3.0.0.0, Culture=neutral, PublicKeyToken=xxxxxxxxxx.
Error: The classes in the module cannot be loaded.
UnityEditor.Sprites.Packer:GetSelectedPolicyId()
Somebody with this problem?

Finally it worked out loading the dll from:
"C:\Program Files (x86)\Unity\Editor\Data\MonoBleedingEdge\lib\mono\gac\System.ServiceModel\3.0.0.0__b77a5c561934e089"
Other dlls where not valid. The reason why it is like this I do not know it.

Related

Building VSIX project in Release does not create a VSIX file anymore, just a DLL

I think the title is pretty clear. I always build in Release mode and upload the created VSIX file to the VS Marketplace.
Since today, it just creates a .dll file when I build in Release mode, no VSIX is generated. Also,in Debug I cannot set break points anymore, symbols won't load.
After reverting the commit (5 lines of code) to the previous version the problem still occurs.
I have no idea what could have caused this. Anyone experienced this before and what can I try to resolve this?
Edit:
This shows up in the build log, can this be the cause?
warning CS1762: A reference was created to embedded interop assembly 'EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' because of an indirect reference to that assembly created by assembly 'Microsoft.VisualStudio.Shell.15.0, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Consider changing the 'Embed Interop Types' property on either assembly
When I set the Embed Interop Types property to true on the EnvDTE assembly I get service can not be embedded errors throughout the package code.
I tried creating new VSIX projects or opening older ones, no issues there, it creates a .VSIX file when building in release mode. Comparing the CSPROJ files and configuration shows no difference.

C++/CLI managed code exception

I made a wrapper for some sdk written in C# using C++/CLI to be used with a c++ program. The managed code project has "Common Language Runtime Support (/clr)" enabled in Visual Studio and .Net Target Framework set to v4.5.2.
My problem is that I receive the below exception:
"System.IO.FileNotFoundException: 'Could not load file or assembly 'Test, Version=1.0.6.52, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified."
I can't reproduce this all the time on the same machine, more of the time is working well.I also checked for test.dll in running directory and it's there.
Thank you.

Visual Studio 2017 - Could not load file or assembly 'System.IO.FileSystem

I just upgraded my Visual Studio to the latest version (1/30/2017).
My ASP.NET Core project was working before the upgrade, but I now get the following error that stops me. Are there any simple solutions to this?
Severity Code Description Project File Line Suppression State
Error MSB4018 The "ResolvePackageDependencies" task failed unexpectedly.
System.IO.FileNotFoundException: Could not load file or assembly 'System.IO.FileSystem, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
File name: 'System.IO.FileSystem, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
at Microsoft.NET.Build.Tasks.LockFileCache.LoadLockFile(String path)
at Microsoft.NET.Build.Tasks.LockFileCache.GetLockFile(String path)
at Microsoft.NET.Build.Tasks.ResolvePackageDependencies.get_LockFile()
at Microsoft.NET.Build.Tasks.ResolvePackageDependencies.ReadProjectFileDependencies()
at Microsoft.NET.Build.Tasks.ResolvePackageDependencies.ExecuteCore()
at Microsoft.NET.Build.Tasks.TaskBase.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
In my particular case, I did a Clean Solution, Tools/options/NuGet Package Manager/Clear All NuGet Cache(s), then a reboot. Loading/building the project then worked.
Not sure how repeatable this is. I'm quite sure my project worked the first time I loaded it, then failed, then worked again after these steps. It has worked on 2 computers.
I solved this by running dotnet build in the Paket-Manager Console of VS Studio.
After the software was again debuggable
The easiest way to fix this is to create a new ASP.NET Core application, check its .csproj file and modify the old project based on it. A lot of things seem to have been removed and simplified and it's too much to list here.

Using ILMerge to merge multiple dll files into one dll, some of the dll files cannot be used

I have a library project that is working properly, and it is using the fluent nhibernate, npgsql, enyim.caching dll files, I use the ilmerge to combine all files into one, and after that the merged dll file is referenced by another project, then it doesn't work, it complains cannot find assembly of enyim.caching.dll, and the missing configuration of nhibernate
The command I am using for merging is below
ilmerge /targetplatform:v4 /target:library /out:testmerged.dll Release/Enyim.Caching.dll Release/FluentNHibernate.dll Release/Iesi.Collections.dll Release/log4net.dll Release/Mono.Security.dll Release/NHibernate.Caches.SysCache.dll Release/NHibernate.dll Release/Npgsql.dll Release/mylib.dll
The error from the project referencing it:
Message = "'FluentNHibernate.Automapping.IAutoClasslike, testmerged, Version=2.12.0.0, Culture=neutral, PublicKeyToken=null' is missing a parameterless constructor."
Message = "Could not load file or assembly 'Enyim.Caching' or one of its dependencies. The system cannot find the file specified."
I pay attention to those 2 dll files are using the runtime version v2.0.50727, and all files under runtime version v4.0.30319 are working correctly.
So, can you guys give any suggestion how to fix this issue?
Thanks
Ok, finally, I found the solution to enyim.caching.dll
I have to add
<sectionGroup name="enyim.com">
<section name="memcached" type="Enyim.Caching.Configuration.MemcachedClientSection, testmerged"/>
</sectionGroup>
<section name="memcached" type="Enyim.Caching.Configuration.MemcachedClientSection, testmerged"/>
in my configuration file

Could not load file or assembly 'Microsoft.Web.Design.Server

Help please, I am having an error on the TFS. it complains that it cannot load the assembly below.
the project works fine on my computer. I searched for the dll by there is no such dll called: Microsoft.Web.Design.Server.
Any help pelase?
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Web.Design.Server, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c'
The build server does not have the same software installed as your local machine. Thus when it goes to resolve dependencies it cannot find them.
This is compounded when your project has GAC references.
I recommend that anything which isn't a system assembly be copied to a folder and put into source control. The projects should then reference this assembly as a file reference instead of a GAC reference.
Since the file is now in source control it'll be available to the build server for it to resolve the assembly at compile time.