.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Problem building with InternalsVisibleTo with projects having workflows with default value set to ar

Posted By:      Posted Date: September 03, 2010    Points: 0   Category :Windows Application
To reproduce : - Create a C# Class library project with this class :   namespace ClassLibrary1 { internal class Class1 {} } - Create a new C# Test Project and create this unit test class : using ClassLibrary1; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace TestProject1 { [TestClass] public class UnitTest1 { [TestMethod] public void TestMethod1 () { // this is ok : Class1 class1 = new Class1 (); } // Compile time problem : // Error 1 'ClassLibrary1.Class1' est inaccessible en raison de son niveau de protection // Error 4 Accessibilité incohérente : le type de paramètre 'ClassLibrary1.Class1' est moins accessible que la méthode 'TestProject1.UnitTest1.TestA(ClassLibrary1.Class1)' private static void TestA (ClassLibrary1.Class1 a) { } // Compile time problem : // Error 1 'ClassLibrary1.Class1' est inaccessible en raison de son niveau de protection // Error 2 Accessibilité incohérente : la classe de base 'ClassLibrary1.Class1' est moins accessible que la classe 'TestProject1.UnitTest1.Derived' internal class Derived : Class1 { } } } - Add a InternalsVisibleTo atribute into the class library project : [assembly:InternalsVisibleTo ("TestProject1")] - Add a new "Workflow\Activity"

View Complete Post

More Related Resource Links

Problem passing custom object returned by the same webservice among two separate projects

I am running into casting issue with this scenario: 1. I made a custom object lets call it EmployeeObject.  2. The Employee object is wrapped in the EmployeeWebservice.  3. I have a client application project lets call it EmployeeClientApplication and a class library called DoSomeWorkClassLibrary.  Both EmployeeClientApplication and DoSomeWorkClassLibrary reference the EmployeeWebService and need to be able to pass the EmployeeObject back and forth.  4. The EmployeeClientApplication also references the DoSomeWorkClassLibrary. 5. The employeeObject in the EmployeeClientApplication becomes EmployeeClientApplication.EmployeeWebService.EmployeeObject. 6. The employeeObject in the DoSomeWorkClassLibrary becomes DoSomeWorkClassLibrary.EmployeeWebService.EmployeeObject. 7. The DoSomeWorkClassLibrary has a method called DoSomeWork that takes an EmployeeObject. When I try to pass employeeObject from EmployeeClientApplication to DoSomeWorkClassLibrary by doing something like this: DoSomeWorkClassLibrary.DoSomeWork(EmployeeClientApplication.EmployeeWebService.EmployeeObject), I am getting Unable to convert EmployeeClientApplication.EmployeeWebService.EmployeeObject to DoSomeWorkClassLibrary.EmployeeWebService.EmployeeObject.  I have searched high and low to fix this issue, I have tried changing the namespace of the reference.cs file of the webservice in

Problem with default routing

