CrystalReports error - visual-studio-2010

I inherited a web app which I'm tasked with maintaining. The application has a dozen or so crystal reports, but I couldn't open them (well, I -could- but they were mostly numeric in nature).
I installed this: http://scn.sap.com/people/coy.yonce/blog/2010/11/12/crystal-reports-for-visual-studio-2010-production-release-now-available
Then, I could open them properly. I made the necessary adjustments to some of them, saved, and attempted to test locally. Before installing crystal reports (above), I ran the application locally and it worked fine.
The problem: Now that I've installed it and made my changes (very minor stuff and only to the rpts, not to any aspx files), I'm getting this error:
Parser Error Message: Could not load file or assembly 'System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
Source Error: [No relevant source lines]
Here's what I have in Web.config pertaining to Crystal Reports:
<assemblies>
<add assembly="CrystalDecisions.Shared, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
<add assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
<add assembly="CrystalDecisions.ReportSource, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
<add assembly="CrystalDecisions.CrystalReports.Engine, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
<add assembly="CrystalDecisions.ReportAppServer.ClientDoc, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
The versions here match the version in the reference's properties.
There are no dlls in the bin folder beyond the application's own dll.
There are the following 'Crystal' related references: CrystalDecisions.CrystalReports.Engine, CrystalDecisions.ReportSource, CrystalDecisions.Shared, CrystalDecisions.Web
I've researched the problem, and some say I need to add an ajax dll. Which one? Also, in what way does that relate?
This was supposed to be a tiny adjustment and it's turning into a big thing at this point. Any help you are able to offer is greatly appreciated.
Thanks!

The problemi is tied to System.Web.Extensions dll, it's not a Crystal Reports problem.
Try removing System.Web.Extensions line in web.config.

Related

Could not load file or assembly 'Microsoft.Configuration.ConfigurationBuilders.Azure, Version=1.0.0.0

Tying to build a freshly cloned project, when i build i get this error
Could not load file or assembly 'Microsoft.Configuration.ConfigurationBuilders.Azure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. Strong name signature could not be verified. The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045)
Things I've tried
Removing the reference and adding back in
changing build properties from debug to release
disabling strong name verification via command line using the command "sn -Vr
Microsoft.Configuration.ConfigurationBuilders.Azure.dll"
i've tried updating the reference to latest / previous versions
Everything I try and nothing seems to work, any other ideas?
In app.config or Web.config, delete the following:
, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
download this nuget package and this will work for you.
.NET Framework:
For me the issue was that I had to change the Version=1.0.0.0 in my web.config to match what was loaded and referenced in the web application references. Right click [Microsoft.Configuration.ConfigurationBuilders.Azure] and go to properties and you'll see the version at the bottom. For me it was Version=2.0.0.0.

Suppressing Microsoft Fakes warnings

I'm using Microsoft Fakes to shim a couple WindowsAzure components for testing. Following the advice in vs 2012: Shims compile, I updated my .fakes file to just generate the shims I actually need:
<Fakes xmlns="http://schemas.microsoft.com/fakes/2011/" Diagnostic="false">
<Assembly Name="Microsoft.WindowsAzure.Storage" Version="2.1.0.0"/>
<StubGeneration>
<Clear/>
</StubGeneration>
<ShimGeneration>
<Clear/>
<Add FullName="Microsoft.WindowsAzure.Storage.CloudStorageAccount"/>
<Add FullName="Microsoft.WindowsAzure.Storage.Blob.CloudBlobClient"/>
<Add FullName="Microsoft.WindowsAzure.Storage.Blob.CloudBlobContainer"/>
<Add FullName="Microsoft.WindowsAzure.Storage.Blob.CloudBlockBlob"/>
<Add FullName="Microsoft.WindowsAzure.Storage.Queue.CloudQueueClient"/>
<Add FullName="Microsoft.WindowsAzure.Storage.Queue.CloudQueue"/>
</ShimGeneration>
</Fakes>
But I'm still getting the "Some fakes could not be generated..." warning. All the specified shims are being generated, and commenting any of those above lines out causes my test project to fail to build. If I turn on diagnostics, I see dozens of messages like:
Warning 2 Cannot generate shim for Microsoft.WindowsAzure.Storage.Blob.CloudBlobClient+<>c__DisplayClass1: type is not supported because of internal limitations.
Everything works, I just want to suppress the warning so it stops confusing our CI server. Is there a warning number for the non-diagnostic message I can just stick in the test project to ignore?
You can remove types from the shimgeneration using
<Remove TypeName="c__DisplayClass" />
That will remove out all the types containing the above string.
See msdn link
I solved this by going into my Fakes folder and deleting the fakes for that assembly, then going into the References folder and deleting the fakes DLL for that assembly. Then I right-clicked on the assembly in references, and chose Add Fakes Assembly (again).
After it did all the fakes creation stuff (takes a few minutes), I built the project again and all the errors went away.

How to use wizard assemblies attached in VsixMainfest in project templates?

