Last post Jul 22, 2019 10:56 AM by Norbert Virth
Jul 15, 2019 09:56 AM|Norbert Virth|LINK
`aspnet_compiler.exe` ignores the value if `<OutputPath>` in `.csproj`.
It always uses `bin\`.
I have this in my `web.config`:
<add assembly="DevExpress.Web.Mvc5.v15.2, Version=126.96.36.199, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<add assembly="DevExpress.Web.v15.2, Version=188.8.131.52, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<add assembly="DevExpress.Data.v15.2, Version=184.108.40.206, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
When I set `<OutputPath>notBin\<OutputPath>`, and remove the `bin` folder, there will be this compilation error:
Web.config(87): [ASPCONFIG] Could not load file or assembly 'DevExpress.Web.Mvc5.v15.2, Version=220.127.116.11, Culture=neutral, PublicKeyToken=b88d1754d700e49a' or one of its dependencies. The system cannot find the file specified.
Now, when I restore the `bin` folder, but keep `<OutputPath>notBin\<OutputPath>`, `aspnet_compiler.exe` runs successfully.
I need both the system.web/compilation/assemblies section, and also the overridden OutputPath.
Does anyone know a workaround to get `aspnet_compiler.exe` working?
Jul 15, 2019 11:23 AM|mgebhard|LINK
And the expected behavior. Can you explain why you want to change the name of the standard bin folder? What problem are you trying to solve?
Jul 15, 2019 04:33 PM|Norbert Virth|LINK
I would expect aspnet_compiler.exe to honor the <OutputPath> property, since "bin" is just a default value for that.
Or would expect aspnet_compiler.exe (or MvcBuildViews task) to be parameterized for overridden OutputPath directory paths.
The overridden output path is a legacy we have to live with.
We don't dare to change this at the current phase of the project.
Instead of having 1 big MVC project, it has been split up into independent parts (multiple little MVC projects).
These get built into the same output folder; so in the end, a big MVC project will be built.
Jul 15, 2019 05:14 PM|PatriceSc|LINK
I believe I saw once a discussion about that being not that easy and believe it was related to
https://github.com/Microsoft/msbuild/issues/87 (having both OutputPath and OutDir ?)
I would :
- keep both directories until I see the old one is really not used any more
- use Tools Options to use a verbose build and perhaps better see what happens
- for now it looks like a problem with the
https://docs.microsoft.com/en-us/dotnet/framework/configure-apps/file-schema/runtime/probing-element probing path ?
I was not planning at looking at that as ASP.NET Core seems to have better options. If I remember you are supposed to be able to have a main MVC projects with other projects for your area(s).
Jul 15, 2019 06:39 PM|bruce (sqlwork.com)|LINK
Jul 22, 2019 10:56 AM|Norbert Virth|LINK
Thank you all for the tips.
I tried to play around with MsBuild flags, but seemingly undeterministic random things happened, so did not dare to keep that code :)
Copying the bin contents AfterBuild and before-MvcBuildViews worked stably