I wrote a C++ mixed-mode (native and CLI) DLL. Call this assembly C1. It has a project reference to another assembly called R1.
Then, I wrote another mixed-mode DLL called assembly C2. It also has a project reference to R1.
These mixed-mode DLL's are loaded by a native Windows application. The assemblies are unsigned.
Current versions of the mixed-mode DLL's work with the original version of the native application if all assemblies are updated. However, I have a requirement to be able to update C1 without updating C2. Unfortunately, C1 and C2 both share R1 as a common dependency, and different versions of R1 are incompatible. This defines the root problem.
In an effort to resolve this, I updated C1 to create a new application domain whose private path (for probing) is a sub-directory of the application directory. The new R1 is located in the sub-directory. The new C1 is located in the application directory. The old C2 and R1 are also located in the application directory. The new versions of C1 and R1 are signed. Denote the old assemblies as C1A, C2A, and R1A. Denote the new assemblies as C1B and R1B. I am logging assembly loads in a handler to the separate app domain's AssemblyLoad event.
When the application runs, I see that C1B is loaded. Then, R1B is loaded into the separate app domain. Unexpectedly, R1A is loaded into the separate app domain. When a type from R1 is instantiated, the runtime is using R1A instead of R1B. Due to the aforementioned incompatibility of R1 versions, all sorts of exceptions ensue.
I then ran ildasm.exe against R1A. Next, I ran ilasm.exe against the resultant .IL file, specifying the key I used when building R1B. This generated a signed version of R1A. Denote the unsigned R1A as R1A1 and the signed version as R1A2. Finally, I copied R1A2 into the application directory. Now, the runtime skips R1A2 and only loads R1B in the separate application domain.
To me, the behavior of R1A1 violates the entire purpose of generating strongly named assemblies. What am I missing?
I'm developing a WCF RESTful web service with C# and .NET Framework 4.0. There is also a SQL Server database and I'm using Entity Framework Code First to access it.
And i use Android for get, post, ... in my service by json.
I have these two tables on SQL Server:
A user table for my application's user.
And another table to store their thoughts about something.
Now, I want to show mething like this:
I follow http://forums.asp.net/t/1774830.aspx[^]
but i have a problem: the Json String is inValidate format and i Can't convert it in my android project.
How Can I return a JSON object this way?
Please help me.
Your user is going to 'use' 'thoughts' (plural). So you create rest api methods that allow a user (singular) to manage one or more thoughts (plural). So for EXAMPLE (example only) you might have the following Rest methods.
- Get a thought (by id)
- Get all thoughts (a list) for a user.
- Create a thought
- Delete a thought.
If you want the user to manage themselves then you would provide similar methods to manage the user (but not the thoughts.)