I have a vsixmanifest file that has an assembly attribute. The file looks like:
<Content>
<ProjectTemplate>Solution</ProjectTemplate>
<Assembly AssemblyName="SolutionNameWizard, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1c39bfcc-223f-4c12-a5dc-55eeca7c61f7">
Assemblies\SolutionNameWizard.dll
</Assembly>
I know that the assembly name and public key are correct.
Now, I am trying to use this assembly in one of my templates. Right now I have:
<WizardExtension>
<Assembly>SolutionNameWizard, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1c39bfcc-223f-4c12-a5dc-55eeca7c61f7</Assembly>
<FullClassName>SolutionNameWizard.IWizardImplementation</FullClassName>
</WizardExtension>
Is there something that I am missing? When I run the vsix I get the following error:
A problem was encountered creating the sub project 'test.Web' Error: this template
attemtped to load component assembly 'SolutionNameWizard, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1c39bfcc-223f-4c12-a5dc-55eeca7c61f7'.
I know that templates require the assembly to be in the GAC, is that also the case when I am using vsix? I was hoping to avoid the GAC and still use my wizard.
EDIT: I changed the public key to the proper string as suggested in the answers, but am still having the issue.
Edit 2: in addition to the helpful answer below, here is a blog that I wrote after I finished this process. It links to a bunch of articles that I found to be very helpful: https://thebhwgroup.com/blog/2013/10/visual-studio-templates
If your assembly is being provided via your VSIX, it does not need to be in the GAC.
Your PublicKeyToken is definitely not correct. You're using a Guid when it should be a 16-character hex string (8 bytes). See the following example:
MyAssembly, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
You can find the PublicKeyToken value for your assembly by running sn.exe -T MyAssembly.dll from a VS command prompt.
If anyone else happens to stumble upon this question, I ended up following this guide: http://blog.tonysneed.com/2011/09/14/build-a-multi-project-visual-studio-template/
It made the process (mostly) very easy. If anyone happens to run into similar issues, feel free to contact me and I can try to share what I learned.
Edit: here is short blog article I wrote after completing this process. It might be helpful for someone who stumbles upon this: http://www.thebhwgroup.com/blog/2013/10/visual-studio-templates/

System.Web.Helpers does not exist in namespace: WebImage

While I know this has been "answered" about 50 million times, I haven't found an answer that fixes the issue for me, so I feel like I have no choice but to ask again.
Previous suggestions:
Razor pages in MVC are giving a compile error with System.Web.Helpers not being found
<add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
I have added this to my web.config, but the issue remains.
Type or namespace name does not exist
I only have one project, and the targetFramework is 4.0.
I installed Microsoft.Web.Helpers 1.15 (2.0 is incompatible with MVC3.) The Microsoft.Web.Helpers.dll is in my bin folder.
The odd thing is that there's Microsoft.Web.Helpers and System.Web.Helpers. I need System.Web.Helpers in this case, because I'm using WebImage in my code.
As I keep telling people, it's when I ask for help that I find the answer. In my case, somehow in the process of destroying my Solution earlier by upgrading to Microsoft ASP.NET Helper Library 2.0 and then trying to undo that action, System.Web.Helpers stopped being a referenced assembly in my project. Simple fix!
Of course, fixing that led me to the next Assembly Reference error. I think I'll be here all night.

Migrating MVC2 to MVC3: problem with MVCFutures

I'm trying to migrate an MVC2 project to MVC3 - i've followed the instructions within the release notes and the app will compile, but the project depends on a few helpers located inside the previous MVCFutures and tosses:
Compiler Error Message: CS1061: 'System.Web.Mvc.HtmlHelper' does not contain a definition for 'SubmitImage' and no extension method 'SubmitImage' accepting a first argument of type 'System.Web.Mvc.HtmlHelper' could be found (are you missing a using directive or an assembly reference?)
My solution includes a Lib folder, inside of which is:
MVCFutures\Microsoft.Web.Mvc.dll
Do i have an upgrade option here?
use this tools for upgrading:
http://blogs.msdn.com/b/marcinon/archive/2011/01/13/mvc-3-project-upgrade-tool.aspx
#justSteve,
First off, you can download the MVC3 source from codeplex, which includes the MvcFutures code, and just build the new futures assembly yourself.
However, I'd be willing to bet that your problem is a missing using statement somewhere.
Make sure your page has a using namespace statement for Microsoft.Web.Mvc.
If you're trying to migrate to Razor (which you didn't say, but just in case), you can put a namespace reference in the web.config file contained in your Views folder (to avoid having to include the using statement in each of your views), like this:
<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<pages pageBaseType="System.Web.Mvc.WebViewPage">
<namespaces>
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Routing" />
<add namespace="Microsoft.Web.Helpers" />
...
</namespaces>
</pages>
</system.web.webPages.razor>
You mentioned that your MVC futures binary is located in a Lib folder. Make sure that:
Your project has an assesmbly reference to that library
The MvcFutures dll is being copied to the bin folder
Your web.config has an assembly reference to MvcFutures
Could you also clarify if the exception you are seeing is when compiling your app in Visual Studio (because you are using MVC futures methods in your controllers or data models) or when you access your application in the browser (because you are using futures in your views).
Btw, an upgraded version of MVC Futures that targets MVC 3 will be released soon.
Update: The source code for MVC 3 Futures is already available on codeplex: http://aspnet.codeplex.com/releases/view/58781 so you can compile it yourself.
For upgrading your views you might want to try this from Telerik...
https://github.com/telerik/razor-converter
...it will convert your webforms views to razor.
Regards
Paul

Resources