I have a Prism Shell with two modules. One module is supposed to be the main application mock, `MainAppMock`, and the other module is supposed to be whatever that main system is using as a region, `ModuleOne`. Could be one, could be a million module.

The issue is understanding how Prism works. The `MainAppModule` initializes properly unless I call it's namespace in the `Bootstrapper` `MainWindow.xaml` file.

My question: Is this because it is loading the module at run time when I am calling that namespace and therefore `Prism` doesn't load it because it is already loaded? What is actually happening behind the scenes?

Shell:

```
class Bootstrapper : NinjectBootstrapper
{
    protected override DependencyObject CreateShell()
    {
        return Kernel.Get<MainWindow>();
    }

    protected override void InitializeShell()
    {
        Application.Current.MainWindow = (Window)Shell;
        Application.Current.MainWindow.Show();
    }

    protected override IModuleCatalog CreateModuleCatalog()
    {
        return new DirectoryModuleCatalog
        {
            ModulePath = AppDomain.CurrentDomain.BaseDirectory
        };
    }
}

```

MainAppMock and ModuleOne are the same except for the name.

ModuleOne Class:

```
[Module(ModuleName = "ModuleOne.Module")]
public class Module : IModule
{
    private readonly IRegionManager _regionManager;
    private readonly IKernel _kernel;

    public Module(IRegionManager regionManager, IKernel kernel)
    {
        _regionManager = regionManager;
        _kernel = kernel;
    }

    public void Initialize()
    {
    }
}

```

The problem is here. In the `Bootstrapper` `MainWindow`:

```
<Window x:Class="PrismTest.MainWindow"
    xmlns:mainAppMock="clr-namespace:MainAppMock;assembly=MainAppMock"
    mc:Ignorable="d"
    Title="MainWindow" Height="350" Width="525">
<Grid>
    <mainAppMock:MainUserControl />
</Grid>

```

Note: It works fine if I remove the `mainAppMock` namespace as mentioned above.
['https://Stackoverflow.com/questions/36254414', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3029887/']
As this question has now changed so much since I first asked it (i.e. first I thought this was a memory/ struct issue, then it became a compiler issue, then I finally figured out it was a IDE issue), therefore I decided to create a new question altogether: [Output for CLion IDE sometimes cuts off when executing a program](https://stackoverflow.com/questions/36270122/clion-output-cuts-off).

The answer for this specific question is that this is an issue with the CLion IDE. To fix this issue, compile and run the code using a terminal and the output works fine.

Thanks to @Dominik Gebhar & @Jonathan Leffler for the help!!!
**fscanf()** returns the number of characters read or zero at end of file, while **fgetc(fp)** returns a character or EOF when end of file is reached.

You are mixing the two methods of eof detection.