سؤال

I have a WinForms app targeting the .NET 4 Client Profile. However, when I try to run it on a machine that has only the Client Profile (and not the full/extended profile), I get ".NET Framework Initialization Error" saying I need to install ".NETFramework,Version=v4.0":

".NET Framework Initialization Error" saying I need to install ".NETFramework,Version=v4.0"

I've double-checked the project file to make sure that it is indeed targeting the client profile, and it is:

<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>Client</TargetFrameworkProfile>

As are all of the projects it references. I'm not even sure where else to look - what is going on here?

هل كانت مفيدة؟

المحلول

Check your app.configs and verify the supported runtime specified in the startup:

<startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
</startup>

should be replaced with

<startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0,Profile=Client" />
</startup>
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top