I have added the generated module to my exe file (as a post build event). However in that case i cannot start my application in debug mode I will try to move my 'cudafy related' code to a separate dll and add the generated module to that dll and hopefully the
debugger will work again.

With 'it works' i meant cudafycl.exe does not report an error anymore. With the -cdfy option (C:\CUDAfy\CudafyV1.25\bin\cudafycl.exe MyApp.exe -arch=sm_20 -cdfy) all works as expected. Without the -cdfy option (C:\CUDAfy\CudafyV1.25\bin\cudafycl.exe MyApp.exe
-arch=sm_20) something happens to the exe file (its timestamp changes) but the program raises an exception when 'reading' the CudafyModule: km = GetType().Assembly.GetCudafyModule();

System.Xml.XmlException: Data at the root level is invalid. Line 1, position 1.

If i 'view' the exe file with 'CudafyModuleViewer.exe' i get the same errormessage.

I think i have found the problem (a bug in function Deserialize(Stream stream) in KernelModule.cs).

The function Deserialize(Stream stream) has a switch on NET35 and i use .NET 4.0 so i assume in my case i get the 'else' code. In that 'else' section the parameter on XDocument() is stream, which i think is wrong, it should be 'reader' (as in NET35). I have
changed in my version and now it works. Can someone please confirm this is correct and fix it in next version.

endif

Thank you for this. Commenting out XmlReader reader = XmlReader.Create(stream); also works. When creating the XmlReader the position of the stream is probably moved to the end and therefore spelling bad news for the .NET 4.x only XDocument doc = XDocument.Load(stream);
Fix has been committed.

Is there a way i can get a 'beta/pre' release of next version (1.26). That is because i would like to have the above feature implemented without building the sources myselve (in that case i would have a lot of DLL's)