Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net461 version of dotnet-aspnet-codegenerator-design.exe should be built for multiple platforms instead of win7-x86 #601

Closed
prafullbhosale opened this issue Aug 21, 2017 · 7 comments

Comments

@prafullbhosale
Copy link
Contributor

prafullbhosale commented Aug 21, 2017

For a net461 project with RID as win7-x64, the dotnet-aspnet-codegenerator-design.exe causes exception as MVC tries to load the 32-bit assembly in a 64-bit process:

System.BadImageFormatException occurred
  HResult=0x8007000B
  Message=Could not load file or assembly 'dotnet-aspnet-codegenerator-design' or one of its dependencies. An attempt was made to load a program with an incorrect format.
  Source=mscorlib 

Sample project:

<Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <TargetFramework>net461</TargetFramework>
    <RuntimeIdentifier>win7-x64</RuntimeIdentifier>
  </PropertyGroup>

  <ItemGroup>
    <Folder Include="wwwroot\" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore" Version="2.0.0" />
    <PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.0.0" />
    <PackageReference Include="Microsoft.AspNetCore.Mvc.Formatters.Xml" Version="2.0.0" />
    <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.0.0" />
  </ItemGroup>

  <ItemGroup>
    <DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.0" />
  </ItemGroup>

</Project>
@prafullbhosale
Copy link
Contributor Author

cc @Eilon @mlorbetske

@Eilon
Copy link
Member

Eilon commented Aug 21, 2017

cc @pranavkm because MVC is in the mix here.

@pranavkm
Copy link
Contributor

I might have been on an email thread related to this. The PR for this looks good.

@prafullbhosale prafullbhosale changed the title net461 version of dotnet-aspnet-codegenerator-design.exe should be built for 'AnyCpu' instead of win7-x86 net461 version of dotnet-aspnet-codegenerator-design.exe should be built for multiple platforms instead of win7-x86 Sep 15, 2017
@Eilon Eilon added this to the 2.0.1 milestone Sep 15, 2017
@Eilon
Copy link
Member

Eilon commented Sep 15, 2017

This patch bug is approved for the 2.0.x patch. Please send a PR to the feature/2.0.1 branch and get it reviewed and merged. When we have the rel/2.0.1 branches ready please port the commit to that branch.

@tjrobinson
Copy link

@Eilon Is there a workaround in the meantime?

@tjrobinson
Copy link

The workaround is to remove the package reference Microsoft.VisualStudio.Web.CodeGeneration.Design (This will disable scaffolding)

From: aspnet/Mvc#6709 (comment)

@prafullbhosale
Copy link
Contributor Author

Fixed by #605

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants