C
C#13mo ago
fasadin

❔ 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
Pobiega
Pobiega13mo ago
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?
fasadin
fasadin13mo ago
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
Pobiega
Pobiega13mo ago
4.8 is .NET Framework aka old shit
fasadin
fasadin13mo ago
yes wait you asked for sdk moment
Pobiega
Pobiega13mo ago
no its fine
fasadin
fasadin13mo ago
it is old project
Pobiega
Pobiega13mo ago
if its 4.8, I cant help anyways
fasadin
fasadin13mo ago
and was even older 😅 😦 thanks for trying anyway ❤️
Pobiega
Pobiega13mo ago
I have not worked with framework since 2016 and forgotten literally everything about it at this point 😛 best of luck
Bailey
Bailey13mo ago
There can be some simpler option searching throught the complete sollution for 4.0.0
fasadin
fasadin13mo ago
I already did that 0 references thank you 🙂
Bailey
Bailey13mo ago
then have you checked the dependancies from the nuget packages
fasadin
fasadin13mo ago
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)
Bailey
Bailey13mo ago
ok, maybe a simple sollution. Deiinstall 4.0.0.0 and build
fasadin
fasadin13mo ago
there is nothing about 4.0.0.0 that's the thing I don't have that referenced anywhere
Bailey
Bailey13mo ago
No I mean deinstall the framework then is cant build
fasadin
fasadin13mo ago
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
Bailey
Bailey13mo ago
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
fasadin
fasadin13mo ago
ok let me try that
Bailey
Bailey13mo ago
if some library has it check this with nugett what it needs
fasadin
fasadin13mo ago
2000 results 😦 but I can find name of package and it's down to 19 results that's a lead thanks ❤️
Bailey
Bailey13mo ago
Yes youre welcome
fasadin
fasadin13mo ago
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 something
Bailey
Bailey13mo ago
there 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 ?
fasadin
fasadin13mo ago
no. I've updated framework and on old machines / laptops all process works fine only on mine does not which has only new framework
Bailey
Bailey13mo ago
ok, after upgrading the code the program doesnt work anymore correct ?
fasadin
fasadin13mo ago
not correct it's working fine even on my machine it's magic 😦
Bailey
Bailey13mo ago
I was thinking of something else namely maybe it has a 32 /64 bit issue
fasadin
fasadin13mo ago
I highly doubt it, the project its not that old
Bailey
Bailey13mo ago
if it is forced to compile on 32 while the framework installed on 64
fasadin
fasadin13mo ago
let me check
Bailey
Bailey13mo ago
or visa versa Keep in mind if the compatibility is set to any then 99% of the time it will compile to 32bit
fasadin
fasadin13mo ago
platform target it is ANY cpu but, why then msbuild works?
Bailey
Bailey13mo ago
and the installed framework ?
fasadin
fasadin13mo ago
I am pretty sure only 64 but let me confirm it
Bailey
Bailey13mo ago
then that is probably the mismatch
fasadin
fasadin13mo ago
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?
Bailey
Bailey13mo ago
Sadly I had those error also. You can try compile on 64 then check if works. When Yes then you got the issue
fasadin
fasadin13mo ago
how to compile 64 with aspnet_compiler? because that's where issue arrise
Bailey
Bailey13mo ago
go to project setting => build change cpu
fasadin
fasadin13mo ago
but it works on visual studio 😄 I don't have problem there I have problem with running command
Bailey
Bailey13mo ago
VS is different. do not compare compiled with VS
fasadin
fasadin13mo ago
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?
Bailey
Bailey13mo ago
I only worj with the interface moment
fasadin
fasadin13mo ago
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
Bailey
Bailey13mo ago
e.g. my own project:
No description
Bailey
Bailey13mo ago
this is a sollution example
fasadin
fasadin13mo ago
yeah I know that one. But I am trying to build project from command line so this won't help me 😉
Bailey
Bailey13mo ago
At that point I have a lot less experience
fasadin
fasadin13mo ago
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
Bailey
Bailey13mo ago
Yes. Sadly couldnt help
fasadin
fasadin13mo ago
you did 🙂 we confired things that are not wrong 😄
Accord
Accord13mo ago
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server