❔ Running aspnet_compiler.exe gives an error
so when I am trying to build one of projects I am getting
“could not load file or assembly microsoft.build.framework version 4.0.0.0”
but I don’t have that package anywhere listed. My nuget it’s version 6.4.0
and on another machine this command works
what I can do next?
53 Replies
first check what version of dotnet your project is using. open the .csproj file and check the top ~5 lines or so
second, on both machines, type
dotnet --info
in a terminal and check the result
what SDK versions are installed?I can run project locally withot any problems. So if I start project from Visual Studio then it's all perfecto
it's 4.8 and I have only that sdk installed. But it was upgraded, so old machine has old SDKs
and I think this is were problem is, but not sure where old reference it's coming from
4.8 is
.NET Framework
aka old shityes
wait you asked for sdk
moment
no its fine
it is old project
if its 4.8, I cant help anyways
and was even older 😅
😦
thanks for trying anyway ❤️
I have not worked with framework since 2016 and forgotten literally everything about it at this point 😛
best of luck
There can be some simpler option searching throught the complete sollution for 4.0.0
I already did that
0 references
thank you 🙂
then have you checked the dependancies
from the nuget packages
sadly from VS it's not that easily possible to see it and it's quite huge project
so it would take me probably like a half day to do so
and I can't have rider installed (then it would be easy to search for it)
ok, maybe a simple sollution. Deiinstall 4.0.0.0
and build
there is nothing about 4.0.0.0
that's the thing
I don't have that referenced anywhere
No I mean deinstall the framework
then is cant build
I don't think that will help, because if I open project from visual studio then it can compile, build and run
and that's the only framework I have on machine
maybe a last idea instead of searching with vs use notepad++ over all the files including the external libs. If all are written in c# and not been obfuscated then you have a change to find it. Only search for the number not the entire string.
If that doesnt. work then the only way is the long way probably
ok let me try that
if some library has it check this with nugett what it needs
2000 results 😦
but I can find name of package
and it's down to 19 results
that's a lead
thanks ❤️
Yes
youre welcome
but why it would not work with aspnet_compiler
but with vs yes
is it because it's using msbuild for compilation?
btw, sadly I can see
redirect
assembly, but no usage of it
I think it's internal microsoft package that it's used in System or somethingthere is a difference. the compiler creates an intermediate language which is dependend on the versions.
So when all functions are available then it will not create an error.
just another question. YOu migrated to a new server correct ?
no. I've updated framework
and on old machines / laptops all process works fine
only on mine does not which has only new framework
ok, after upgrading the code the program doesnt work anymore correct ?
not correct
it's working fine
even on my machine
it's magic 😦
I was thinking of something else
namely maybe it has a 32 /64 bit issue
I highly doubt it, the project its not that old
if it is forced to compile on 32 while the framework installed on 64
let me check
or visa versa
Keep in mind if the compatibility is set to any then 99% of the time it will compile to 32bit
platform target it is ANY cpu
but, why then msbuild works?
and the installed framework ?
I am pretty sure only 64 but let me confirm it
then that is probably the mismatch
hmm I don't know how to check if it's 64 or 32
one moment 😄
64 for 100% sure
no 32
but wait. Can I force
aspnet_compiler
to run on different CPU?
and if I have only 64 would not be then running always on 64?Sadly I had those error also. You can try compile on 64
then check if works. When Yes then you got the issue
how to compile 64 with aspnet_compiler?
because that's where issue arrise
go to project setting => build
change cpu
but it works on visual studio 😄
I don't have problem there
I have problem with running command
VS is different.
do not compare compiled with VS
c:\windows\Microsoft.NET\Framework\v4.0.30319\aspnet_compiler.exe
so changing settings there on project to 64
will be automaticlly be picked up
by aspnet_compiler?I only worj with the interface moment
I Don't have that luxury at the moment 😄
but I think I might know something
but that's a nice advice
let me explore that and come back to you in some time
e.g. my own project:
this is a sollution example
yeah I know that one. But I am trying to build project from command line
so this won't help me 😉
At that point I have a lot less experience
BUT
nah it does not work 😦
I ran with 64 bit version of aspnet_compiler
but same error
so it's not version problem then 😦
ok I will just make changes and build on machines that already works. It will be annoying to send changes back and forth but oh well
thanks for help @Bailey
Yes. Sadly couldnt help
you did 🙂
we confired things that are not wrong 😄
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.