Hi, I am Ashish. I have developed an ASP.NET web application using MVC 1.0. I have taken a view named TaskUI and Controller TMController. I have chosen my UI page is as default page, and accordingly I changed Default Rout as given bellow: routes.MapRoute( "TaskUI",// Route name "{controller}/{action}/{id}"// URL with parameters new{ controller = "TM", action = "CreateTask", id = "" } // Parameter defaults); It is working great... My UI page contains a textbox which is tagged with a javascript onChange function <%=Html.TextBox("TaskId", ViewData.Model.Task.TaskId, new { size = 10, onChange = "GetTaskInfo1()", onkeypress = "InputOnlyNumber(event)" })%> When I input a value on the textbox and press the tab the javascript function is called which isfunction GetTaskInfo1() { var vCalleeVar1 = document.getElementById('TaskId').value; if (vCalleeVar1 != undefined && vCalleeVar1 != null) { location.reload("GetTaskInfo?pTaskId=" + vCalleeVar1); return true; } else return false; } Now the problem is the URL that gets LocalHost.../GetTaskInfo?pTaskId=123, whether it should be LocalHost.../TM/GetTaskInfo?pTaskId=123, because the action "GetTaskI

Problem Saving Files to A Sharepoint 2010 Site from Office 2010: Saves locally by default rather tha

Hi we are starting to use sharepoint 2010 / word 2010 and have found an interesting bug/problem. Sometimes when a user tries to save a file (by clicking on the save button in the quick access toolbar for word 2010) the save dialog comes up with the users local "Documents" folder as the path (not the correct sharepoint path where the document should be saved).  (I should say that we are creating the file from sharepoint by using a toolbar on the document library, with the new button)  We are using a content type and a template attached to the document library when we create the file.  This is really annoying because the user might not notice that the document is saving locally and not to sharepoint.  I have found a strange workaround which involves clicking the [File] tab on the ribbon in word 2010, then clicking "Save and Send" and then clicking the save button again.  At this point word 2010 seems to "remember" that it is trying to save document to sharepoint and shows the sharepoint document library. This is a real nuisance which could lead to documents being lost/misfiled if people don't realize that this is happening.  Can anyone help me? Thanks Kevin krd

Building and Deploying Projects

One of my biggest obstacles to development is that whenever I want to deploy a change I have to run a series of powershell scripts to destroy the site, retract the solution, install the solution and create the site. With the current small to medium size of my project they take about 6 to 8 minutes to run, that's a lot of downtime/time when i'm not coding during a day! I'd be keen to hear about how anyone else builds, we've used VS2010 deployment in the past but we occasionally ran into strange issues, so hence the powershell - i think VS largely does the same thing anyway? My second question is can i parallelise any of these tasks? For instance, should it be safe to destroy the site and retract the solution at the same time rather than one after the other? Thanks, HC

problem with connecting to local SQL Server 2008 default instance using windows authentication




I have a user getting some problem with connecting to local SQL Server 2008 default instance using windows authentication with a user which has sysadmin role and is owner of each existing database:

2010-09-28 15:40:35.04 Logon       Error: 18456, Severity: 14, State: 11.


2010-09-28 15:40:35.04 Logon       Login failed for user 'IIS APPPOOL\RoomViewSEWebClient'. Reason: Token-based server access validation failed with an infrastructure error. Check for previous errors. [CLIENT:]



This us

Default (but overrideable) date in DetailsView problem


I'm using a DetailsView control in Insert Mode (GridView for editing). I want to have today's date default into my date field, but the date has to be able to be overridden by the user.  

I can bind it to the database element (1) OR I can default today's date (1) , but seeming not both. What am I doing wrong?

(1) - Bind to database element

<asp:TemplateField HeaderText="Date" SortExpression="EmployeeTimeDate">


      <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("EmployeeTimeDate") %>'></asp:TextBox>



      <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("EmployeeTimeDate") %>'></asp:TextBox>



      <asp:Label ID="Label5" runat="server" Text='<%# Bind("EmployeeTimeDate", "{0:d}") %>'></asp:Label>



problem in applying SharePoint Designer Workflows to Lists in my Web application


Hi Mark,

I am so happy finding your forum.

I have installed MOSS 2007 with SP2 on a Windows Server 2008. I had no problem in configuring and creating Web Applications and Sites. However, there seems to be a problem in applying SharePoint Designer Workflows to Lists in my Web application. The problem is that the workflow I create to start automatically when an item in the List is changed doesn't work. The workflows works fine if it's started manually from an item in the list, but it's doesn’t work when it's started automatically with an item change in the list. I have checked the workflow on another MOSS 2007 installation on Server 2003 and it works fine. Have I missed something in the configurations?

Thanks for y

Problem with default list form


Hi, I was following this article to create custom forms for my content types in a list but I am not able to get that each content type use his custom form.

The form set as default is used no matter what content type item I am creating. there is any kind of problem or setting that I am missing?

If I understand well the below text extracted form the article this is posible, but how?

 "Note   Every list or library can be configured to allow multiple content types, which then appear in this menu. You can use a distinct set of custom list forms for each content type available for a list or library. For example, if your list has both a Press Releases content type and an Industry News content type, you can create and use two separate sets of custom list forms, one for each of the two content types. The advantage to using a separate set of custom list forms for each content type is that then each custom list form is designed to display only the fields that are appropriate for that content type. Find more information about content type

Building a Searchable Phone Directory with Windows SharePoint Services

I want to continue to build out the intranet site we've started in our previous articles. A standard item in every intranet is a staff/employee list. Most companies implementing Windows SharePoint Services (WSS) are large enough to have a database that contains all employees. We will use the aggregation features of SharePoint to include data from this database into our intranet.

Building a grouping Grid with GridView and ASP.NET AJAX toolkit CollapsiblePanel

I've posted an update to this post to apply on demand loading of Details data using ASP.NET AJAX PageMethods. I'm demonstrating the usage if CollapsiblePanelExtender client events on the new post. Check it out.

I admit, Matt Berseth is really inspiring me! Few days ago I pass through 2 of his great posts:

.Surrounding your Data Table and Dialog Controls with ComponentArt Styled Panels
.Building a Grouping Grid with the ASP.NET 3.5 LinqDataSource and ListView Controls
The first one is pure design tips one which I used for making good presentation of my demo here. The 2nd post is actually the idea.

Building Layered Web Applications with Microsoft ASP.NET 2.0 - Part 1

"Building Layered Web Applications" that shows you how to build N-Layer applications with Microsoft ASP.NET 2.0. These articles teach you how to design, build and use custom business objects in your web application. The target audience for this series are developers that are ready to make the switch from using SqlDataSource controls to ObjectDataSource controls with custom business objects. Experience with ASP.NET 2 and C# is necessary while some knowledge about object oriented design certainly helps. The design I am going to show you in these articles is a simplified version of a design you would use in a real world application. It doesn't feature all the necessary functionality your application needs, but instead focuses on the underlying concepts.

Problem to group radio button across gridview rows

In general no one can easily group or make a single selection from radio button list inside gridview rows. There are a lot of way to make a single or unique selection from list. Here i want to share how i can address this problem in the most easiest way. Googling the problem most of the cases i saw the grouping in horizontal way. Thats why i tried to group the radio buttons in vertical manner. Let i have a requirement like below:

Default ASP.NET Architecture

In providing an architectural approach, some assumptions are made concerning the project goals. These assumptions should be used as a litmus test to determine if the described architecture may be an appropriate fit for your ASP.NET application.

Building a 3-Tier App with Silverlight 3, .NET RIA Services, and Azure Table Storage

Silverlight 3, .NET RIA Services, and Windows Azure Services Platform makes a 3-tier Cloud application easier to build: Silverlight 3 as presentation tier, .NET RIA services as the business logic and data access tier, and Windows Azure Table as the data storage tier. The sample application in this article demonstrates the architecture with a simple Survey application with all these technologies working together from Windows Azure.

How to get more information about the exceptions that can happen in SharePoint 2010 projects?

In case there is an exception anywhere in the SharePoint 2010 project (most common place an exception would happen is during deployment of your SharePoint project, custom deployment configuration or custom deployment steps), there's a registry key EnableDiagnostics available for you to use.

Building a LINQ Provider

Throughout this article, we will build a simple IQueryable provider similar to the LINQ to SQL provider demonstrating what is needed to build a custom provider that is capable of executing LINQ queries and performing create, update and delete operations.

Regrading Sharpoint 2010 problem and solutions

We can write your question and problem on this blogger.you get ans.use.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend