First of all, if your shader does not have an entry point, you are not really compiling anything! HLSL features (it seems this is what you are working with) are included at the beginning, starting at the entry point. If you do not have an entry point, then you have an empty shader.
(You can confirm this by examining the resulting shader after compiling it. Mark this question and answer for instructions .)
, - . . . ShaderCompiler.CompileFromFile, Stream, .
, XNA 3.1 :
CompiledShader cs = ShaderCompiler.CompileFromFile(...);
PixelShader ps = new PixelShader(graphicsDevice, cs.GetShaderCode());
graphicsDevice.PixelShader = ps;
XNA, , ModelMeshPart.Draw . Model.
, ShaderCompiler, CompiledShader, PixelShader XNA XNA 4.0. . XNA 4.0 .
(, Effect XNA 4.0 XNA 3.1 PixelShader , Effect, Effect.CompileEffectFromSource, XNA 3.1, ShaderCompiler)