Domanda

I found some really cool articles about how to embed assemblies into one master DLL. This is necessary if you want to store your DLLs in the CRM database. AppDomain.CurrentDomain.AssemblyResolve in dynamics crm

The alternative is to use ILMerge, which I am not interested in.

In my scenario, the DLLs I want to embed are from the same solution. The trick to embedding the assemblies is to create a folder, Add Existing Item and select the DLLs you want to use. Then you go to the DLLs' properties and mark them as Embedded Resource.

The problem is, the referenced DLLs won't be updated until after I build the solution. So, currently, I am building the project, copying the /bin DLLs to the project assemblies folder and then rebuilding the project a second time.

To make things worse, I have different solution configurations: Debug, Development, QC, UAT and Production. Which changes the /bin directory I grab the DLLs from.

So, is there a way to automatically refresh the project folder whenever the project gets built - and can I change where the DLLs are coming from depending on the current solution configuration?

È stato utile?

Soluzione

For a few months, I was building the solution, copying DLLs into an EmbeddedAssemblies folder and then rebuilding the project. It was really painful because I had to write a .bat file that would call MSBuild on my entire .sln, then do an XCOPY and then call MSBuild on the .csproj.

Worse, because I have no control over how TFS ignores files, source control was constantly seeing these files as changing and I had to explicitly Exclude them from check-ins. My teammates were usually not so considerate.

Ultimate, I took another look at ILMerge. Internally, it is pretty much doing the exact same thing I was. I switched over to ILMerge and I've been happier ever since.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top