i've downloaded the mvc3 source code and am trying to add it to an existing project so i can debug. I get the following compile error - The referenced assembly System.Web.WebPages.dll was not found. If this assembly is produced by another one of your projects, please make sure to build that project before building this one. Do these dlls not come with the source code?
Inside the mvc3-rtm-sources.zip you have downloaded there are 2 folders:
mvc3
webpages
It is the webpages folder that contains the WebMatrix stuff (System.Web.Helpers, System.Web.Razor, System.Web.WebPages, ...). So make sure you have compiled those projects first.
Related
In short: When building a VSIX project In Visual Studio 2015, the build process is attempting to load random files (such as icons, .config files, .targets file) as if they were .Net assemblies.
I am attempting to build a VSIX project that includes a referenced project template and a embedded wizard assembly. I've done the exact same thing previously with success, following the steps described at How to: Use Wizards with Project Templates.
This time, however, when I attempt to build the VSIX project I get bizarre errors such as the following:
Could not determine the FullName of the Assembly at "C:\Source\VSTS\Toolkits\v7\Web.Site\v7.2\packages\Microsoft.Net.Compilers.1.3.2\tools\csc.exe.config". Could not load file or assembly 'csc.exe.config' or one of its dependencies. An attempt was made to load a program with an incorrect format.
Note, the compiler is trying to load a config file as if it were an assembly. In fact, I first got this error when it was attempting to load the icon file for the VSIX...as if it were an assembly. If I rename or remove the file in the error message and rebuild I just get the same error but with the next random not-an-assembly file that the compiler encounters.
Why is the compiler attempting to load random files as if they were assemblies? How can I make it stop so that I can actually build my VSIX project?
More info:
This error is thrown by the DetokenizeVsizManifestSource build step defined in Microsoft.VsSDK.targets:
<DetokenizeVsixManifestSource
InputFile="#(SourceVsixManifest)"
OutputFile="$(IntermediateVsixManifest)"
ResolvedReferences="#(_VsixManifestResolvedReferences)">
<Output TaskParameter="OutputFile" ItemName="FileWrites" />
</DetokenizeVsixManifestSource>
I had the same problem. It seems you can't add add an applciation to a VSIX. You need the project to output a dll and attach that.
If you need to attach an application try to do so as File not as Project.
I have just deployed by first website to appharbor. One problem I came across was pre-compiling the razor .cshtml file giving an error that it couldn't find the Nancy.ViewEngines.Razor.BuildProviders.dll assembly. The build provider is just referenced from the web.config file without a direct hard reference. I am assuming that, because the assembly wasn't referenced anywhere, it was not being copied to the appharbor output folder. Consequently when the asp.net compiler tried to execute, it failed because the razor build provider was missing.
The way I got around this was to reference the assembly in the web project. It now builds and deploys fine. But, it's a bit dirty and I wondered if there was another way to do it?
I'm getting the following error:
Could not load file or assembly 'System.Web' or one of its dependencies. The system cannot find the file specified.
To reproduce it, Create a new website in Visual Studio 2012. It creates a new templated website.
Add the AjaxControlToolkit via NuGet. Change the scriptmanager to the toolkit scriptmanager on the masterpage.
Clean solution, compile solution, run in debug.
I checked and double checked my references to System.Web (version 4.0 is what shows). All perfect. Running Code Analysis - no errors, no warnings, all perfect.
Any ideas? (All I want to do is create a simple website using a few AJAX controls)
Solution:
Remove reference to MsAjaxBundle
Remove Assembly="System.Web" from all script references
Add 2 new script references
asp:ScriptReference tag Assembly="AjaxControlToolkit" Name="ExtenderBase.BaseScripts.js"
asp:ScriptReference Assembly="AjaxControlToolkit" Name="Common.Common.js"
voila!
I found the answer here:
AjaxControlToolkit 7.0123 breaks VS2012 Web Application Project
I have a library of business logic written in VB.NET. It references some DLLs from vendors, these are set to Copy Local = true. When I build this VB.NET project, I can browse to its bin directory and confirm that everything was correctly copied.
Now I have a C# ASP.NET MVC application that references the VB.NET library project. I can build the C# application, but when I browse to its bin directory, only the VB.NET DLL is there, and all the vendor references that the VB.NET DLL needs are NOT there.
That is,
Dependency chain is:
C# MVC -> VB.NET library -> Vendor library
MyLibrary\bin folder contains:
MyLibrary.dll, MyVendor.dll
MyMVC\bin folder contains:
MyMVC.dll, MyLibrary.dll (MyVendor.dll is missing!)
Why is this not copying, and how do I make it?
Workarounds like setting up a post-build action are not going to work, as this is going into Microsoft Azure, and files copied post-build do not get bundled into the .cspkg deployment file.
References are not transitive.
You need to add a reference to the vendor library to the C# project too.
I have a simple MVC solution with 2 projects, domain and web. There is no real magic in there except that when I build the solution a log4net.dll mysteriously appears in my web project's bin folder. I picked this up after my \Views\Shared\Error.cshtml had a squiggly line below the top line (#model System.Web.Mvc.HandleErrorInfo) saying: "Asp.Net runtime error:Could not load file or assembly log4net.............blah,blah,blah"
I do not have a reference to any log4net in any of my projects, how is the dll getting there? I do not even have anything in my web.config with the word log4net in. This is a MVC3 Framework 4 project.
It's possible that you have installed some NuGet package which depends on log4net. If you don't use NuGet packages maybe you have referenced an assembly which depends on log4net. So when this assembly is loaded the log4net assembly is copied as it is a dependent assembly.